diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md b/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md index d593b25e85f4..013388507158 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md @@ -1,14 +1,458 @@ # Release History -## 1.1.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2025-05-13) + +- Azure Resource Manager HDInsight client library for Java. This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2025-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.OutboundDependenciesManagedType` was added + +* `models.EntraUserInfo` was added + +* `models.IpTag` was added + +#### `models.Cluster$Update` was modified + +* `withIdentity(models.ClusterIdentity)` was added + +#### `models.ResourceId` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LocalizedName` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NetworkProperties` was modified + +* `publicIpTag()` was added +* `withOutboundDependenciesManagedType(models.OutboundDependenciesManagedType)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `outboundDependenciesManagedType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withPublicIpTag(models.IpTag)` was added + +#### `models.LinuxOperatingSystemProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Extensions` was modified + +* `enableAzureMonitorAgent(java.lang.String,java.lang.String,models.AzureMonitorRequest,com.azure.core.util.Context)` was added +* `getAzureMonitorAgentStatusWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `disableAzureMonitorAgent(java.lang.String,java.lang.String)` was added +* `getAzureMonitorAgentStatus(java.lang.String,java.lang.String)` was added +* `disableAzureMonitorAgent(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `enableAzureMonitorAgent(java.lang.String,java.lang.String,models.AzureMonitorRequest)` was added + +#### `models.Role` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OsProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiskEncryptionProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ApplicationProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshPublicKey` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KafkaRestProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterCreateParametersExtended` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ApplicationGetEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterDiskEncryptionParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Errors` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateEndpoint` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScriptActionExecutionSummary` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureMonitorTableConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HardwareProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VmSizeProperty` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterResizeParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceSpecification` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Usage` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClientGroupInfo` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AutoscaleSchedule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NameAvailabilityCheckRequestParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterCreateProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.QuotaCapability` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VersionsCapability` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BillingMeters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiskBillingMeters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Autoscale` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Dimension` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateLinkConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IpConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UpdateGatewaySettingsParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `restAuthEntraUsers()` was added +* `withRestAuthEntraUsers(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RegionsCapability` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoscaleTimeAndCapacity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VmSizeCompatibilityFilterV2` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ValidationErrorInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualNetworkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ExecuteScriptActionParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added -### Bugs Fixed +#### `models.VersionSpec` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RegionalQuotaCapability` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataDisksGroups` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added -### Other Changes +#### `models.ClusterDefinition` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrivateEndpointConnectionListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScriptAction` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageAccount` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `enableSecureChannel()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withEnableSecureChannel(java.lang.Boolean)` was added + +#### `models.BillingResources` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ApplicationListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConnectivityEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.GatewaySettings` was modified + +* `restAuthEntraUsers()` was added + +#### `models.AutoscaleConfigurationUpdateParameter` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MetricSpecifications` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureMonitorSelectedConfigurations` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPatchParameters` was modified + +* `withIdentity(models.ClusterIdentity)` was added +* `identity()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComputeIsolationProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScriptActionExecutionHistoryList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ExcludedServicesConfig` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoscaleRecurrence` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Extension` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ApplicationGetHttpsEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterCreateRequestValidationParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AaddsResourceDetails` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EncryptionInTransitProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScriptActionsList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoscaleCapacity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AzureMonitorRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateClusterIdentityCertificateParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.QuotaInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterGetProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RuntimeScriptAction` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SecurityProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterMonitoringRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added ## 1.1.0-beta.2 (2024-08-21) diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md b/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md index 4f58d141f653..05d460f6b855 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HDInsight client library for Java. -This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2024-08-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2025-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ HDInsightManager manager = HDInsightManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -71,15 +71,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples ```java -com.azure.resourcemanager.storage.models.StorageAccount storageAccount = - storageManager.storageAccounts().define(storageName) - .withRegion(REGION) - .withExistingResourceGroup(resourceGroupName) - .withSku(StorageAccountSkuType.STANDARD_LRS) - .withMinimumTlsVersion(MinimumTlsVersion.TLS1_0) - .withAccessFromAzureServices() - .withAccessFromAllNetworks() - .create(); +com.azure.resourcemanager.storage.models.StorageAccount storageAccount = storageManager.storageAccounts() + .define(storageName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withSku(StorageAccountSkuType.STANDARD_LRS) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_0) + .withAccessFromAzureServices() + .withAccessFromAllNetworks() + .create(); BlobContainer blobContainer = storageManager.blobContainers() .defineContainer(containerName) @@ -87,59 +87,52 @@ BlobContainer blobContainer = storageManager.blobContainers() .withPublicAccess(PublicAccess.NONE) .create(); -cluster = hdInsightManager.clusters() - .define(clusterName) - .withExistingResourceGroup(resourceGroupName) - .withRegion(REGION) - .withProperties( - new ClusterCreateProperties() - .withClusterVersion("4.0.3000.1") - .withOsType(OSType.LINUX) - .withClusterDefinition( - new ClusterDefinition() - .withKind("SPARK") +cluster + = hdInsightManager.clusters() + .define(clusterName) + .withExistingResourceGroup(resourceGroupName) + .withRegion(REGION) + .withProperties( + new ClusterCreateProperties().withClusterVersion("4.0.3000.1") + .withOsType(OSType.LINUX) + .withClusterDefinition(new ClusterDefinition().withKind("SPARK") .withConfigurations(Collections.unmodifiableMap(clusterDefinition))) - .withComputeProfile( - new ComputeProfile() - .withRoles( - Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_e8_v3")) - .withOsProfile(osProfile) - .withEncryptDataDisks(false), - new Role().withName("workernode") - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_e8_v3")) - .withOsProfile(osProfile) - .withEncryptDataDisks(false), - new Role().withName("zookeepernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_a2_v2")) - .withOsProfile(osProfile) - .withEncryptDataDisks(false) - ))) - .withTier(Tier.STANDARD) - .withEncryptionInTransitProperties( - new EncryptionInTransitProperties() - .withIsEncryptionInTransitEnabled(false)) - .withStorageProfile( - new StorageProfile() - .withStorageaccounts( - Arrays.asList( - new StorageAccount() - .withName(storageName + ".blob.core.windows.net") - .withResourceId(storageAccount.id()) - .withContainer(blobContainer.name()) - .withIsDefault(true) - .withKey(storageAccount.getKeys().iterator().next().value())) - )) - .withMinSupportedTlsVersion("1.2") - .withComputeIsolationProperties( - new ComputeIsolationProperties() - .withEnableComputeIsolation(false)) - ) - .create(); + .withComputeProfile( + new ComputeProfile() + .withRoles( + Arrays + .asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile( + new HardwareProfile().withVmSize("standard_e8_v3")) + .withOsProfile(osProfile) + .withEncryptDataDisks(false), + new Role().withName("workernode") + .withTargetInstanceCount(4) + .withHardwareProfile( + new HardwareProfile().withVmSize("standard_e8_v3")) + .withOsProfile(osProfile) + .withEncryptDataDisks(false), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile( + new HardwareProfile().withVmSize("standard_a2_v2")) + .withOsProfile(osProfile) + .withEncryptDataDisks(false)))) + .withTier(Tier.STANDARD) + .withEncryptionInTransitProperties( + new EncryptionInTransitProperties().withIsEncryptionInTransitEnabled(false)) + .withStorageProfile(new StorageProfile().withStorageaccounts( + Arrays.asList(new StorageAccount().withName(storageName + ".blob.core.windows.net") + .withResourceId(storageAccount.id()) + .withContainer(blobContainer.name()) + .withIsDefault(true) + .withKey(storageAccount.getKeys().iterator().next().value())))) + .withMinSupportedTlsVersion("1.2") + .withComputeIsolationProperties( + new ComputeIsolationProperties().withEnableComputeIsolation(false))) + .create(); ``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md) @@ -171,5 +164,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md b/sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md index 85dd5231896f..6a4236f431bf 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md @@ -107,7 +107,7 @@ import java.util.Arrays; public final class ApplicationsCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateApplication.json */ /** @@ -143,22 +143,22 @@ public final class ApplicationsCreateSamples { ```java /** - * Samples for Applications Delete. + * Samples for ScriptActions Delete. */ -public final class ApplicationsDeleteSamples { +public final class ScriptActionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DeleteApplication.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DeleteScriptAction.json */ /** - * Sample code: Delete Application from HDInsight cluster. + * Sample code: Delete a script action on HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ public static void - deleteApplicationFromHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.applications().delete("rg1", "cluster1", "hue", com.azure.core.util.Context.NONE); + deleteAScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptActions().deleteWithResponse("rg1", "cluster1", "scriptName", com.azure.core.util.Context.NONE); } } ``` @@ -167,892 +167,566 @@ public final class ApplicationsDeleteSamples { ```java /** - * Samples for Applications Get. + * Samples for Applications ListByCluster. */ -public final class ApplicationsGetSamples { +public final class ApplicationsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetApplicationInProgress.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetAllApplications.json */ /** - * Sample code: Get application on HDInsight cluster creation in progress. + * Sample code: Get All Applications for an HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getApplicationOnHDInsightClusterCreationInProgress( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.applications().getWithResponse("rg1", "cluster1", "app", com.azure.core.util.Context.NONE); + public static void + getAllApplicationsForAnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.applications().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); } +} +``` +### Applications_GetAzureAsyncOperationStatus + +```java +/** + * Samples for Locations ListUsages. + */ +public final class LocationsListUsagesSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetApplicationCreated.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetHDInsightUsages.json */ /** - * Sample code: Get application on HDInsight cluster successfully created. + * Sample code: Get the subscription usages for specific location. * * @param manager Entry point to HDInsightManager. */ - public static void getApplicationOnHDInsightClusterSuccessfullyCreated( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.applications().getWithResponse("rg1", "cluster1", "app", com.azure.core.util.Context.NONE); + public static void + getTheSubscriptionUsagesForSpecificLocation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.locations().listUsagesWithResponse("West US", com.azure.core.util.Context.NONE); } } ``` -### Applications_GetAzureAsyncOperationStatus +### Applications_ListByCluster ```java /** - * Samples for Applications GetAzureAsyncOperationStatus. + * Samples for Clusters GetGatewaySettings. */ -public final class ApplicationsGetAzureAsyncOperationStatusSamples { +public final class ClustersGetGatewaySettingsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetApplicationCreationAsyncOperationStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Clusters_GetGatewaySettings.json */ /** - * Sample code: Get the azure async operation status. + * Sample code: Get HTTP settings. * * @param manager Entry point to HDInsightManager. */ - public static void getTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.applications() - .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "app", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", - com.azure.core.util.Context.NONE); + public static void getHTTPSettings(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().getGatewaySettingsWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Applications_ListByCluster +### Clusters_Create ```java /** - * Samples for Applications ListByCluster. + * Samples for Extensions GetAzureMonitorAgentStatus. */ -public final class ApplicationsListByClusterSamples { +public final class ExtensionsGetAzureMonitorAgentStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetAllApplications.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxClusterAzureMonitorAgentStatus.json */ /** - * Sample code: Get All Applications for an HDInsight cluster. + * Sample code: Get azure monitor agent status. * * @param manager Entry point to HDInsightManager. */ - public static void - getAllApplicationsForAnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.applications().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void getAzureMonitorAgentStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions() + .getAzureMonitorAgentStatusWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Clusters_Create +### Clusters_Delete ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hdinsight.models.Autoscale; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.ClientGroupInfo; -import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; -import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; -import com.azure.resourcemanager.hdinsight.models.ComputeIsolationProperties; -import com.azure.resourcemanager.hdinsight.models.ComputeProfile; -import com.azure.resourcemanager.hdinsight.models.DataDisksGroups; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import com.azure.resourcemanager.hdinsight.models.DirectoryType; -import com.azure.resourcemanager.hdinsight.models.DiskEncryptionProperties; -import com.azure.resourcemanager.hdinsight.models.EncryptionInTransitProperties; -import com.azure.resourcemanager.hdinsight.models.HardwareProfile; -import com.azure.resourcemanager.hdinsight.models.IpTag; -import com.azure.resourcemanager.hdinsight.models.KafkaRestProperties; -import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; -import com.azure.resourcemanager.hdinsight.models.NetworkProperties; -import com.azure.resourcemanager.hdinsight.models.OsProfile; -import com.azure.resourcemanager.hdinsight.models.OSType; -import com.azure.resourcemanager.hdinsight.models.PrivateLink; -import com.azure.resourcemanager.hdinsight.models.ResourceProviderConnection; -import com.azure.resourcemanager.hdinsight.models.Role; -import com.azure.resourcemanager.hdinsight.models.SecurityProfile; -import com.azure.resourcemanager.hdinsight.models.SshProfile; -import com.azure.resourcemanager.hdinsight.models.SshPublicKey; -import com.azure.resourcemanager.hdinsight.models.StorageAccount; -import com.azure.resourcemanager.hdinsight.models.StorageProfile; -import com.azure.resourcemanager.hdinsight.models.Tier; -import com.azure.resourcemanager.hdinsight.models.VirtualNetworkProfile; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Clusters Create. + * Samples for Locations GetCapabilities. */ -public final class ClustersCreateSamples { +public final class LocationsGetCapabilitiesSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateLinuxHadoopSshPassword.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetHDInsightCapabilities.json */ /** - * Sample code: Create Hadoop on Linux cluster with SSH password. + * Sample code: Get the subscription capabilities for specific location. * * @param manager Entry point to HDInsightManager. */ - public static void createHadoopOnLinuxClusterWithSSHPassword( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withTags(mapOf("key1", "fakeTokenPlaceholder")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":\"true\",\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + public static void getTheSubscriptionCapabilitiesForSpecificLocation( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.locations().getCapabilitiesWithResponse("West US", com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_ExecuteScriptActions +```java +/** + * Samples for Clusters GetByResourceGroup. + */ +public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateKafkaClusterWithKafkaRestProxy.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxHadoopCluster.json */ /** - * Sample code: Create Kafka cluster with Kafka Rest Proxy. + * Sample code: Get Hadoop on Linux cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createKafkaClusterWithKafkaRestProxy( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("4.0") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("kafka") - .withComponentVersion(mapOf("Kafka", "2.1")) - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withKafkaRestProperties(new KafkaRestProperties() - .withClientGroupInfo(new ClientGroupInfo().withGroupName("Kafka security group name") - .withGroupId("00000000-0000-0000-0000-111111111111"))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))) - .withDataDisksGroups(Arrays.asList(new DataDisksGroups().withDisksPerNode(8))), - new Role().withName("zookeepernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("kafkamanagementnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_v2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("kafkauser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + public static void getHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithAutoscaleConfig.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxSparkCluster.json */ /** - * Sample code: Create HDInsight cluster with Autoscale configuration. + * Sample code: Get Spark on Linux cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createHDInsightClusterWithAutoscaleConfiguration( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("hadoop") - .withComponentVersion(mapOf("Hadoop", "2.7")) - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile( - new ComputeProfile() - .withRoles(Arrays.asList(new Role().withName("workernode") - .withTargetInstanceCount(4) - .withAutoscaleConfiguration(new Autoscale().withRecurrence(new AutoscaleRecurrence() - .withTimeZone("China Standard Time") - .withSchedule(Arrays.asList( - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.TUESDAY, - DaysOfWeek.WEDNESDAY, DaysOfWeek.THURSDAY, DaysOfWeek.FRIDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("09:00") - .withMinInstanceCount(3) - .withMaxInstanceCount(3)), - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.TUESDAY, - DaysOfWeek.WEDNESDAY, DaysOfWeek.THURSDAY, DaysOfWeek.FRIDAY)) - .withTimeAndCapacity( - new AutoscaleTimeAndCapacity().withTime("18:00") - .withMinInstanceCount(6) - .withMaxInstanceCount(6)), - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.SATURDAY, DaysOfWeek.SUNDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("09:00") - .withMinInstanceCount(2) - .withMaxInstanceCount(2)), - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.SATURDAY, DaysOfWeek.SUNDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("18:00") - .withMinInstanceCount(4) - .withMaxInstanceCount(4)))))) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_V2")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))) - .withScriptActions(Arrays.asList())))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("hdinsight-autoscale-tes-2019-06-18t05-49-16-591z") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + public static void getSparkOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } +} +``` +### Clusters_GetAzureAsyncOperationStatus + +```java +/** + * Samples for Clusters Delete. + */ +public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateLinuxHadoopSshPublicKey.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DeleteLinuxHadoopCluster.json */ /** - * Sample code: Create Hadoop on Linux cluster with SSH public key. + * Sample code: Delete Hadoop on Linux cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createHadoopOnLinuxClusterWithSSHPublicKey( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withTags(mapOf("key1", "fakeTokenPlaceholder")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile( - new ComputeProfile() - .withRoles( - Arrays - .asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withSshProfile(new SshProfile().withPublicKeys(Arrays - .asList(new SshPublicKey().withCertificateData("**********")))))), - new Role().withName("workernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + public static void deleteHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().delete("rg1", "cluster1", com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_GetByResourceGroup +```java +/** + * Samples for ScriptExecutionHistory ListByCluster. + */ +public final class ScriptExecutionHistoryListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithAvailabilityZones.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetScriptExecutionHistory.json */ /** - * Sample code: Create cluster with availability zones. + * Sample code: Get Script Execution History List. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithAvailabilityZones(com.azure.resourcemanager.hdinsight.HDInsightManager manager) - throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withZones(Arrays.asList("1")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withClusterDefinition(new ClusterDefinition().withKind("hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"ambari-conf\":{\"database-name\":\"{ambari database name}\",\"database-server\":\"{sql server name}.database.windows.net\",\"database-user-name\":\"**********\",\"database-user-password\":\"**********\"},\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"},\"hive-env\":{\"hive_database\":\"Existing MSSQL Server database with SQL authentication\",\"hive_database_name\":\"{hive metastore name}\",\"hive_database_type\":\"mssql\",\"hive_existing_mssql_server_database\":\"{hive metastore name}\",\"hive_existing_mssql_server_host\":\"{sql server name}.database.windows.net\",\"hive_hostname\":\"{sql server name}.database.windows.net\"},\"hive-site\":{\"javax.jdo.option.ConnectionDriverName\":\"com.microsoft.sqlserver.jdbc.SQLServerDriver\",\"javax.jdo.option.ConnectionPassword\":\"**********!\",\"javax.jdo.option.ConnectionURL\":\"jdbc:sqlserver://{sql server name}.database.windows.net;database={hive metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0\",\"javax.jdo.option.ConnectionUserName\":\"**********\"},\"oozie-env\":{\"oozie_database\":\"Existing MSSQL Server database with SQL authentication\",\"oozie_database_name\":\"{oozie metastore name}\",\"oozie_database_type\":\"mssql\",\"oozie_existing_mssql_server_database\":\"{oozie metastore name}\",\"oozie_existing_mssql_server_host\":\"{sql server name}.database.windows.net\",\"oozie_hostname\":\"{sql server name}.database.windows.net\"},\"oozie-site\":{\"oozie.db.schema.name\":\"oozie\",\"oozie.service.JPAService.jdbc.driver\":\"com.microsoft.sqlserver.jdbc.SQLServerDriver\",\"oozie.service.JPAService.jdbc.password\":\"**********\",\"oozie.service.JPAService.jdbc.url\":\"jdbc:sqlserver://{sql server name}.database.windows.net;database={oozie metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0\",\"oozie.service.JPAService.jdbc.username\":\"**********\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")), - new Role().withName("workernode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"))))) - .withStorageProfile( - new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + public static void getScriptExecutionHistoryList(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptExecutionHistories().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_GetGatewaySettings + +```java +import com.azure.resourcemanager.hdinsight.models.Autoscale; +import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; +import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; +import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; +import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; +import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; +import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; +import com.azure.resourcemanager.hdinsight.models.RoleName; +import java.util.Arrays; +/** + * Samples for Clusters UpdateAutoScaleConfiguration. + */ +public final class ClustersUpdateAutoScaleConfigurationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateLinuxHadoopAdlsGen2.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * EnableOrUpdateAutoScaleWithLoadBasedConfiguration.json */ /** - * Sample code: Create Hadoop cluster with Azure Data Lake Storage Gen 2. + * Sample code: Enable or Update Autoscale with the load based configuration for HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createHadoopClusterWithAzureDataLakeStorageGen2( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + public static void enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withTags(mapOf("key1", "fakeTokenPlaceholder")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":\"true\",\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.dfs.core.windows.net") - .withIsDefault(true) - .withFileSystem("default") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, + new AutoscaleConfigurationUpdateParameter().withAutoscale(new Autoscale() + .withCapacity(new AutoscaleCapacity().withMinInstanceCount(3).withMaxInstanceCount(5))), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateLinuxHadoopSecureHadoop.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DisableClusterAutoScale.json */ /** - * Sample code: Create Secure Hadoop cluster. + * Sample code: Disable Autoscale for the HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createSecureHadoopCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) - throws IOException { + public static void + disableAutoscaleForTheHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withTags(mapOf("key1", "fakeTokenPlaceholder")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") - .withOsType(OSType.LINUX) - .withTier(Tier.PREMIUM) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withSecurityProfile(new SecurityProfile().withDirectoryType(DirectoryType.ACTIVE_DIRECTORY) - .withDomain("DomainName") - .withOrganizationalUnitDN("OU=Hadoop,DC=hdinsight,DC=test") - .withLdapsUrls(Arrays.asList("ldaps://10.10.0.4:636")) - .withDomainUsername("DomainUsername") - .withDomainUserPassword("fakeTokenPlaceholder") - .withClusterUsersGroupDNs(Arrays.asList("hdiusers"))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) - .withScriptActions(Arrays.asList()), - new Role().withName("workernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) - .withScriptActions(Arrays.asList()), - new Role().withName("zookeepernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) - .withScriptActions(Arrays.asList())))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, + new AutoscaleConfigurationUpdateParameter(), com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateLinuxSparkSshPassword.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * EnableOrUpdateAutoScaleWithScheduleBasedConfiguration.json */ /** - * Sample code: Create Spark on Linux Cluster with SSH password. + * Sample code: Enable or Update Autoscale with the schedule based configuration for HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createSparkOnLinuxClusterWithSSHPassword( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + public static void enableOrUpdateAutoscaleWithTheScheduleBasedConfigurationForHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withTags(mapOf("key1", "fakeTokenPlaceholder")) - .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Spark") - .withComponentVersion(mapOf("Spark", "2.0")) - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D12_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_V2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true))))) - .create(); + .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, + new AutoscaleConfigurationUpdateParameter().withAutoscale( + new Autoscale().withRecurrence(new AutoscaleRecurrence().withTimeZone("China Standard Time") + .withSchedule(Arrays.asList(new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.THURSDAY)) + .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("16:00") + .withMinInstanceCount(4) + .withMaxInstanceCount(4)))))), + com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_List + +```java +import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; +import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; +import java.util.Arrays; +/** + * Samples for Clusters ExecuteScriptActions. + */ +public final class ClustersExecuteScriptActionsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithCustomNetworkProperties.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * PostExecuteScriptAction.json */ /** - * Sample code: Create cluster with network properties. + * Sample code: Execute script action on HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithNetworkProperties(com.azure.resourcemanager.hdinsight.HDInsightManager manager) - throws IOException { + public static void + executeScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withClusterDefinition(new ClusterDefinition().withKind("hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")), - new Role().withName("workernode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys( - Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) - .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") - .withSubnet( - "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"))))) - .withStorageProfile( - new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true)))) - .withNetworkProperties( - new NetworkProperties().withResourceProviderConnection(ResourceProviderConnection.OUTBOUND) - .withPrivateLink(PrivateLink.ENABLED) - .withPublicIpTag(new IpTag().withIpTagType("FirstPartyUsage").withTag("/")))) - .create(); + .executeScriptActions("rg1", "cluster1", + new ExecuteScriptActionParameters() + .withScriptActions(Arrays.asList(new RuntimeScriptAction().withName("Test") + .withUri("http://testurl.com/install.ssh") + .withParameters("") + .withRoles(Arrays.asList("headnode", "workernode")))) + .withPersistOnSuccess(false), + com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_ListByResourceGroup +```java +import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithTLS12.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * ApprovePrivateEndpointConnection.json */ /** - * Sample code: Create cluster with TLS 1.2. + * Sample code: Approve a private endpoint connection manually. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithTLS12(com.azure.resourcemanager.hdinsight.HDInsightManager manager) - throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("default8525") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true)))) - .withMinSupportedTlsVersion("1.2")) + public static void + approveAPrivateEndpointConnectionManually(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateEndpointConnections() + .define("testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2") + .withExistingCluster("rg1", "cluster1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("update it from pending to approved.") + .withActionsRequired("None")) .create(); } +} +``` + +### Clusters_Resize +```java +import com.azure.resourcemanager.hdinsight.models.NameAvailabilityCheckRequestParameters; + +/** + * Samples for Locations CheckNameAvailability. + */ +public final class LocationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithEncryptionAtHost.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Locations_CheckClusterNameAvailability.json */ /** - * Sample code: Create cluster with encryption at host. + * Sample code: Get the subscription usages for specific location. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithEncryptionAtHost(com.azure.resourcemanager.hdinsight.HDInsightManager manager) - throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("default8525") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true)))) - .withDiskEncryptionProperties(new DiskEncryptionProperties().withEncryptionAtHost(true))) - .create(); + public static void + getTheSubscriptionUsagesForSpecificLocation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.locations() + .checkNameAvailabilityWithResponse("westus", + new NameAvailabilityCheckRequestParameters().withName("test123").withType("clusters"), + com.azure.core.util.Context.NONE); } +} +``` + +### Clusters_RotateDiskEncryptionKey +```java +/** + * Samples for Locations ListBillingSpecs. + */ +public final class LocationsListBillingSpecsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithEncryptionInTransit.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Locations_ListBillingSpecs.json */ /** - * Sample code: Create cluster with encryption in transit. + * Sample code: Get the subscription billingSpecs for the specified location. + * + * @param manager Entry point to HDInsightManager. + */ + public static void getTheSubscriptionBillingSpecsForTheSpecifiedLocation( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.locations().listBillingSpecsWithResponse("East US 2", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Update + +```java +/** + * Samples for Configurations List. + */ +public final class ConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Configurations_List.json + */ + /** + * Sample code: Get all configuration information. + * + * @param manager Entry point to HDInsightManager. + */ + public static void getAllConfigurationInformation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.configurations().listWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_UpdateAutoScaleConfiguration + +```java +/** + * Samples for Applications Get. + */ +public final class ApplicationsGetSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetApplicationInProgress.json + */ + /** + * Sample code: Get application on HDInsight cluster creation in progress. + * + * @param manager Entry point to HDInsightManager. + */ + public static void getApplicationOnHDInsightClusterCreationInProgress( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.applications().getWithResponse("rg1", "cluster1", "app", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetApplicationCreated.json + */ + /** + * Sample code: Get application on HDInsight cluster successfully created. + * + * @param manager Entry point to HDInsightManager. + */ + public static void getApplicationOnHDInsightClusterSuccessfullyCreated( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.applications().getWithResponse("rg1", "cluster1", "app", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_UpdateGatewaySettings + +```java +/** + * Samples for ScriptActions GetExecutionAsyncOperationStatus. + */ +public final class ScriptActionsGetExecutionAsyncOperationStatusSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetScriptExecutionAsyncOperationStatus.json + */ + /** + * Sample code: Gets the async execution operation status. + * + * @param manager Entry point to HDInsightManager. + */ + public static void + getsTheAsyncExecutionOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptActions() + .getExecutionAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", + com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_UpdateIdentityCertificate + +```java +/** + * Samples for Applications Delete. + */ +public final class ApplicationsDeleteSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DeleteApplication.json + */ + /** + * Sample code: Delete Application from HDInsight cluster. + * + * @param manager Entry point to HDInsightManager. + */ + public static void + deleteApplicationFromHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.applications().delete("rg1", "cluster1", "hue", com.azure.core.util.Context.NONE); + } +} +``` + +### Configurations_Get + +```java +import com.azure.resourcemanager.hdinsight.models.Cluster; +import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; +import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Clusters Update. + */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * PatchLinuxHadoopCluster.json + */ + /** + * Sample code: Patch HDInsight Linux clusters. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithEncryptionInTransit( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("workernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Large")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))), - new Role().withName("zookeepernode") - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Small")) - .withOsProfile(new OsProfile() - .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder")))))) - .withStorageProfile(new StorageProfile() - .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") - .withIsDefault(true) - .withContainer("default8525") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true)))) - .withEncryptionInTransitProperties( - new EncryptionInTransitProperties().withIsEncryptionInTransitEnabled(true))) - .create(); + public static void patchHDInsightLinuxClusters(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * CreateHDInsightClusterWithComputeIsolationProperties.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * PatchLinuxHadoopClusterWithSystemMSI.json */ /** - * Sample code: Create cluster with compute isolation properties. + * Sample code: Patch HDInsight Linux clusters with system assigned MSI. * * @param manager Entry point to HDInsightManager. */ - public static void createClusterWithComputeIsolationProperties( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.clusters() - .define("cluster1") - .withExistingResourceGroup("rg1") - .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") - .withOsType(OSType.LINUX) - .withClusterDefinition(new ClusterDefinition().withKind("hadoop") - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile( - new ComputeProfile() - .withRoles( - Arrays - .asList( - new Role().withName("headnode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys(Arrays - .asList(new SshPublicKey().withCertificateData("**********")))))), - new Role().withName("workernode") - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder") - .withSshProfile(new SshProfile().withPublicKeys(Arrays - .asList(new SshPublicKey().withCertificateData("**********"))))))))) - .withStorageProfile( - new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") - .withIsDefault(true) - .withContainer("containername") - .withKey("fakeTokenPlaceholder") - .withEnableSecureChannel(true)))) - .withComputeIsolationProperties(new ComputeIsolationProperties().withEnableComputeIsolation(true))) - .create(); + public static void + patchHDInsightLinuxClustersWithSystemAssignedMSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); } // Use "Map.of" if available @@ -1069,743 +743,1326 @@ public final class ClustersCreateSamples { } ``` -### Clusters_Delete +### Configurations_List ```java /** - * Samples for Clusters Delete. + * Samples for Configurations Get. */ -public final class ClustersDeleteSamples { +public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DeleteLinuxHadoopCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Configurations_Get.json */ /** - * Sample code: Delete Hadoop on Linux cluster. + * Sample code: Get Core site settings. * * @param manager Entry point to HDInsightManager. */ - public static void deleteHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().delete("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void getCoreSiteSettings(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.configurations().getWithResponse("rg1", "cluster1", "core-site", com.azure.core.util.Context.NONE); } } ``` -### Clusters_ExecuteScriptActions +### Configurations_Update ```java -import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; -import java.util.Arrays; +import com.azure.resourcemanager.hdinsight.models.Extension; /** - * Samples for Clusters ExecuteScriptActions. + * Samples for Extensions Create. */ -public final class ClustersExecuteScriptActionsSamples { +public final class ExtensionsCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * PostExecuteScriptAction.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateExtension. + * json */ /** - * Sample code: Execute script action on HDInsight cluster. + * Sample code: Create a monitoring extension on Hadoop Linux cluster. * * @param manager Entry point to HDInsightManager. */ public static void - executeScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters() - .executeScriptActions("rg1", "cluster1", - new ExecuteScriptActionParameters() - .withScriptActions(Arrays.asList(new RuntimeScriptAction().withName("Test") - .withUri("http://testurl.com/install.ssh") - .withParameters("") - .withRoles(Arrays.asList("headnode", "workernode")))) - .withPersistOnSuccess(false), + createAMonitoringExtensionOnHadoopLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions() + .create("rg1", "cluster1", "clustermonitoring", + new Extension().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") + .withPrimaryKey("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` -### Clusters_GetAzureAsyncOperationStatus +### Extensions_Create ```java /** - * Samples for Clusters GetAzureAsyncOperationStatus. + * Samples for Extensions Get. */ -public final class ClustersGetAzureAsyncOperationStatusSamples { +public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetClusterCreatingAsyncOperationStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetExtension. + * json */ /** - * Sample code: Get Async Operation Status of Creating Cluster. + * Sample code: Get an extension. + * + * @param manager Entry point to HDInsightManager. + */ + public static void getAnExtension(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().getWithResponse("rg1", "cluster1", "clustermonitoring", com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_Delete + +```java +import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; +import com.azure.resourcemanager.hdinsight.models.RoleName; + +/** + * Samples for Clusters Resize. + */ +public final class ClustersResizeSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * ResizeLinuxHadoopCluster.json + */ + /** + * Sample code: Resize the worker nodes for a Hadoop on Linux cluster. * * @param manager Entry point to HDInsightManager. */ public static void - getAsyncOperationStatusOfCreatingCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + resizeTheWorkerNodesForAHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { manager.clusters() - .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", + .resize("rg1", "cluster1", RoleName.WORKERNODE, new ClusterResizeParameters().withTargetInstanceCount(10), com.azure.core.util.Context.NONE); } } ``` -### Clusters_GetByResourceGroup +### Extensions_DisableAzureMonitor ```java /** - * Samples for Clusters GetByResourceGroup. + * Samples for Extensions Delete. */ -public final class ClustersGetByResourceGroupSamples { +public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxHadoopCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteExtension. + * json */ /** - * Sample code: Get Hadoop on Linux cluster. + * Sample code: Delete an extension. * * @param manager Entry point to HDInsightManager. */ - public static void getHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void deleteAnExtension(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().delete("rg1", "cluster1", "clustermonitoring", com.azure.core.util.Context.NONE); } +} +``` + +### Extensions_DisableAzureMonitorAgent +```java +/** + * Samples for Clusters GetAzureAsyncOperationStatus. + */ +public final class ClustersGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxSparkCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetClusterCreatingAsyncOperationStatus.json */ /** - * Sample code: Get Spark on Linux cluster. + * Sample code: Get Async Operation Status of Creating Cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getSparkOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void + getAsyncOperationStatusOfCreatingCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters() + .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", + com.azure.core.util.Context.NONE); } } ``` -### Clusters_GetGatewaySettings +### Extensions_DisableMonitoring ```java /** - * Samples for Clusters GetGatewaySettings. + * Samples for VirtualMachines GetAsyncOperationStatus. */ -public final class ClustersGetGatewaySettingsSamples { +public final class VirtualMachinesGetAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Clusters_GetGatewaySettings.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetRestartHostsAsyncOperationStatus.json */ /** - * Sample code: Get HTTP settings. + * Sample code: Gets the async operation status of restarting host. * * @param manager Entry point to HDInsightManager. */ - public static void getHTTPSettings(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().getGatewaySettingsWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void + getsTheAsyncOperationStatusOfRestartingHost(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.virtualMachines() + .getAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", + com.azure.core.util.Context.NONE); } } ``` -### Clusters_List +### Extensions_EnableAzureMonitor + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hdinsight.models.Autoscale; +import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; +import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; +import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; +import com.azure.resourcemanager.hdinsight.models.ClientGroupInfo; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; +import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; +import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; +import com.azure.resourcemanager.hdinsight.models.ComputeIsolationProperties; +import com.azure.resourcemanager.hdinsight.models.ComputeProfile; +import com.azure.resourcemanager.hdinsight.models.DataDisksGroups; +import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; +import com.azure.resourcemanager.hdinsight.models.DirectoryType; +import com.azure.resourcemanager.hdinsight.models.DiskEncryptionProperties; +import com.azure.resourcemanager.hdinsight.models.EncryptionInTransitProperties; +import com.azure.resourcemanager.hdinsight.models.HardwareProfile; +import com.azure.resourcemanager.hdinsight.models.IpTag; +import com.azure.resourcemanager.hdinsight.models.KafkaRestProperties; +import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; +import com.azure.resourcemanager.hdinsight.models.NetworkProperties; +import com.azure.resourcemanager.hdinsight.models.OSType; +import com.azure.resourcemanager.hdinsight.models.OsProfile; +import com.azure.resourcemanager.hdinsight.models.PrivateLink; +import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; +import com.azure.resourcemanager.hdinsight.models.ResourceProviderConnection; +import com.azure.resourcemanager.hdinsight.models.Role; +import com.azure.resourcemanager.hdinsight.models.SecurityProfile; +import com.azure.resourcemanager.hdinsight.models.SshProfile; +import com.azure.resourcemanager.hdinsight.models.SshPublicKey; +import com.azure.resourcemanager.hdinsight.models.StorageAccount; +import com.azure.resourcemanager.hdinsight.models.StorageProfile; +import com.azure.resourcemanager.hdinsight.models.Tier; +import com.azure.resourcemanager.hdinsight.models.UserAssignedIdentity; +import com.azure.resourcemanager.hdinsight.models.VirtualNetworkProfile; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; -```java /** - * Samples for Clusters List. + * Samples for Clusters Create. */ -public final class ClustersListSamples { +public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxHadoopAllClusters.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateLinuxHadoopSshPassword.json */ /** - * Sample code: Get All Hadoop on Linux clusters. + * Sample code: Create Hadoop on Linux cluster with SSH password. * * @param manager Entry point to HDInsightManager. */ - public static void getAllHadoopOnLinuxClusters(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().list(com.azure.core.util.Context.NONE); + public static void createHadoopOnLinuxClusterWithSSHPassword( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":\"true\",\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Clusters_ListByResourceGroup -```java -/** - * Samples for Clusters ListByResourceGroup. - */ -public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxHadoopAllClustersInResourceGroup.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithADLSGen2Msi.json */ /** - * Sample code: Get All Hadoop on Linux clusters in a resource group. + * Sample code: Create cluster with storage ADLSGen2 + MSI. * * @param manager Entry point to HDInsightManager. */ - public static void - getAllHadoopOnLinuxClustersInAResourceGroup(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.clusters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + public static void createClusterWithStorageADLSGen2MSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList(new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser").withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() + .withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withFileSystem("default") + .withResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage") + .withMsiResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"))))) + .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi", + new UserAssignedIdentity()))) + .create(); } -} -``` -### Clusters_Resize - -```java -import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; -import com.azure.resourcemanager.hdinsight.models.RoleName; - -/** - * Samples for Clusters Resize. - */ -public final class ClustersResizeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * ResizeLinuxHadoopCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateKafkaClusterWithKafkaRestProxy.json */ /** - * Sample code: Resize the worker nodes for a Hadoop on Linux cluster. + * Sample code: Create Kafka cluster with Kafka Rest Proxy. * * @param manager Entry point to HDInsightManager. */ - public static void - resizeTheWorkerNodesForAHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createKafkaClusterWithKafkaRestProxy( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { manager.clusters() - .resize("rg1", "cluster1", RoleName.WORKERNODE, new ClusterResizeParameters().withTargetInstanceCount(10), - com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("4.0") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("kafka") + .withComponentVersion(mapOf("Kafka", "2.1")) + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withKafkaRestProperties(new KafkaRestProperties() + .withClientGroupInfo(new ClientGroupInfo().withGroupName("Kafka security group name") + .withGroupId("00000000-0000-0000-0000-111111111111"))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withDataDisksGroups(Arrays.asList(new DataDisksGroups().withDisksPerNode(8))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("kafkamanagementnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_v2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("kafkauser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Clusters_RotateDiskEncryptionKey - -```java -import com.azure.resourcemanager.hdinsight.models.ClusterDiskEncryptionParameters; -/** - * Samples for Clusters RotateDiskEncryptionKey. - */ -public final class ClustersRotateDiskEncryptionKeySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * RotateLinuxHadoopClusterDiskEncryptionKey.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithAutoscaleConfig.json */ /** - * Sample code: Rotate disk encryption key of the specified HDInsight cluster. + * Sample code: Create HDInsight cluster with Autoscale configuration. * * @param manager Entry point to HDInsightManager. */ - public static void rotateDiskEncryptionKeyOfTheSpecifiedHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createHDInsightClusterWithAutoscaleConfiguration( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { manager.clusters() - .rotateDiskEncryptionKey("rg1", "cluster1", - new ClusterDiskEncryptionParameters().withVaultUri("https://newkeyvault.vault.azure.net/") - .withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("hadoop") + .withComponentVersion(mapOf("Hadoop", "2.7")) + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile( + new ComputeProfile() + .withRoles(Arrays.asList(new Role().withName("workernode") + .withTargetInstanceCount(4) + .withAutoscaleConfiguration(new Autoscale().withRecurrence(new AutoscaleRecurrence() + .withTimeZone("China Standard Time") + .withSchedule(Arrays.asList( + new AutoscaleSchedule() + .withDays(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.TUESDAY, + DaysOfWeek.WEDNESDAY, DaysOfWeek.THURSDAY, DaysOfWeek.FRIDAY)) + .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("09:00") + .withMinInstanceCount(3) + .withMaxInstanceCount(3)), + new AutoscaleSchedule() + .withDays(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.TUESDAY, + DaysOfWeek.WEDNESDAY, DaysOfWeek.THURSDAY, DaysOfWeek.FRIDAY)) + .withTimeAndCapacity( + new AutoscaleTimeAndCapacity().withTime("18:00") + .withMinInstanceCount(6) + .withMaxInstanceCount(6)), + new AutoscaleSchedule() + .withDays(Arrays.asList(DaysOfWeek.SATURDAY, DaysOfWeek.SUNDAY)) + .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("09:00") + .withMinInstanceCount(2) + .withMaxInstanceCount(2)), + new AutoscaleSchedule() + .withDays(Arrays.asList(DaysOfWeek.SATURDAY, DaysOfWeek.SUNDAY)) + .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("18:00") + .withMinInstanceCount(4) + .withMaxInstanceCount(4)))))) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_V2")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("hdinsight-autoscale-tes-2019-06-18t05-49-16-591z") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Clusters_Update - -```java -import com.azure.resourcemanager.hdinsight.models.Cluster; -import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; -import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; -import java.util.HashMap; -import java.util.Map; -/** - * Samples for Clusters Update. - */ -public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * PatchLinuxHadoopCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateLinuxHadoopSshPublicKey.json */ /** - * Sample code: Patch HDInsight Linux clusters. + * Sample code: Create Hadoop on Linux cluster with SSH public key. * * @param manager Entry point to HDInsightManager. */ - public static void patchHDInsightLinuxClusters(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - Cluster resource = manager.clusters() - .getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + public static void createHadoopOnLinuxClusterWithSSHPublicKey( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile( + new ComputeProfile() + .withRoles( + Arrays + .asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withSshProfile(new SshProfile().withPublicKeys(Arrays + .asList(new SshPublicKey().withCertificateData("**********")))))), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * PatchLinuxHadoopClusterWithSystemMSI.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithAvailabilityZones.json */ /** - * Sample code: Patch HDInsight Linux clusters with system assigned MSI. + * Sample code: Create cluster with availability zones. * * @param manager Entry point to HDInsightManager. */ - public static void - patchHDInsightLinuxClustersWithSystemAssignedMSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - Cluster resource = manager.clusters() - .getByResourceGroupWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void createClusterWithAvailabilityZones(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withZones(Arrays.asList("1")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withClusterDefinition(new ClusterDefinition().withKind("hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"ambari-conf\":{\"database-name\":\"{ambari database name}\",\"database-server\":\"{sql server name}.database.windows.net\",\"database-user-name\":\"**********\",\"database-user-password\":\"**********\"},\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"},\"hive-env\":{\"hive_database\":\"Existing MSSQL Server database with SQL authentication\",\"hive_database_name\":\"{hive metastore name}\",\"hive_database_type\":\"mssql\",\"hive_existing_mssql_server_database\":\"{hive metastore name}\",\"hive_existing_mssql_server_host\":\"{sql server name}.database.windows.net\",\"hive_hostname\":\"{sql server name}.database.windows.net\"},\"hive-site\":{\"javax.jdo.option.ConnectionDriverName\":\"com.microsoft.sqlserver.jdbc.SQLServerDriver\",\"javax.jdo.option.ConnectionPassword\":\"**********!\",\"javax.jdo.option.ConnectionURL\":\"jdbc:sqlserver://{sql server name}.database.windows.net;database={hive metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0\",\"javax.jdo.option.ConnectionUserName\":\"**********\"},\"oozie-env\":{\"oozie_database\":\"Existing MSSQL Server database with SQL authentication\",\"oozie_database_name\":\"{oozie metastore name}\",\"oozie_database_type\":\"mssql\",\"oozie_existing_mssql_server_database\":\"{oozie metastore name}\",\"oozie_existing_mssql_server_host\":\"{sql server name}.database.windows.net\",\"oozie_hostname\":\"{sql server name}.database.windows.net\"},\"oozie-site\":{\"oozie.db.schema.name\":\"oozie\",\"oozie.service.JPAService.jdbc.driver\":\"com.microsoft.sqlserver.jdbc.SQLServerDriver\",\"oozie.service.JPAService.jdbc.password\":\"**********\",\"oozie.service.JPAService.jdbc.url\":\"jdbc:sqlserver://{sql server name}.database.windows.net;database={oozie metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0\",\"oozie.service.JPAService.jdbc.username\":\"**********\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")), + new Role().withName("workernode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"))))) + .withStorageProfile( + new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Clusters_UpdateAutoScaleConfiguration - -```java -import com.azure.resourcemanager.hdinsight.models.Autoscale; -import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; -import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import com.azure.resourcemanager.hdinsight.models.RoleName; -import java.util.Arrays; -/** - * Samples for Clusters UpdateAutoScaleConfiguration. - */ -public final class ClustersUpdateAutoScaleConfigurationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * EnableOrUpdateAutoScaleWithLoadBasedConfiguration.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithEntraUser.json */ /** - * Sample code: Enable or Update Autoscale with the load based configuration for HDInsight cluster. + * Sample code: Create cluster with Entra User. * * @param manager Entry point to HDInsightManager. */ - public static void enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createClusterWithEntraUser(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { manager.clusters() - .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, - new AutoscaleConfigurationUpdateParameter().withAutoscale(new Autoscale() - .withCapacity(new AutoscaleCapacity().withMinInstanceCount(3).withMaxInstanceCount(5))), - com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":false,\"restAuthEntraUsers\":[{\"displayName\":\"displayName\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"upn\":\"user@microsoft.com\"}]}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DisableClusterAutoScale.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateLinuxHadoopAdlsGen2.json */ /** - * Sample code: Disable Autoscale for the HDInsight cluster. + * Sample code: Create Hadoop cluster with Azure Data Lake Storage Gen 2. * * @param manager Entry point to HDInsightManager. */ - public static void - disableAutoscaleForTheHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createHadoopClusterWithAzureDataLakeStorageGen2( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { manager.clusters() - .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, - new AutoscaleConfigurationUpdateParameter(), com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":\"true\",\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.dfs.core.windows.net") + .withIsDefault(true) + .withFileSystem("default") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * EnableOrUpdateAutoScaleWithScheduleBasedConfiguration.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateLinuxHadoopSecureHadoop.json */ /** - * Sample code: Enable or Update Autoscale with the schedule based configuration for HDInsight cluster. + * Sample code: Create Secure Hadoop cluster. * * @param manager Entry point to HDInsightManager. */ - public static void enableOrUpdateAutoscaleWithTheScheduleBasedConfigurationForHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createSecureHadoopCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { manager.clusters() - .updateAutoScaleConfiguration("rg1", "cluster1", RoleName.WORKERNODE, - new AutoscaleConfigurationUpdateParameter().withAutoscale( - new Autoscale().withRecurrence(new AutoscaleRecurrence().withTimeZone("China Standard Time") - .withSchedule(Arrays.asList(new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.THURSDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("16:00") - .withMinInstanceCount(4) - .withMaxInstanceCount(4)))))), - com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") + .withOsType(OSType.LINUX) + .withTier(Tier.PREMIUM) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withSecurityProfile(new SecurityProfile().withDirectoryType(DirectoryType.ACTIVE_DIRECTORY) + .withDomain("DomainName") + .withOrganizationalUnitDN("OU=Hadoop,DC=hdinsight,DC=test") + .withLdapsUrls(Arrays.asList("ldaps://10.10.0.4:636")) + .withDomainUsername("DomainUsername") + .withDomainUserPassword("fakeTokenPlaceholder") + .withClusterUsersGroupDNs(Arrays.asList("hdiusers"))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D3_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Clusters_UpdateGatewaySettings - -```java -import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; -/** - * Samples for Clusters UpdateGatewaySettings. - */ -public final class ClustersUpdateGatewaySettingsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Clusters_UpdateGatewaySettings_Enable.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithWasbMsi.json */ /** - * Sample code: Enable HTTP connectivity. + * Sample code: Create cluster with storage WASB + MSI. * * @param manager Entry point to HDInsightManager. */ - public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createClusterWithStorageWASBMSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { manager.clusters() - .updateGatewaySettings("rg1", "cluster1", new UpdateGatewaySettingsParameters(), - com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList(new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser").withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() + .withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage") + .withMsiResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"))))) + .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi", + new UserAssignedIdentity()))) + .create(); } -} -``` - -### Clusters_UpdateIdentityCertificate - -```java -import com.azure.resourcemanager.hdinsight.models.UpdateClusterIdentityCertificateParameters; -/** - * Samples for Clusters UpdateIdentityCertificate. - */ -public final class ClustersUpdateIdentityCertificateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Clusters_UpdateClusterIdentityCertificate.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateLinuxSparkSshPassword.json */ /** - * Sample code: Update cluster identity certificate. + * Sample code: Create Spark on Linux Cluster with SSH password. * * @param manager Entry point to HDInsightManager. */ - public static void updateClusterIdentityCertificate(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + public static void createSparkOnLinuxClusterWithSSHPassword( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { manager.clusters() - .updateIdentityCertificate("rg1", "cluster1", - new UpdateClusterIdentityCertificateParameters().withApplicationId("applicationId") - .withCertificate("base64encodedcertificate") - .withCertificatePassword("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_Get - -```java -/** - * Samples for Configurations Get. - */ -public final class ConfigurationsGetSamples { - /* - * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Configurations_Get.json - */ - /** - * Sample code: Get Core site settings. - * - * @param manager Entry point to HDInsightManager. - */ - public static void getCoreSiteSettings(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.configurations().getWithResponse("rg1", "cluster1", "core-site", com.azure.core.util.Context.NONE); + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("3.5") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Spark") + .withComponentVersion(mapOf("Spark", "2.0")) + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D12_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D4_V2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); } -} -``` - -### Configurations_List -```java -/** - * Samples for Configurations List. - */ -public final class ConfigurationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Configurations_List.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithCustomNetworkProperties.json */ /** - * Sample code: Get all configuration information. + * Sample code: Create cluster with network properties. * * @param manager Entry point to HDInsightManager. */ - public static void getAllConfigurationInformation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.configurations().listWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void createClusterWithNetworkProperties(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withClusterDefinition(new ClusterDefinition().withKind("hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")), + new Role().withName("workernode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys( + Arrays.asList(new SshPublicKey().withCertificateData("**********")))))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"))))) + .withStorageProfile( + new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true)))) + .withNetworkProperties( + new NetworkProperties().withResourceProviderConnection(ResourceProviderConnection.OUTBOUND) + .withPrivateLink(PrivateLink.ENABLED) + .withPublicIpTag(new IpTag().withIpTagType("FirstPartyUsage").withTag("/")))) + .create(); } -} -``` - -### Configurations_Update - -```java -import java.util.HashMap; -import java.util.Map; -/** - * Samples for Configurations Update. - */ -public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * ChangeHttpConnectivityEnable.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithTLS12.json */ /** - * Sample code: Enable HTTP connectivity. + * Sample code: Create cluster with TLS 1.2. * * @param manager Entry point to HDInsightManager. */ - public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.configurations() - .update("rg1", "cluster1", "gateway", - mapOf("restAuthCredential.isEnabled", "fakeTokenPlaceholder", "restAuthCredential.password", - "fakeTokenPlaceholder", "restAuthCredential.username", "fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void createClusterWithTLS12(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("default8525") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true)))) + .withMinSupportedTlsVersion("1.2")) + .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * ChangeHttpConnectivityDisable.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithEncryptionAtHost.json */ /** - * Sample code: Disable HTTP connectivity. + * Sample code: Create cluster with encryption at host. * * @param manager Entry point to HDInsightManager. */ - public static void disableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.configurations() - .update("rg1", "cluster1", "gateway", mapOf("restAuthCredential.isEnabled", "fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void createClusterWithEncryptionAtHost(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_DS14_v2")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("default8525") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true)))) + .withDiskEncryptionProperties(new DiskEncryptionProperties().withEncryptionAtHost(true))) + .create(); } -} -``` - -### Extensions_Create - -```java -import com.azure.resourcemanager.hdinsight.models.Extension; -/** - * Samples for Extensions Create. - */ -public final class ExtensionsCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/CreateExtension. - * json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithEncryptionInTransit.json */ /** - * Sample code: Create a monitoring extension on Hadoop Linux cluster. + * Sample code: Create cluster with encryption in transit. * * @param manager Entry point to HDInsightManager. */ - public static void - createAMonitoringExtensionOnHadoopLinuxCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions() - .create("rg1", "cluster1", "clustermonitoring", - new Extension().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") - .withPrimaryKey("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void createClusterWithEncryptionInTransit( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Large")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Small")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("default8525") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true)))) + .withEncryptionInTransitProperties( + new EncryptionInTransitProperties().withIsEncryptionInTransitEnabled(true))) + .create(); } -} -``` - -### Extensions_Delete -```java -/** - * Samples for Extensions Delete. - */ -public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/DeleteExtension. - * json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithComputeIsolationProperties.json */ /** - * Sample code: Delete an extension. + * Sample code: Create cluster with compute isolation properties. * * @param manager Entry point to HDInsightManager. */ - public static void deleteAnExtension(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().delete("rg1", "cluster1", "clustermonitoring", com.azure.core.util.Context.NONE); + public static void createClusterWithComputeIsolationProperties( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("3.6") + .withOsType(OSType.LINUX) + .withClusterDefinition(new ClusterDefinition().withKind("hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile( + new ComputeProfile() + .withRoles( + Arrays + .asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys(Arrays + .asList(new SshPublicKey().withCertificateData("**********")))))), + new Role().withName("workernode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("standard_d3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder") + .withSshProfile(new SshProfile().withPublicKeys(Arrays + .asList(new SshPublicKey().withCertificateData("**********"))))))))) + .withStorageProfile( + new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true)))) + .withComputeIsolationProperties(new ComputeIsolationProperties().withEnableComputeIsolation(true))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Extensions_DisableAzureMonitor +### Extensions_EnableAzureMonitorAgent ```java /** - * Samples for Extensions DisableAzureMonitor. + * Samples for Extensions DisableAzureMonitorAgent. */ -public final class ExtensionsDisableAzureMonitorSamples { +public final class ExtensionsDisableAzureMonitorAgentSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DisableLinuxClusterAzureMonitor.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DisableLinuxClusterAzureMonitorAgent.json */ /** - * Sample code: Disable azure monitor. + * Sample code: Disable azure monitor agent. * * @param manager Entry point to HDInsightManager. */ - public static void disableAzureMonitor(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().disableAzureMonitor("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void disableAzureMonitorAgent(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().disableAzureMonitorAgent("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Extensions_DisableAzureMonitorAgent +### Extensions_EnableMonitoring ```java /** - * Samples for Extensions DisableAzureMonitorAgent. + * Samples for Clusters List. */ -public final class ExtensionsDisableAzureMonitorAgentSamples { +public final class ClustersListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DisableLinuxClusterAzureMonitorAgent.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxHadoopAllClusters.json */ /** - * Sample code: Disable azure monitor agent. + * Sample code: Get All Hadoop on Linux clusters. * * @param manager Entry point to HDInsightManager. */ - public static void disableAzureMonitorAgent(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().disableAzureMonitorAgent("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void getAllHadoopOnLinuxClusters(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().list(com.azure.core.util.Context.NONE); } } ``` -### Extensions_DisableMonitoring +### Extensions_Get ```java /** - * Samples for Extensions DisableMonitoring. + * Samples for ScriptActions GetExecutionDetail. */ -public final class ExtensionsDisableMonitoringSamples { +public final class ScriptActionsGetExecutionDetailSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DisableLinuxClusterMonitoring.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetScriptActionById.json */ /** - * Sample code: Disable cluster monitoring. + * Sample code: Get script execution history by script id. * * @param manager Entry point to HDInsightManager. */ - public static void disableClusterMonitoring(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().disableMonitoring("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void + getScriptExecutionHistoryByScriptId(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptActions() + .getExecutionDetailWithResponse("rg1", "cluster1", "391145124054712", com.azure.core.util.Context.NONE); } } ``` -### Extensions_EnableAzureMonitor +### Extensions_GetAzureAsyncOperationStatus ```java -import com.azure.resourcemanager.hdinsight.models.AzureMonitorRequest; - /** - * Samples for Extensions EnableAzureMonitor. + * Samples for ScriptActions ListByCluster. */ -public final class ExtensionsEnableAzureMonitorSamples { +public final class ScriptActionsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * EnableLinuxClusterAzureMonitor.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxHadoopScriptAction.json */ /** - * Sample code: Enable azure monitor. + * Sample code: List all persisted script actions for the given cluster. * * @param manager Entry point to HDInsightManager. */ - public static void enableAzureMonitor(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions() - .enableAzureMonitor("rg1", "cluster1", - new AzureMonitorRequest().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") - .withPrimaryKey("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void + listAllPersistedScriptActionsForTheGivenCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptActions().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Extensions_EnableAzureMonitorAgent +### Extensions_GetAzureMonitorAgentStatus ```java -import com.azure.resourcemanager.hdinsight.models.AzureMonitorRequest; - /** - * Samples for Extensions EnableAzureMonitorAgent. + * Samples for PrivateEndpointConnections ListByCluster. */ -public final class ExtensionsEnableAzureMonitorAgentSamples { +public final class PrivateEndpointConnectionsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * EnableLinuxClusterAzureMonitorAgent.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetAllPrivateEndpointConnectionsInCluster.json */ /** - * Sample code: Enable azure monitoring agent. + * Sample code: Get all private endpoint connections for a specific HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void enableAzureMonitoringAgent(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions() - .enableAzureMonitorAgent("rg1", "cluster1", - new AzureMonitorRequest().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") - .withPrimaryKey("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void getAllPrivateEndpointConnectionsForASpecificHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateEndpointConnections().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Extensions_EnableMonitoring +### Extensions_GetAzureMonitorStatus ```java import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringRequest; @@ -1816,7 +2073,7 @@ import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringRequest; public final class ExtensionsEnableMonitoringSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableLinuxClusterMonitoring.json */ /** @@ -1834,102 +2091,112 @@ public final class ExtensionsEnableMonitoringSamples { } ``` -### Extensions_Get +### Extensions_GetMonitoringStatus ```java /** - * Samples for Extensions Get. + * Samples for PrivateEndpointConnections Delete. */ -public final class ExtensionsGetSamples { +public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/GetExtension. - * json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DeletePrivateEndpointConnection.json */ /** - * Sample code: Get an extension. + * Sample code: Delete specific private endpoint connection for a specific HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getAnExtension(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().getWithResponse("rg1", "cluster1", "clustermonitoring", com.azure.core.util.Context.NONE); + public static void deleteSpecificPrivateEndpointConnectionForASpecificHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateEndpointConnections() + .delete("rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", + com.azure.core.util.Context.NONE); } } ``` -### Extensions_GetAzureAsyncOperationStatus +### Locations_CheckNameAvailability ```java +import java.util.Arrays; + /** - * Samples for Extensions GetAzureAsyncOperationStatus. + * Samples for VirtualMachines RestartHosts. */ -public final class ExtensionsGetAzureAsyncOperationStatusSamples { +public final class VirtualMachinesRestartHostsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetExtensionCreationAsyncOperationStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * RestartVirtualMachinesOperation.json */ /** - * Sample code: Gets the azure async operation status. + * Sample code: Restarts the specified HDInsight cluster hosts. * * @param manager Entry point to HDInsightManager. */ - public static void getsTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions() - .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "azuremonitor", - "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", com.azure.core.util.Context.NONE); + public static void + restartsTheSpecifiedHDInsightClusterHosts(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.virtualMachines() + .restartHosts("rg1", "cluster1", Arrays.asList("gateway1", "gateway3"), com.azure.core.util.Context.NONE); } } ``` -### Extensions_GetAzureMonitorAgentStatus +### Locations_GetAzureAsyncOperationStatus ```java /** - * Samples for Extensions GetAzureMonitorAgentStatus. + * Samples for Extensions DisableAzureMonitor. */ -public final class ExtensionsGetAzureMonitorAgentStatusSamples { +public final class ExtensionsDisableAzureMonitorSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxClusterAzureMonitorAgentStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DisableLinuxClusterAzureMonitor.json */ /** - * Sample code: Get azure monitor agent status. + * Sample code: Disable azure monitor. * * @param manager Entry point to HDInsightManager. */ - public static void getAzureMonitorAgentStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions() - .getAzureMonitorAgentStatusWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void disableAzureMonitor(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().disableAzureMonitor("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Extensions_GetAzureMonitorStatus +### Locations_GetCapabilities ```java +import com.azure.resourcemanager.hdinsight.models.AzureMonitorRequest; + /** - * Samples for Extensions GetAzureMonitorStatus. + * Samples for Extensions EnableAzureMonitorAgent. */ -public final class ExtensionsGetAzureMonitorStatusSamples { +public final class ExtensionsEnableAzureMonitorAgentSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxClusterAzureMonitorStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * EnableLinuxClusterAzureMonitorAgent.json */ /** - * Sample code: Get azure monitor status. + * Sample code: Enable azure monitoring agent. * * @param manager Entry point to HDInsightManager. */ - public static void getAzureMonitorStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.extensions().getAzureMonitorStatusWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void enableAzureMonitoringAgent(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions() + .enableAzureMonitorAgent("rg1", "cluster1", + new AzureMonitorRequest().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") + .withPrimaryKey("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); } } ``` -### Extensions_GetMonitoringStatus +### Locations_ListBillingSpecs ```java /** @@ -1938,7 +2205,7 @@ public final class ExtensionsGetAzureMonitorStatusSamples { public final class ExtensionsGetMonitoringStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxClusterMonitoringStatus.json */ /** @@ -1952,437 +2219,297 @@ public final class ExtensionsGetMonitoringStatusSamples { } ``` -### Locations_CheckNameAvailability - -```java -import com.azure.resourcemanager.hdinsight.models.NameAvailabilityCheckRequestParameters; - -/** - * Samples for Locations CheckNameAvailability. - */ -public final class LocationsCheckNameAvailabilitySamples { - /* - * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Locations_CheckClusterNameAvailability.json - */ - /** - * Sample code: Get the subscription usages for specific location. - * - * @param manager Entry point to HDInsightManager. - */ - public static void - getTheSubscriptionUsagesForSpecificLocation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.locations() - .checkNameAvailabilityWithResponse("westus", - new NameAvailabilityCheckRequestParameters().withName("test123").withType("clusters"), - com.azure.core.util.Context.NONE); - } -} -``` - -### Locations_GetAzureAsyncOperationStatus - -```java -/** - * Samples for Locations GetAzureAsyncOperationStatus. - */ -public final class LocationsGetAzureAsyncOperationStatusSamples { - /* - * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Locations_GetAsyncOperationStatus.json - */ - /** - * Sample code: Gets the azure async operation status. - * - * @param manager Entry point to HDInsightManager. - */ - public static void getsTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.locations() - .getAzureAsyncOperationStatusWithResponse("East US 2", "8a0348f4-8a85-4ec2-abe0-03b26104a9a0-0", - com.azure.core.util.Context.NONE); - } -} -``` - -### Locations_GetCapabilities - -```java -/** - * Samples for Locations GetCapabilities. - */ -public final class LocationsGetCapabilitiesSamples { - /* - * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetHDInsightCapabilities.json - */ - /** - * Sample code: Get the subscription capabilities for specific location. - * - * @param manager Entry point to HDInsightManager. - */ - public static void getTheSubscriptionCapabilitiesForSpecificLocation( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.locations().getCapabilitiesWithResponse("West US", com.azure.core.util.Context.NONE); - } -} -``` - -### Locations_ListBillingSpecs +### Locations_ListUsages ```java /** - * Samples for Locations ListBillingSpecs. + * Samples for Locations GetAzureAsyncOperationStatus. */ -public final class LocationsListBillingSpecsSamples { +public final class LocationsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Locations_ListBillingSpecs.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Locations_GetAsyncOperationStatus.json */ /** - * Sample code: Get the subscription billingSpecs for the specified location. + * Sample code: Gets the azure async operation status. * * @param manager Entry point to HDInsightManager. */ - public static void getTheSubscriptionBillingSpecsForTheSpecifiedLocation( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.locations().listBillingSpecsWithResponse("East US 2", com.azure.core.util.Context.NONE); + public static void getsTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.locations() + .getAzureAsyncOperationStatusWithResponse("East US 2", "8a0348f4-8a85-4ec2-abe0-03b26104a9a0-0", + com.azure.core.util.Context.NONE); } } ``` -### Locations_ListUsages +### Locations_ValidateClusterCreateRequest ```java /** - * Samples for Locations ListUsages. + * Samples for PrivateEndpointConnections Get. */ -public final class LocationsListUsagesSamples { +public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetHDInsightUsages.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetPrivateEndpointConnection.json */ /** - * Sample code: Get the subscription usages for specific location. + * Sample code: Get specific private endpoint connection for a specific HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void - getTheSubscriptionUsagesForSpecificLocation(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.locations().listUsagesWithResponse("West US", com.azure.core.util.Context.NONE); + public static void getSpecificPrivateEndpointConnectionForASpecificHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", + com.azure.core.util.Context.NONE); } } ``` -### Locations_ValidateClusterCreateRequest +### Operations_List ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; -import com.azure.resourcemanager.hdinsight.models.ClusterCreateRequestValidationParameters; -import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; -import com.azure.resourcemanager.hdinsight.models.ComputeProfile; -import com.azure.resourcemanager.hdinsight.models.HardwareProfile; -import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; -import com.azure.resourcemanager.hdinsight.models.OsProfile; -import com.azure.resourcemanager.hdinsight.models.OSType; -import com.azure.resourcemanager.hdinsight.models.Role; -import com.azure.resourcemanager.hdinsight.models.StorageAccount; -import com.azure.resourcemanager.hdinsight.models.StorageProfile; -import com.azure.resourcemanager.hdinsight.models.Tier; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.hdinsight.models.UpdateClusterIdentityCertificateParameters; /** - * Samples for Locations ValidateClusterCreateRequest. + * Samples for Clusters UpdateIdentityCertificate. */ -public final class LocationsValidateClusterCreateRequestSamples { +public final class ClustersUpdateIdentityCertificateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * HDI_Locations_ValidateClusterCreateRequest.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Clusters_UpdateClusterIdentityCertificate.json */ /** - * Sample code: Get the subscription usages for specific location. + * Sample code: Update cluster identity certificate. * * @param manager Entry point to HDInsightManager. */ - public static void getTheSubscriptionUsagesForSpecificLocation( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { - manager.locations() - .validateClusterCreateRequestWithResponse("southcentralus", new ClusterCreateRequestValidationParameters() - .withLocation("southcentralus") - .withTags(mapOf()) - .withProperties(new ClusterCreateProperties().withClusterVersion("4.0") - .withOsType(OSType.LINUX) - .withTier(Tier.STANDARD) - .withClusterDefinition(new ClusterDefinition().withKind("spark") - .withComponentVersion(mapOf("Spark", "2.4")) - .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", - Object.class, SerializerEncoding.JSON))) - .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( - new Role().withName("headnode") - .withMinInstanceCount(1) - .withTargetInstanceCount(2) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))) - .withScriptActions(Arrays.asList()), - new Role().withName("workernode") - .withTargetInstanceCount(4) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))) - .withScriptActions(Arrays.asList()), - new Role().withName("zookeepernode") - .withMinInstanceCount(1) - .withTargetInstanceCount(3) - .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D13_V2")) - .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( - new LinuxOperatingSystemProfile().withUsername("sshuser") - .withPassword("fakeTokenPlaceholder"))) - .withScriptActions(Arrays.asList())))) - .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() - .withName("storagename.blob.core.windows.net") - .withIsDefault(true) - .withContainer("contianername") - .withKey("fakeTokenPlaceholder") - .withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storagename") - .withEnableSecureChannel(true)))) - .withMinSupportedTlsVersion("1.2")) - .withName("testclustername") - .withType("Microsoft.HDInsight/clusters") - .withTenantId("00000000-0000-0000-0000-000000000000") - .withFetchAaddsResource(false), com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void updateClusterIdentityCertificate(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters() + .updateIdentityCertificate("rg1", "cluster1", + new UpdateClusterIdentityCertificateParameters().withApplicationId("applicationId") + .withCertificate("base64encodedcertificate") + .withCertificatePassword("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### PrivateEndpointConnections_CreateOrUpdate ```java /** - * Samples for Operations List. + * Samples for Extensions DisableMonitoring. */ -public final class OperationsListSamples { +public final class ExtensionsDisableMonitoringSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * ListHDInsightOperations.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * DisableLinuxClusterMonitoring.json */ /** - * Sample code: Lists all of the available operations. + * Sample code: Disable cluster monitoring. * * @param manager Entry point to HDInsightManager. */ - public static void listsAllOfTheAvailableOperations(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void disableClusterMonitoring(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().disableMonitoring("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_CreateOrUpdate +### PrivateEndpointConnections_Delete ```java -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; - /** - * Samples for PrivateEndpointConnections CreateOrUpdate. + * Samples for Operations List. */ -public final class PrivateEndpointConnectionsCreateOrUpdateSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * ApprovePrivateEndpointConnection.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * ListHDInsightOperations.json */ /** - * Sample code: Approve a private endpoint connection manually. + * Sample code: Lists all of the available operations. * * @param manager Entry point to HDInsightManager. */ - public static void - approveAPrivateEndpointConnectionManually(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateEndpointConnections() - .define("testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2") - .withExistingCluster("rg1", "cluster1") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("update it from pending to approved.") - .withActionsRequired("None")) - .create(); + public static void listsAllOfTheAvailableOperations(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Delete +### PrivateEndpointConnections_Get ```java +import com.azure.resourcemanager.hdinsight.models.AzureMonitorRequest; + /** - * Samples for PrivateEndpointConnections Delete. + * Samples for Extensions EnableAzureMonitor. */ -public final class PrivateEndpointConnectionsDeleteSamples { +public final class ExtensionsEnableAzureMonitorSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DeletePrivateEndpointConnection.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * EnableLinuxClusterAzureMonitor.json */ /** - * Sample code: Delete specific private endpoint connection for a specific HDInsight cluster. + * Sample code: Enable azure monitor. * * @param manager Entry point to HDInsightManager. */ - public static void deleteSpecificPrivateEndpointConnectionForASpecificHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateEndpointConnections() - .delete("rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", + public static void enableAzureMonitor(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions() + .enableAzureMonitor("rg1", "cluster1", + new AzureMonitorRequest().withWorkspaceId("a2090ead-8c9f-4fba-b70e-533e3e003163") + .withPrimaryKey("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Get +### PrivateEndpointConnections_ListByCluster ```java /** - * Samples for PrivateEndpointConnections Get. + * Samples for Applications GetAzureAsyncOperationStatus. */ -public final class PrivateEndpointConnectionsGetSamples { +public final class ApplicationsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetPrivateEndpointConnection.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetApplicationCreationAsyncOperationStatus.json */ /** - * Sample code: Get specific private endpoint connection for a specific HDInsight cluster. + * Sample code: Get the azure async operation status. * * @param manager Entry point to HDInsightManager. */ - public static void getSpecificPrivateEndpointConnectionForASpecificHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateEndpointConnections() - .getWithResponse("rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", + public static void getTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.applications() + .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "app", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_ListByCluster +### PrivateLinkResources_Get ```java /** - * Samples for PrivateEndpointConnections ListByCluster. + * Samples for ScriptExecutionHistory Promote. */ -public final class PrivateEndpointConnectionsListByClusterSamples { +public final class ScriptExecutionHistoryPromoteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetAllPrivateEndpointConnectionsInCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * PromoteLinuxHadoopScriptAction.json */ /** - * Sample code: Get all private endpoint connections for a specific HDInsight cluster. + * Sample code: Promote a script action on HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getAllPrivateEndpointConnectionsForASpecificHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateEndpointConnections().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void + promoteAScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.scriptExecutionHistories() + .promoteWithResponse("rg1", "cluster1", "391145124054712", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResources_Get +### PrivateLinkResources_ListByCluster ```java +import com.azure.resourcemanager.hdinsight.models.ClusterDiskEncryptionParameters; + /** - * Samples for PrivateLinkResources Get. + * Samples for Clusters RotateDiskEncryptionKey. */ -public final class PrivateLinkResourcesGetSamples { +public final class ClustersRotateDiskEncryptionKeySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetPrivateLinkResource.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * RotateLinuxHadoopClusterDiskEncryptionKey.json */ /** - * Sample code: Get specific private link resource in a specific HDInsight cluster. + * Sample code: Rotate disk encryption key of the specified HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getSpecificPrivateLinkResourceInASpecificHDInsightCluster( + public static void rotateDiskEncryptionKeyOfTheSpecifiedHDInsightCluster( com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateLinkResources().getWithResponse("rg1", "cluster1", "gateway", com.azure.core.util.Context.NONE); + manager.clusters() + .rotateDiskEncryptionKey("rg1", "cluster1", + new ClusterDiskEncryptionParameters().withVaultUri("https://newkeyvault.vault.azure.net/") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResources_ListByCluster +### ScriptActions_Delete ```java +import java.util.HashMap; +import java.util.Map; + /** - * Samples for PrivateLinkResources ListByCluster. + * Samples for Configurations Update. */ -public final class PrivateLinkResourcesListByClusterSamples { +public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetAllPrivateLinkResourcesInCluster.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * ChangeHttpConnectivityEnable.json */ /** - * Sample code: Get all private link resources in a specific HDInsight cluster. + * Sample code: Enable HTTP connectivity. * * @param manager Entry point to HDInsightManager. */ - public static void getAllPrivateLinkResourcesInASpecificHDInsightCluster( - com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.privateLinkResources().listByClusterWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.configurations() + .update("rg1", "cluster1", "gateway", + mapOf("restAuthCredential.isEnabled", "fakeTokenPlaceholder", "restAuthCredential.password", + "fakeTokenPlaceholder", "restAuthCredential.username", "fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); } -} -``` - -### ScriptActions_Delete -```java -/** - * Samples for ScriptActions Delete. - */ -public final class ScriptActionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * DeleteScriptAction.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * ChangeHttpConnectivityDisable.json */ /** - * Sample code: Delete a script action on HDInsight cluster. + * Sample code: Disable HTTP connectivity. * * @param manager Entry point to HDInsightManager. */ - public static void - deleteAScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptActions().deleteWithResponse("rg1", "cluster1", "scriptName", com.azure.core.util.Context.NONE); + public static void disableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.configurations() + .update("rg1", "cluster1", "gateway", mapOf("restAuthCredential.isEnabled", "fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -2391,24 +2518,21 @@ public final class ScriptActionsDeleteSamples { ```java /** - * Samples for ScriptActions GetExecutionAsyncOperationStatus. + * Samples for Extensions GetAzureMonitorStatus. */ -public final class ScriptActionsGetExecutionAsyncOperationStatusSamples { +public final class ExtensionsGetAzureMonitorStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetScriptExecutionAsyncOperationStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxClusterAzureMonitorStatus.json */ /** - * Sample code: Gets the async execution operation status. + * Sample code: Get azure monitor status. * * @param manager Entry point to HDInsightManager. */ - public static void - getsTheAsyncExecutionOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptActions() - .getExecutionAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", - com.azure.core.util.Context.NONE); + public static void getAzureMonitorStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions().getAzureMonitorStatusWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -2417,23 +2541,22 @@ public final class ScriptActionsGetExecutionAsyncOperationStatusSamples { ```java /** - * Samples for ScriptActions GetExecutionDetail. + * Samples for PrivateLinkResources Get. */ -public final class ScriptActionsGetExecutionDetailSamples { +public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetScriptActionById.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetPrivateLinkResource.json */ /** - * Sample code: Get script execution history by script id. + * Sample code: Get specific private link resource in a specific HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void - getScriptExecutionHistoryByScriptId(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptActions() - .getExecutionDetailWithResponse("rg1", "cluster1", "391145124054712", com.azure.core.util.Context.NONE); + public static void getSpecificPrivateLinkResourceInASpecificHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateLinkResources().getWithResponse("rg1", "cluster1", "gateway", com.azure.core.util.Context.NONE); } } ``` @@ -2441,23 +2564,103 @@ public final class ScriptActionsGetExecutionDetailSamples { ### ScriptActions_ListByCluster ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateRequestValidationParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; +import com.azure.resourcemanager.hdinsight.models.ComputeProfile; +import com.azure.resourcemanager.hdinsight.models.HardwareProfile; +import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; +import com.azure.resourcemanager.hdinsight.models.OSType; +import com.azure.resourcemanager.hdinsight.models.OsProfile; +import com.azure.resourcemanager.hdinsight.models.Role; +import com.azure.resourcemanager.hdinsight.models.StorageAccount; +import com.azure.resourcemanager.hdinsight.models.StorageProfile; +import com.azure.resourcemanager.hdinsight.models.Tier; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ScriptActions ListByCluster. + * Samples for Locations ValidateClusterCreateRequest. */ -public final class ScriptActionsListByClusterSamples { +public final class LocationsValidateClusterCreateRequestSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetLinuxHadoopScriptAction.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Locations_ValidateClusterCreateRequest.json */ /** - * Sample code: List all persisted script actions for the given cluster. + * Sample code: Get the subscription usages for specific location. * * @param manager Entry point to HDInsightManager. */ - public static void - listAllPersistedScriptActionsForTheGivenCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptActions().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void getTheSubscriptionUsagesForSpecificLocation( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) throws IOException { + manager.locations() + .validateClusterCreateRequestWithResponse("southcentralus", new ClusterCreateRequestValidationParameters() + .withLocation("southcentralus") + .withTags(mapOf()) + .withProperties(new ClusterCreateProperties().withClusterVersion("4.0") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("spark") + .withComponentVersion(mapOf("Spark", "2.4")) + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withTargetInstanceCount(4) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_D13_V2")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() + .withName("storagename.blob.core.windows.net") + .withIsDefault(true) + .withContainer("contianername") + .withKey("fakeTokenPlaceholder") + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storagename") + .withEnableSecureChannel(true)))) + .withMinSupportedTlsVersion("1.2")) + .withName("testclustername") + .withType("Microsoft.HDInsight/clusters") + .withTenantId("00000000-0000-0000-0000-000000000000") + .withFetchAaddsResource(false), com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -2466,21 +2669,21 @@ public final class ScriptActionsListByClusterSamples { ```java /** - * Samples for ScriptExecutionHistory ListByCluster. + * Samples for VirtualMachines ListHosts. */ -public final class ScriptExecutionHistoryListByClusterSamples { +public final class VirtualMachinesListHostsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetScriptExecutionHistory.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetClusterVirtualMachines.json */ /** - * Sample code: Get Script Execution History List. + * Sample code: Get All hosts in the cluster. * * @param manager Entry point to HDInsightManager. */ - public static void getScriptExecutionHistoryList(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptExecutionHistories().listByCluster("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void getAllHostsInTheCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.virtualMachines().listHostsWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -2489,23 +2692,23 @@ public final class ScriptExecutionHistoryListByClusterSamples { ```java /** - * Samples for ScriptExecutionHistory Promote. + * Samples for Extensions GetAzureAsyncOperationStatus. */ -public final class ScriptExecutionHistoryPromoteSamples { +public final class ExtensionsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * PromoteLinuxHadoopScriptAction.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetExtensionCreationAsyncOperationStatus.json */ /** - * Sample code: Promote a script action on HDInsight cluster. + * Sample code: Gets the azure async operation status. * * @param manager Entry point to HDInsightManager. */ - public static void - promoteAScriptActionOnHDInsightCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.scriptExecutionHistories() - .promoteWithResponse("rg1", "cluster1", "391145124054712", com.azure.core.util.Context.NONE); + public static void getsTheAzureAsyncOperationStatus(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.extensions() + .getAzureAsyncOperationStatusWithResponse("rg1", "cluster1", "azuremonitor", + "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", com.azure.core.util.Context.NONE); } } ``` @@ -2514,24 +2717,22 @@ public final class ScriptExecutionHistoryPromoteSamples { ```java /** - * Samples for VirtualMachines GetAsyncOperationStatus. + * Samples for PrivateLinkResources ListByCluster. */ -public final class VirtualMachinesGetAsyncOperationStatusSamples { +public final class PrivateLinkResourcesListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetRestartHostsAsyncOperationStatus.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetAllPrivateLinkResourcesInCluster.json */ /** - * Sample code: Gets the async operation status of restarting host. + * Sample code: Get all private link resources in a specific HDInsight cluster. * * @param manager Entry point to HDInsightManager. */ - public static void - getsTheAsyncOperationStatusOfRestartingHost(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.virtualMachines() - .getAsyncOperationStatusWithResponse("rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", - com.azure.core.util.Context.NONE); + public static void getAllPrivateLinkResourcesInASpecificHDInsightCluster( + com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.privateLinkResources().listByClusterWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -2539,22 +2740,48 @@ public final class VirtualMachinesGetAsyncOperationStatusSamples { ### VirtualMachines_ListHosts ```java +import com.azure.resourcemanager.hdinsight.models.EntraUserInfo; +import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; +import java.util.Arrays; + /** - * Samples for VirtualMachines ListHosts. + * Samples for Clusters UpdateGatewaySettings. */ -public final class VirtualMachinesListHostsSamples { +public final class ClustersUpdateGatewaySettingsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * GetClusterVirtualMachines.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Clusters_UpdateGatewaySettings_Enable.json */ /** - * Sample code: Get All hosts in the cluster. + * Sample code: Enable HTTP connectivity. * * @param manager Entry point to HDInsightManager. */ - public static void getAllHostsInTheCluster(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.virtualMachines().listHostsWithResponse("rg1", "cluster1", com.azure.core.util.Context.NONE); + public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters() + .updateGatewaySettings("rg1", "cluster1", new UpdateGatewaySettingsParameters(), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Clusters_UpdateGatewaySettings_EntraUser.json + */ + /** + * Sample code: Update Entra User In HDInsight. + * + * @param manager Entry point to HDInsightManager. + */ + public static void updateEntraUserInHDInsight(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters() + .updateGatewaySettings("rg1", "cluster1", + new UpdateGatewaySettingsParameters().withRestAuthEntraUsers( + Arrays.asList(new EntraUserInfo().withObjectId("00000000-0000-0000-0000-000000000000") + .withDisplayName("displayName") + .withUpn("user@microsoft.com"))), + com.azure.core.util.Context.NONE); } } ``` @@ -2562,26 +2789,23 @@ public final class VirtualMachinesListHostsSamples { ### VirtualMachines_RestartHosts ```java -import java.util.Arrays; - /** - * Samples for VirtualMachines RestartHosts. + * Samples for Clusters ListByResourceGroup. */ -public final class VirtualMachinesRestartHostsSamples { +public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ - * RestartVirtualMachinesOperation.json + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * GetLinuxHadoopAllClustersInResourceGroup.json */ /** - * Sample code: Restarts the specified HDInsight cluster hosts. + * Sample code: Get All Hadoop on Linux clusters in a resource group. * * @param manager Entry point to HDInsightManager. */ public static void - restartsTheSpecifiedHDInsightClusterHosts(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { - manager.virtualMachines() - .restartHosts("rg1", "cluster1", Arrays.asList("gateway1", "gateway3"), com.azure.core.util.Context.NONE); + getAllHadoopOnLinuxClustersInAResourceGroup(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml index 551740090441..498ed54ff5c4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for HDInsight Management - This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2024-08-preview. + This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2025-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -48,11 +48,6 @@ true - - com.azure - azure-json - 1.5.0 - com.azure azure-core @@ -63,6 +58,11 @@ azure-core-management 1.17.0 + + com.azure + azure-json + 1.5.0 + com.azure azure-core-test diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java index 559cfc180130..0ccac7a50fde 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java @@ -11,17 +11,18 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.HDInsightManagementClient; import com.azure.resourcemanager.hdinsight.implementation.ApplicationsImpl; @@ -51,6 +52,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -133,6 +135,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-hdinsight.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -240,12 +245,14 @@ public HDInsightManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.hdinsight") .append("/") - .append("1.1.0-beta.2"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -278,7 +285,7 @@ public HDInsightManager authenticate(TokenCredential credential, AzureProfile pr HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java index 1229fbdba932..edc96b386a88 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java @@ -40,9 +40,9 @@ public final class ApplicationInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -50,9 +50,9 @@ public final class ApplicationInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ApplicationInner class. @@ -130,13 +130,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -150,13 +150,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java index f5582673499b..c21dec690ee4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java @@ -47,9 +47,9 @@ public final class ClusterInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -57,9 +57,9 @@ public final class ClusterInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ClusterInner class. @@ -157,13 +157,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -177,13 +177,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java index 5d2660a5d1e1..0ca296cfe231 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java @@ -4,17 +4,19 @@ package com.azure.resourcemanager.hdinsight.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.models.EntraUserInfo; import java.io.IOException; +import java.util.List; /** * Gateway settings. */ -@Immutable +@Fluent public final class GatewaySettingsInner implements JsonSerializable { /* * Indicates whether or not the gateway settings based authorization is enabled. @@ -31,6 +33,11 @@ public final class GatewaySettingsInner implements JsonSerializable restAuthEntraUsers; + /** * Creates an instance of GatewaySettingsInner class. */ @@ -65,12 +72,35 @@ public String password() { return this.password; } + /** + * Get the restAuthEntraUsers property: List of Entra users for gateway access. + * + * @return the restAuthEntraUsers value. + */ + public List restAuthEntraUsers() { + return this.restAuthEntraUsers; + } + + /** + * Set the restAuthEntraUsers property: List of Entra users for gateway access. + * + * @param restAuthEntraUsers the restAuthEntraUsers value to set. + * @return the GatewaySettingsInner object itself. + */ + public GatewaySettingsInner withRestAuthEntraUsers(List restAuthEntraUsers) { + this.restAuthEntraUsers = restAuthEntraUsers; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (restAuthEntraUsers() != null) { + restAuthEntraUsers().forEach(e -> e.validate()); + } } /** @@ -79,6 +109,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("restAuthEntraUsers", this.restAuthEntraUsers, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -103,6 +135,10 @@ public static GatewaySettingsInner fromJson(JsonReader jsonReader) throws IOExce deserializedGatewaySettingsInner.username = reader.getString(); } else if ("restAuthCredential.password".equals(fieldName)) { deserializedGatewaySettingsInner.password = reader.getString(); + } else if ("restAuthEntraUsers".equals(fieldName)) { + List restAuthEntraUsers + = reader.readArray(reader1 -> EntraUserInfo.fromJson(reader1)); + deserializedGatewaySettingsInner.restAuthEntraUsers = restAuthEntraUsers; } else { reader.skipChildren(); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateEndpointConnectionInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateEndpointConnectionInner.java index 8827e268c813..fc797e70b6af 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateEndpointConnectionInner.java @@ -32,9 +32,9 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -42,9 +42,9 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of PrivateEndpointConnectionInner class. @@ -71,13 +71,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -91,13 +91,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateLinkResourceInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateLinkResourceInner.java index 49e9b4d24632..ca8c05fa1cbe 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/PrivateLinkResourceInner.java @@ -29,9 +29,9 @@ public final class PrivateLinkResourceInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class PrivateLinkResourceInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of PrivateLinkResourceInner class. @@ -68,13 +68,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -88,13 +88,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java index 1a8adcd52635..1d7528484f2d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hdinsight.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -180,12 +181,28 @@ public RuntimeScriptActionDetailInner withRoles(List roles) { */ @Override public void validate() { - super.validate(); if (executionSummary() != null) { executionSummary().forEach(e -> e.validate()); } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model RuntimeScriptActionDetailInner")); + } + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property uri in model RuntimeScriptActionDetailInner")); + } + if (roles() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property roles in model RuntimeScriptActionDetailInner")); + } } + private static final ClientLogger LOGGER = new ClientLogger(RuntimeScriptActionDetailInner.class); + /** * {@inheritDoc} */ diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java index 0d36ef860d3c..5e617fbe2a66 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java @@ -27,8 +27,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.ApplicationsClient; @@ -80,6 +82,15 @@ Mono> listByCluster(@HostParam("$host") String e @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @@ -90,6 +101,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @@ -101,6 +122,17 @@ Mono>> create(@HostParam("$host") String endpoint, @BodyParam("application/json") ApplicationInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ApplicationInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 200, 202, 204 }) @@ -111,6 +143,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}/azureasyncoperations/{operationId}") @ExpectedResponses({ 200 }) @@ -121,6 +163,16 @@ Mono> getAzureAsyncOperationStatus(@HostPara @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}/azureasyncoperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -128,6 +180,14 @@ Mono> getAzureAsyncOperationStatus(@HostPara Mono> listByClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -173,38 +233,15 @@ private Mono> listByClusterSinglePageAsync(Strin * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list cluster Applications along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list cluster Applications as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** @@ -215,12 +252,34 @@ private Mono> listByClusterSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list cluster Applications as paginated response with {@link PagedFlux}. + * @return result of the request to list cluster Applications along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -232,13 +291,35 @@ private PagedFlux listByClusterAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list cluster Applications as paginated response with {@link PagedFlux}. + * @return result of the request to list cluster Applications along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName, Context context) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -253,7 +334,8 @@ private PagedFlux listByClusterAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); } /** @@ -270,7 +352,8 @@ public PagedIterable listByCluster(String resourceGroupName, S @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); } /** @@ -314,47 +397,6 @@ private Mono> getWithResponseAsync(String resourceGro .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets properties of the specified application. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param applicationName The constant value for the application name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the specified application along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationName, this.client.getApiVersion(), accept, context); - } - /** * Gets properties of the specified application. * @@ -387,7 +429,31 @@ private Mono getAsync(String resourceGroupName, String cluster @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String applicationName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, applicationName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, applicationName, this.client.getApiVersion(), accept, context); } /** @@ -460,43 +526,45 @@ private Mono>> createWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. * @param parameters The application create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the HDInsight cluster application along with {@link Response} on successful completion of {@link Mono}. + * @return the HDInsight cluster application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, ApplicationInner parameters, Context context) { + private Response createWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, applicationName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -506,18 +574,46 @@ private Mono>> createWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. * @param parameters The application create request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 the HDInsight cluster application. + * @return the HDInsight cluster application along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApplicationInner> beginCreateAsync(String resourceGroupName, - String clusterName, String applicationName, ApplicationInner parameters) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ApplicationInner.class, ApplicationInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, applicationName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -527,7 +623,6 @@ private PollerFlux, ApplicationInner> beginCreateAs * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. * @param parameters The application create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -535,12 +630,11 @@ private PollerFlux, ApplicationInner> beginCreateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ApplicationInner> beginCreateAsync(String resourceGroupName, - String clusterName, String applicationName, ApplicationInner parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, String applicationName, ApplicationInner parameters) { Mono>> mono - = createWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + = createWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ApplicationInner.class, ApplicationInner.class, context); + ApplicationInner.class, ApplicationInner.class, this.client.getContext()); } /** @@ -558,7 +652,9 @@ private PollerFlux, ApplicationInner> beginCreateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ApplicationInner> beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { - return this.beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters).getSyncPoller(); + Response response = createWithResponse(resourceGroupName, clusterName, applicationName, parameters); + return this.client.getLroResult(response, ApplicationInner.class, + ApplicationInner.class, Context.NONE); } /** @@ -577,8 +673,10 @@ public SyncPoller, ApplicationInner> beginCreate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ApplicationInner> beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters, context) - .getSyncPoller(); + Response response + = createWithResponse(resourceGroupName, clusterName, applicationName, parameters, context); + return this.client.getLroResult(response, ApplicationInner.class, + ApplicationInner.class, context); } /** @@ -600,26 +698,6 @@ private Mono createAsync(String resourceGroupName, String clus .flatMap(this.client::getLroFinalResultOrError); } - /** - * Creates applications for the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param applicationName The constant value for the application name. - * @param parameters The application create request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the HDInsight cluster application on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String clusterName, String applicationName, - ApplicationInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Creates applications for the HDInsight cluster. * @@ -635,7 +713,7 @@ private Mono createAsync(String resourceGroupName, String clus @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { - return createAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + return beginCreate(resourceGroupName, clusterName, applicationName, parameters).getFinalResult(); } /** @@ -654,7 +732,7 @@ public ApplicationInner create(String resourceGroupName, String clusterName, Str @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, Context context) { - return createAsync(resourceGroupName, clusterName, applicationName, parameters, context).block(); + return beginCreate(resourceGroupName, clusterName, applicationName, parameters, context).getFinalResult(); } /** @@ -703,38 +781,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, applicationName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -743,18 +822,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, applicationName, this.client.getApiVersion(), accept, context); } /** @@ -763,7 +864,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param applicationName The constant value for the application name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -771,12 +871,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - context = this.client.mergeContext(context); + String applicationName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -793,7 +892,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, applicationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -811,7 +911,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, applicationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -831,25 +932,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes the specified application on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param applicationName The constant value for the application name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes the specified application on the HDInsight cluster. * @@ -862,7 +944,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName) { - deleteAsync(resourceGroupName, clusterName, applicationName).block(); + beginDelete(resourceGroupName, clusterName, applicationName).getFinalResult(); } /** @@ -878,7 +960,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { - deleteAsync(resourceGroupName, clusterName, applicationName, context).block(); + beginDelete(resourceGroupName, clusterName, applicationName, context).getFinalResult(); } /** @@ -926,50 +1008,6 @@ private Mono> getAzureAsyncOperationStatusWi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the async operation status. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param applicationName The constant value for the application name. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAzureAsyncOperationStatusWithResponseAsync( - String resourceGroupName, String clusterName, String applicationName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), operationId, accept, context); - } - /** * Gets the async operation status. * @@ -1005,8 +1043,35 @@ private Mono getAzureAsyncOperationStatusAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureAsyncOperationStatusWithResponse(String resourceGroupName, String clusterName, String applicationName, String operationId, Context context) { - return getAzureAsyncOperationStatusWithResponseAsync(resourceGroupName, clusterName, applicationName, - operationId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), operationId, accept, context); } /** @@ -1055,6 +1120,33 @@ private Mono> listByClusterNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1063,22 +1155,25 @@ private Mono> listByClusterNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list cluster Applications along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list cluster Applications along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java index bccdbf1ef89b..0f2e0cfc05a0 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java @@ -29,8 +29,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.ClustersClient; @@ -93,6 +95,17 @@ Mono>> create(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterCreateParametersExtended parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterCreateParametersExtended parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") @ExpectedResponses({ 200 }) @@ -104,6 +117,17 @@ Mono> update(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterPatchParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterPatchParameters parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @@ -113,6 +137,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") @ExpectedResponses({ 200 }) @@ -122,6 +155,15 @@ Mono> getByResourceGroup(@HostParam("$host") String endpo @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") @ExpectedResponses({ 200 }) @@ -131,6 +173,15 @@ Mono> listByResourceGroup(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") @ExpectedResponses({ 200, 202 }) @@ -142,6 +193,17 @@ Mono>> resize(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterResizeParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resizeSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("roleName") RoleName roleName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterResizeParameters parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/autoscale") @ExpectedResponses({ 200, 202 }) @@ -153,6 +215,17 @@ Mono>> updateAutoScaleConfiguration(@HostParam("$host" @BodyParam("application/json") AutoscaleConfigurationUpdateParameter parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/autoscale") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateAutoScaleConfigurationSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("roleName") RoleName roleName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AutoscaleConfigurationUpdateParameter parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") @ExpectedResponses({ 200 }) @@ -161,6 +234,14 @@ Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @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.HDInsight/clusters/{clusterName}/rotatediskencryptionkey") @ExpectedResponses({ 200, 202 }) @@ -172,6 +253,17 @@ Mono>> rotateDiskEncryptionKey(@HostParam("$host") Str @BodyParam("application/json") ClusterDiskEncryptionParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/rotatediskencryptionkey") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rotateDiskEncryptionKeySync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterDiskEncryptionParameters parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/getGatewaySettings") @ExpectedResponses({ 200 }) @@ -181,6 +273,15 @@ Mono> getGatewaySettings(@HostParam("$host") Stri @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/getGatewaySettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getGatewaySettingsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings") @ExpectedResponses({ 200, 202 }) @@ -192,6 +293,17 @@ Mono>> updateGatewaySettings(@HostParam("$host") Strin @BodyParam("application/json") UpdateGatewaySettingsParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateGatewaySettingsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateGatewaySettingsParameters parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/azureasyncoperations/{operationId}") @ExpectedResponses({ 200 }) @@ -202,6 +314,16 @@ Mono> getAzureAsyncOperationStatus(@HostPara @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/azureasyncoperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate") @ExpectedResponses({ 200, 202 }) @@ -213,6 +335,17 @@ Mono>> updateIdentityCertificate(@HostParam("$host") S @BodyParam("application/json") UpdateClusterIdentityCertificateParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateIdentityCertificateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateClusterIdentityCertificateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") @ExpectedResponses({ 200, 202 }) @@ -225,6 +358,18 @@ Mono>> executeScriptActions(@HostParam("$host") String @BodyParam("application/json") ExecuteScriptActionParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeScriptActionsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExecuteScriptActionParameters parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -233,12 +378,27 @@ Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -288,39 +448,41 @@ private Mono>> createWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the HDInsight cluster along with {@link Response} on successful completion of {@link Mono}. + * @return the HDInsight cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, - ClusterCreateParametersExtended parameters, Context context) { + private Response createWithResponse(String resourceGroupName, String clusterName, + ClusterCreateParametersExtended parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -329,17 +491,42 @@ private Mono>> createWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster create request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 the HDInsight cluster. + * @return the HDInsight cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginCreateAsync(String resourceGroupName, - String clusterName, ClusterCreateParametersExtended parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String clusterName, + ClusterCreateParametersExtended parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -348,7 +535,6 @@ private PollerFlux, ClusterInner> beginCreateAsync(Stri * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -356,12 +542,10 @@ private PollerFlux, ClusterInner> beginCreateAsync(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateAsync(String resourceGroupName, - String clusterName, ClusterCreateParametersExtended parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, clusterName, parameters, context); + String clusterName, ClusterCreateParametersExtended parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -378,7 +562,9 @@ private PollerFlux, ClusterInner> beginCreateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { - return this.beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = createWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -396,7 +582,9 @@ public SyncPoller, ClusterInner> beginCreate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = createWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -417,25 +605,6 @@ private Mono createAsync(String resourceGroupName, String clusterN .flatMap(this.client::getLroFinalResultOrError); } - /** - * Creates a new HDInsight cluster with the specified parameters. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The cluster create request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the HDInsight cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String clusterName, - ClusterCreateParametersExtended parameters, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Creates a new HDInsight cluster with the specified parameters. * @@ -450,7 +619,7 @@ private Mono createAsync(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { - return createAsync(resourceGroupName, clusterName, parameters).block(); + return beginCreate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -468,7 +637,7 @@ public ClusterInner create(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { - return createAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginCreate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -512,47 +681,6 @@ private Mono> updateWithResponseAsync(String resourceGrou .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Patch HDInsight cluster with the specified parameters. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The cluster patch request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the HDInsight cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterPatchParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName 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(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), parameters, accept, context); - } - /** * Patch HDInsight cluster with the specified parameters. * @@ -586,7 +714,33 @@ private Mono updateAsync(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String clusterName, ClusterPatchParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, parameters, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -644,34 +798,34 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -679,16 +833,35 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); } /** @@ -696,19 +869,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 clusterName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -723,7 +893,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -740,7 +911,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -758,23 +930,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes the specified HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes the specified HDInsight cluster. * @@ -786,7 +941,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + beginDelete(resourceGroupName, clusterName).getFinalResult(); } /** @@ -801,7 +956,7 @@ public void delete(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + beginDelete(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -840,41 +995,6 @@ private Mono> getByResourceGroupWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specified cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); - } - /** * Gets the specified cluster. * @@ -905,7 +1025,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -960,35 +1100,15 @@ private Mono> listByResourceGroupSinglePageAsync(Str * Lists the HDInsight clusters in a resource group. * * @param resourceGroupName The name of the resource 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 the List Cluster operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List Cluster operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -998,12 +1118,29 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response as paginated response with {@link PagedFlux}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1014,12 +1151,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response as paginated response with {@link PagedFlux}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1033,7 +1187,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -1048,7 +1203,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -1103,42 +1259,45 @@ private Mono>> resizeWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the resize operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resizeWithResponseAsync(String resourceGroupName, String clusterName, - RoleName roleName, ClusterResizeParameters parameters, Context context) { + private Response resizeWithResponse(String resourceGroupName, String clusterName, RoleName roleName, + ClusterResizeParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (roleName == null) { - return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.resize(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, roleName, this.client.getApiVersion(), parameters, accept, context); + return service.resizeSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, roleName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -1148,18 +1307,46 @@ private Mono>> resizeWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the resize operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResizeAsync(String resourceGroupName, String clusterName, - RoleName roleName, ClusterResizeParameters parameters) { - Mono>> mono - = resizeWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resizeWithResponse(String resourceGroupName, String clusterName, RoleName roleName, + ClusterResizeParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.resizeSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, roleName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -1169,7 +1356,6 @@ private PollerFlux, Void> beginResizeAsync(String resourceGroup * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the resize operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1177,12 +1363,11 @@ private PollerFlux, Void> beginResizeAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync(String resourceGroupName, String clusterName, - RoleName roleName, ClusterResizeParameters parameters, Context context) { - context = this.client.mergeContext(context); + RoleName roleName, ClusterResizeParameters parameters) { Mono>> mono - = resizeWithResponseAsync(resourceGroupName, clusterName, roleName, parameters, context); + = resizeWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1200,7 +1385,8 @@ private PollerFlux, Void> beginResizeAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize(String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { - return this.beginResizeAsync(resourceGroupName, clusterName, roleName, parameters).getSyncPoller(); + Response response = resizeWithResponse(resourceGroupName, clusterName, roleName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1216,29 +1402,12 @@ public SyncPoller, Void> beginResize(String resourceGroupName, * @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> beginResize(String resourceGroupName, String clusterName, - RoleName roleName, ClusterResizeParameters parameters, Context context) { - return this.beginResizeAsync(resourceGroupName, clusterName, roleName, parameters, context).getSyncPoller(); - } - - /** - * Resizes the specified HDInsight cluster to the specified size. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param roleName The constant value for the roleName. - * @param parameters The parameters for the resize operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resizeAsync(String resourceGroupName, String clusterName, RoleName roleName, - ClusterResizeParameters parameters) { - return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResize(String resourceGroupName, String clusterName, + RoleName roleName, ClusterResizeParameters parameters, Context context) { + Response response + = resizeWithResponse(resourceGroupName, clusterName, roleName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1248,7 +1417,6 @@ private Mono resizeAsync(String resourceGroupName, String clusterName, Rol * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the resize operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1256,8 +1424,8 @@ private Mono resizeAsync(String resourceGroupName, String clusterName, Rol */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resizeAsync(String resourceGroupName, String clusterName, RoleName roleName, - ClusterResizeParameters parameters, Context context) { - return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters, context).last() + ClusterResizeParameters parameters) { + return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1275,7 +1443,7 @@ private Mono resizeAsync(String resourceGroupName, String clusterName, Rol @ServiceMethod(returns = ReturnType.SINGLE) public void resize(String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { - resizeAsync(resourceGroupName, clusterName, roleName, parameters).block(); + beginResize(resourceGroupName, clusterName, roleName, parameters).getFinalResult(); } /** @@ -1293,7 +1461,7 @@ public void resize(String resourceGroupName, String clusterName, RoleName roleNa @ServiceMethod(returns = ReturnType.SINGLE) public void resize(String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters, Context context) { - resizeAsync(resourceGroupName, clusterName, roleName, parameters, context).block(); + beginResize(resourceGroupName, clusterName, roleName, parameters, context).getFinalResult(); } /** @@ -1349,42 +1517,45 @@ private Mono>> updateAutoScaleConfigurationWithRespons * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the update autoscale configuration operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateAutoScaleConfigurationWithResponseAsync(String resourceGroupName, - String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { + private Response updateAutoScaleConfigurationWithResponse(String resourceGroupName, String clusterName, + RoleName roleName, AutoscaleConfigurationUpdateParameter parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (roleName == null) { - return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.updateAutoScaleConfiguration(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, roleName, this.client.getApiVersion(), parameters, accept, context); + return service.updateAutoScaleConfigurationSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, roleName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -1394,18 +1565,46 @@ private Mono>> updateAutoScaleConfigurationWithRespons * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the update autoscale configuration operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, - String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters) { - Mono>> mono - = updateAutoScaleConfigurationWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateAutoScaleConfigurationWithResponse(String resourceGroupName, String clusterName, + RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateAutoScaleConfigurationSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, roleName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -1415,7 +1614,6 @@ private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsyn * @param clusterName The name of the cluster. * @param roleName The constant value for the roleName. * @param parameters The parameters for the update autoscale configuration operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1423,12 +1621,11 @@ private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, - String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateAutoScaleConfigurationWithResponseAsync(resourceGroupName, - clusterName, roleName, parameters, context); + String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters) { + Mono>> mono + = updateAutoScaleConfigurationWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1446,8 +1643,9 @@ private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsyn @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateAutoScaleConfiguration(String resourceGroupName, String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters) { - return this.beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters) - .getSyncPoller(); + Response response + = updateAutoScaleConfigurationWithResponse(resourceGroupName, clusterName, roleName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1466,9 +1664,9 @@ public SyncPoller, Void> beginUpdateAutoScaleConfiguration(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateAutoScaleConfiguration(String resourceGroupName, String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { - return this - .beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context) - .getSyncPoller(); + Response response + = updateAutoScaleConfigurationWithResponse(resourceGroupName, clusterName, roleName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1490,27 +1688,6 @@ private Mono updateAutoScaleConfigurationAsync(String resourceGroupName, S .flatMap(this.client::getLroFinalResultOrError); } - /** - * Updates the Autoscale Configuration for HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param roleName The constant value for the roleName. - * @param parameters The parameters for the update autoscale configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, - RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { - return beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Updates the Autoscale Configuration for HDInsight cluster. * @@ -1525,7 +1702,7 @@ private Mono updateAutoScaleConfigurationAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public void updateAutoScaleConfiguration(String resourceGroupName, String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters) { - updateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters).block(); + beginUpdateAutoScaleConfiguration(resourceGroupName, clusterName, roleName, parameters).getFinalResult(); } /** @@ -1543,7 +1720,8 @@ public void updateAutoScaleConfiguration(String resourceGroupName, String cluste @ServiceMethod(returns = ReturnType.SINGLE) public void updateAutoScaleConfiguration(String resourceGroupName, String clusterName, RoleName roleName, AutoscaleConfigurationUpdateParameter parameters, Context context) { - updateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context).block(); + beginUpdateAutoScaleConfiguration(resourceGroupName, clusterName, roleName, parameters, context) + .getFinalResult(); } /** @@ -1576,30 +1754,13 @@ private Mono> listSinglePageAsync() { /** * Lists all the HDInsight clusters under the subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List Cluster operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1607,11 +1768,25 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response as paginated response with {@link PagedFlux}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1621,12 +1796,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response as paginated response with {@link PagedFlux}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1638,7 +1826,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -1652,7 +1840,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1703,39 +1891,41 @@ private Mono>> rotateDiskEncryptionKeyWithResponseAsyn * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for the disk encryption operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateDiskEncryptionKeyWithResponseAsync(String resourceGroupName, - String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + private Response rotateDiskEncryptionKeyWithResponse(String resourceGroupName, String clusterName, + ClusterDiskEncryptionParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.rotateDiskEncryptionKey(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.rotateDiskEncryptionKeySync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -1744,18 +1934,42 @@ private Mono>> rotateDiskEncryptionKeyWithResponseAsyn * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for the disk encryption operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync(String resourceGroupName, - String clusterName, ClusterDiskEncryptionParameters parameters) { - Mono>> mono - = rotateDiskEncryptionKeyWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateDiskEncryptionKeyWithResponse(String resourceGroupName, String clusterName, + ClusterDiskEncryptionParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.rotateDiskEncryptionKeySync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -1764,7 +1978,6 @@ private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync(Str * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for the disk encryption operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1772,12 +1985,11 @@ private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync(Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync(String resourceGroupName, - String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, ClusterDiskEncryptionParameters parameters) { Mono>> mono - = rotateDiskEncryptionKeyWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = rotateDiskEncryptionKeyWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1794,7 +2006,8 @@ private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync(Str @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { - return this.beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = rotateDiskEncryptionKeyWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1812,8 +2025,9 @@ public SyncPoller, Void> beginRotateDiskEncryptionKey(String re @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { - return this.beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context) - .getSyncPoller(); + Response response + = rotateDiskEncryptionKeyWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1834,25 +2048,6 @@ private Mono rotateDiskEncryptionKeyAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Rotate disk encryption key of the specified HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The parameters for the disk encryption operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono rotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, - ClusterDiskEncryptionParameters parameters, Context context) { - return beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Rotate disk encryption key of the specified HDInsight cluster. * @@ -1866,7 +2061,7 @@ private Mono rotateDiskEncryptionKeyAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public void rotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { - rotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters).block(); + beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -1883,7 +2078,7 @@ public void rotateDiskEncryptionKey(String resourceGroupName, String clusterName @ServiceMethod(returns = ReturnType.SINGLE) public void rotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { - rotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context).block(); + beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -1923,42 +2118,6 @@ private Mono> getGatewaySettingsWithResponseAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the gateway settings for the specified cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the gateway settings for the specified cluster along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGatewaySettingsWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getGatewaySettings(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); - } - /** * Gets the gateway settings for the specified cluster. * @@ -1989,7 +2148,27 @@ private Mono getGatewaySettingsAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response getGatewaySettingsWithResponse(String resourceGroupName, String clusterName, Context context) { - return getGatewaySettingsWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getGatewaySettingsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -2055,38 +2234,84 @@ private Mono>> updateGatewaySettingsWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster configurations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateGatewaySettingsWithResponseAsync(String resourceGroupName, - String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + private Response updateGatewaySettingsWithResponse(String resourceGroupName, String clusterName, + UpdateGatewaySettingsParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateGatewaySettingsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateGatewaySettingsWithResponse(String resourceGroupName, String clusterName, + UpdateGatewaySettingsParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.updateGatewaySettings(this.client.getEndpoint(), this.client.getSubscriptionId(), + return service.updateGatewaySettingsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } @@ -2110,28 +2335,6 @@ private PollerFlux, Void> beginUpdateGatewaySettingsAsync(Strin this.client.getContext()); } - /** - * Configures the gateway settings on the specified cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The cluster configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginUpdateGatewaySettingsAsync(String resourceGroupName, - String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateGatewaySettingsWithResponseAsync(resourceGroupName, clusterName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - /** * Configures the gateway settings on the specified cluster. * @@ -2146,7 +2349,8 @@ private PollerFlux, Void> beginUpdateGatewaySettingsAsync(Strin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { - return this.beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = updateGatewaySettingsWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2164,8 +2368,9 @@ public SyncPoller, Void> beginUpdateGatewaySettings(String reso @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { - return this.beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context) - .getSyncPoller(); + Response response + = updateGatewaySettingsWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2186,25 +2391,6 @@ private Mono updateGatewaySettingsAsync(String resourceGroupName, String c .flatMap(this.client::getLroFinalResultOrError); } - /** - * Configures the gateway settings on the specified cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The cluster configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateGatewaySettingsAsync(String resourceGroupName, String clusterName, - UpdateGatewaySettingsParameters parameters, Context context) { - return beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Configures the gateway settings on the specified cluster. * @@ -2218,7 +2404,7 @@ private Mono updateGatewaySettingsAsync(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) public void updateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { - updateGatewaySettingsAsync(resourceGroupName, clusterName, parameters).block(); + beginUpdateGatewaySettings(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -2235,7 +2421,7 @@ public void updateGatewaySettings(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public void updateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { - updateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context).block(); + beginUpdateGatewaySettings(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -2278,45 +2464,6 @@ private Mono> getAzureAsyncOperationStatusWi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * The the async operation status. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the azure async operation response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAzureAsyncOperationStatusWithResponseAsync( - String resourceGroupName, String clusterName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); - } - /** * The the async operation status. * @@ -2350,8 +2497,31 @@ private Mono getAzureAsyncOperationStatusAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureAsyncOperationStatusWithResponse(String resourceGroupName, String clusterName, String operationId, Context context) { - return getAzureAsyncOperationStatusWithResponseAsync(resourceGroupName, clusterName, operationId, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); } /** @@ -2420,39 +2590,41 @@ private Mono>> updateIdentityCertificateWithResponseAs * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster configurations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateIdentityCertificateWithResponseAsync(String resourceGroupName, - String clusterName, UpdateClusterIdentityCertificateParameters parameters, Context context) { + private Response updateIdentityCertificateWithResponse(String resourceGroupName, String clusterName, + UpdateClusterIdentityCertificateParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.updateIdentityCertificate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.updateIdentityCertificateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -2461,18 +2633,42 @@ private Mono>> updateIdentityCertificateWithResponseAs * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster configurations. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateIdentityCertificateAsync(String resourceGroupName, - String clusterName, UpdateClusterIdentityCertificateParameters parameters) { - Mono>> mono - = updateIdentityCertificateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateIdentityCertificateWithResponse(String resourceGroupName, String clusterName, + UpdateClusterIdentityCertificateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateIdentityCertificateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -2481,7 +2677,6 @@ private PollerFlux, Void> beginUpdateIdentityCertificateAsync(S * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The cluster configurations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2489,12 +2684,11 @@ private PollerFlux, Void> beginUpdateIdentityCertificateAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUpdateIdentityCertificateAsync(String resourceGroupName, - String clusterName, UpdateClusterIdentityCertificateParameters parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, UpdateClusterIdentityCertificateParameters parameters) { Mono>> mono - = updateIdentityCertificateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = updateIdentityCertificateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -2511,7 +2705,9 @@ private PollerFlux, Void> beginUpdateIdentityCertificateAsync(S @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateIdentityCertificate(String resourceGroupName, String clusterName, UpdateClusterIdentityCertificateParameters parameters) { - return this.beginUpdateIdentityCertificateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response + = updateIdentityCertificateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2529,8 +2725,9 @@ public SyncPoller, Void> beginUpdateIdentityCertificate(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdateIdentityCertificate(String resourceGroupName, String clusterName, UpdateClusterIdentityCertificateParameters parameters, Context context) { - return this.beginUpdateIdentityCertificateAsync(resourceGroupName, clusterName, parameters, context) - .getSyncPoller(); + Response response + = updateIdentityCertificateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2551,25 +2748,6 @@ private Mono updateIdentityCertificateAsync(String resourceGroupName, Stri .flatMap(this.client::getLroFinalResultOrError); } - /** - * Updates the cluster identity certificate. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The cluster configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateIdentityCertificateAsync(String resourceGroupName, String clusterName, - UpdateClusterIdentityCertificateParameters parameters, Context context) { - return beginUpdateIdentityCertificateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Updates the cluster identity certificate. * @@ -2583,7 +2761,7 @@ private Mono updateIdentityCertificateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public void updateIdentityCertificate(String resourceGroupName, String clusterName, UpdateClusterIdentityCertificateParameters parameters) { - updateIdentityCertificateAsync(resourceGroupName, clusterName, parameters).block(); + beginUpdateIdentityCertificate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -2600,7 +2778,7 @@ public void updateIdentityCertificate(String resourceGroupName, String clusterNa @ServiceMethod(returns = ReturnType.SINGLE) public void updateIdentityCertificate(String resourceGroupName, String clusterName, UpdateClusterIdentityCertificateParameters parameters, Context context) { - updateIdentityCertificateAsync(resourceGroupName, clusterName, parameters, context).block(); + beginUpdateIdentityCertificate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -2652,40 +2830,42 @@ private Mono>> executeScriptActionsWithResponseAsync(S * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for executing script actions. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeScriptActionsWithResponseAsync(String resourceGroupName, - String clusterName, ExecuteScriptActionParameters parameters, Context context) { + private Response executeScriptActionsWithResponse(String resourceGroupName, String clusterName, + ExecuteScriptActionParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.executeScriptActions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.executeScriptActionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -2694,19 +2874,43 @@ private Mono>> executeScriptActionsWithResponseAsync(S * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for executing script actions. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteScriptActionsAsync(String resourceGroupName, - String clusterName, ExecuteScriptActionParameters parameters) { - Mono>> mono - = executeScriptActionsWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeScriptActionsWithResponse(String resourceGroupName, String clusterName, + ExecuteScriptActionParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.executeScriptActionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -2715,7 +2919,6 @@ private PollerFlux, Void> beginExecuteScriptActionsAsync(String * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The parameters for executing script actions. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 404. @@ -2724,12 +2927,11 @@ private PollerFlux, Void> beginExecuteScriptActionsAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteScriptActionsAsync(String resourceGroupName, - String clusterName, ExecuteScriptActionParameters parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, ExecuteScriptActionParameters parameters) { Mono>> mono - = executeScriptActionsWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = executeScriptActionsWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -2747,7 +2949,8 @@ private PollerFlux, Void> beginExecuteScriptActionsAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { - return this.beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = executeScriptActionsWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2766,7 +2969,9 @@ public SyncPoller, Void> beginExecuteScriptActions(String resou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { - return this.beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response + = executeScriptActionsWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2788,26 +2993,6 @@ private Mono executeScriptActionsAsync(String resourceGroupName, String cl .flatMap(this.client::getLroFinalResultOrError); } - /** - * Executes script actions on the specified HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The parameters for executing script actions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. - * @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 executeScriptActionsAsync(String resourceGroupName, String clusterName, - ExecuteScriptActionParameters parameters, Context context) { - return beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Executes script actions on the specified HDInsight cluster. * @@ -2822,7 +3007,7 @@ private Mono executeScriptActionsAsync(String resourceGroupName, String cl @ServiceMethod(returns = ReturnType.SINGLE) public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { - executeScriptActionsAsync(resourceGroupName, clusterName, parameters).block(); + beginExecuteScriptActions(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -2840,7 +3025,7 @@ public void executeScriptActions(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { - executeScriptActionsAsync(resourceGroupName, clusterName, parameters, context).block(); + beginExecuteScriptActions(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -2871,6 +3056,33 @@ private Mono> listByResourceGroupNextSinglePageAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2879,23 +3091,24 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2924,6 +3137,33 @@ private Mono> listNextSinglePageAsync(String nextLin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2932,22 +3172,24 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Cluster operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List Cluster operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ClustersClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java index 6b4d39ee8909..4d308c5b5487 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java @@ -22,8 +22,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.ConfigurationsClient; @@ -74,6 +76,15 @@ Mono> list(@HostParam("$host") String endpo @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") @ExpectedResponses({ 200, 202, 204 }) @@ -85,6 +96,17 @@ Mono>> update(@HostParam("$host") String endpoint, @BodyParam("application/json") Map parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Map parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") @ExpectedResponses({ 200 }) @@ -94,6 +116,16 @@ Mono>> get(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** @@ -132,42 +164,6 @@ private Mono> listWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets all configuration information for an HDI cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 configuration information for an HDI cluster along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context); - } - /** * Gets all configuration information for an HDI cluster. * @@ -197,7 +193,27 @@ private Mono listAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceGroupName, String clusterName, Context context) { - return listWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); } /** @@ -269,41 +285,43 @@ private Mono>> updateWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param configurationName The name of the cluster configuration. * @param parameters The cluster configurations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String configurationName, Map parameters, Context context) { + private Response updateWithResponse(String resourceGroupName, String clusterName, + String configurationName, Map parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, configurationName, this.client.getApiVersion(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, configurationName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -314,18 +332,44 @@ private Mono>> updateWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param configurationName The name of the cluster configuration. * @param parameters The cluster configurations. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync(String resourceGroupName, String clusterName, - String configurationName, Map parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, configurationName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + String configurationName, Map parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, configurationName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -336,7 +380,6 @@ private PollerFlux, Void> beginUpdateAsync(String resourceGroup * @param clusterName The name of the cluster. * @param configurationName The name of the cluster configuration. * @param parameters The cluster configurations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -344,12 +387,11 @@ private PollerFlux, Void> beginUpdateAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUpdateAsync(String resourceGroupName, String clusterName, - String configurationName, Map parameters, Context context) { - context = this.client.mergeContext(context); + String configurationName, Map parameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, configurationName, parameters, context); + = updateWithResponseAsync(resourceGroupName, clusterName, configurationName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -368,7 +410,9 @@ private PollerFlux, Void> beginUpdateAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, clusterName, configurationName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -388,8 +432,9 @@ public SyncPoller, Void> beginUpdate(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters, context) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, clusterName, configurationName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -412,27 +457,6 @@ private Mono updateAsync(String resourceGroupName, String clusterName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings - * in cluster endpoint instead. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param configurationName The name of the cluster configuration. - * @param parameters The cluster configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateAsync(String resourceGroupName, String clusterName, String configurationName, - Map parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings * in cluster endpoint instead. @@ -448,7 +472,7 @@ private Mono updateAsync(String resourceGroupName, String clusterName, Str @ServiceMethod(returns = ReturnType.SINGLE) public void update(String resourceGroupName, String clusterName, String configurationName, Map parameters) { - updateAsync(resourceGroupName, clusterName, configurationName, parameters).block(); + beginUpdate(resourceGroupName, clusterName, configurationName, parameters).getFinalResult(); } /** @@ -467,7 +491,7 @@ public void update(String resourceGroupName, String clusterName, String configur @ServiceMethod(returns = ReturnType.SINGLE) public void update(String resourceGroupName, String clusterName, String configurationName, Map parameters, Context context) { - updateAsync(resourceGroupName, clusterName, configurationName, parameters, context).block(); + beginUpdate(resourceGroupName, clusterName, configurationName, parameters, context).getFinalResult(); } /** @@ -512,48 +536,6 @@ private Mono>> getWithResponseAsync(String resource .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * The configuration object for the specified cluster. This API is not recommended and might be removed in the - * future. Please consider using List configurations API instead. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param configurationName The name of the cluster configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration object for the specified configuration for the specified cluster along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync(String resourceGroupName, String clusterName, - String configurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - configurationName, this.client.getApiVersion(), accept, context); - } - /** * The configuration object for the specified cluster. This API is not recommended and might be removed in the * future. Please consider using List configurations API instead. @@ -590,7 +572,31 @@ private Mono> getAsync(String resourceGroupName, String clus @ServiceMethod(returns = ReturnType.SINGLE) public Response> getWithResponse(String resourceGroupName, String clusterName, String configurationName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, configurationName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, configurationName, this.client.getApiVersion(), accept, context); } /** @@ -609,4 +615,6 @@ public Response> getWithResponse(String resourceGroupName, S public Map get(String resourceGroupName, String clusterName, String configurationName) { return getWithResponse(resourceGroupName, clusterName, configurationName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java index 5a488968e88d..6cca299cf810 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java @@ -23,8 +23,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.ExtensionsClient; @@ -81,6 +83,17 @@ Mono>> enableMonitoring(@HostParam("$host") String end @BodyParam("application/json") ClusterMonitoringRequest parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableMonitoringSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterMonitoringRequest parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") @ExpectedResponses({ 200 }) @@ -90,6 +103,15 @@ Mono> getMonitoringStatus(@HostParam("$ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getMonitoringStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") @ExpectedResponses({ 200, 202, 204 }) @@ -99,6 +121,15 @@ Mono>> disableMonitoring(@HostParam("$host") String en @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableMonitoringSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") @ExpectedResponses({ 200, 202 }) @@ -109,6 +140,16 @@ Mono>> enableAzureMonitor(@HostParam("$host") String e @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AzureMonitorRequest parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableAzureMonitorSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AzureMonitorRequest parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") @ExpectedResponses({ 200 }) @@ -118,6 +159,15 @@ Mono> getAzureMonitorStatus(@HostParam("$hos @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureMonitorStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") @ExpectedResponses({ 200, 202, 204 }) @@ -127,6 +177,15 @@ Mono>> disableAzureMonitor(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableAzureMonitorSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") @ExpectedResponses({ 200, 202 }) @@ -137,6 +196,16 @@ Mono>> enableAzureMonitorAgent(@HostParam("$host") Str @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AzureMonitorRequest parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableAzureMonitorAgentSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AzureMonitorRequest parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") @ExpectedResponses({ 200 }) @@ -146,6 +215,15 @@ Mono> getAzureMonitorAgentStatus(@HostParam( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureMonitorAgentStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") @ExpectedResponses({ 200, 202, 204 }) @@ -155,6 +233,15 @@ Mono>> disableAzureMonitorAgent(@HostParam("$host") St @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitorAgent") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableAzureMonitorAgentSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") @ExpectedResponses({ 200, 202 }) @@ -165,6 +252,16 @@ Mono>> create(@HostParam("$host") String endpoint, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Extension parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Extension parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") @ExpectedResponses({ 200 }) @@ -175,6 +272,16 @@ Mono> get(@HostParam("$host") String en @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") @ExpectedResponses({ 200, 202, 204 }) @@ -185,6 +292,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}/azureAsyncOperations/{operationId}") @ExpectedResponses({ 200 }) @@ -194,6 +311,16 @@ Mono> getAzureAsyncOperationStatus(@HostPara @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}/azureAsyncOperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** @@ -243,39 +370,41 @@ private Mono>> enableMonitoringWithResponseAsync(Strin * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Operations Management Suite (OMS) workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enableMonitoringWithResponseAsync(String resourceGroupName, - String clusterName, ClusterMonitoringRequest parameters, Context context) { + private Response enableMonitoringWithResponse(String resourceGroupName, String clusterName, + ClusterMonitoringRequest parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.enableMonitoring(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.enableMonitoringSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -284,18 +413,42 @@ private Mono>> enableMonitoringWithResponseAsync(Strin * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnableMonitoringAsync(String resourceGroupName, String clusterName, - ClusterMonitoringRequest parameters) { - Mono>> mono - = enableMonitoringWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableMonitoringWithResponse(String resourceGroupName, String clusterName, + ClusterMonitoringRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.enableMonitoringSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -304,7 +457,6 @@ private PollerFlux, Void> beginEnableMonitoringAsync(String res * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Operations Management Suite (OMS) workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -312,12 +464,11 @@ private PollerFlux, Void> beginEnableMonitoringAsync(String res */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginEnableMonitoringAsync(String resourceGroupName, String clusterName, - ClusterMonitoringRequest parameters, Context context) { - context = this.client.mergeContext(context); + ClusterMonitoringRequest parameters) { Mono>> mono - = enableMonitoringWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = enableMonitoringWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -334,7 +485,8 @@ private PollerFlux, Void> beginEnableMonitoringAsync(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { - return this.beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = enableMonitoringWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -352,7 +504,9 @@ public SyncPoller, Void> beginEnableMonitoring(String resourceG @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { - return this.beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response + = enableMonitoringWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -373,25 +527,6 @@ private Mono enableMonitoringAsync(String resourceGroupName, String cluste .flatMap(this.client::getLroFinalResultOrError); } - /** - * Enables the Operations Management Suite (OMS) on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The Operations Management Suite (OMS) workspace parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enableMonitoringAsync(String resourceGroupName, String clusterName, - ClusterMonitoringRequest parameters, Context context) { - return beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Enables the Operations Management Suite (OMS) on the HDInsight cluster. * @@ -404,7 +539,7 @@ private Mono enableMonitoringAsync(String resourceGroupName, String cluste */ @ServiceMethod(returns = ReturnType.SINGLE) public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { - enableMonitoringAsync(resourceGroupName, clusterName, parameters).block(); + beginEnableMonitoring(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -421,7 +556,7 @@ public void enableMonitoring(String resourceGroupName, String clusterName, Clust @ServiceMethod(returns = ReturnType.SINGLE) public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { - enableMonitoringAsync(resourceGroupName, clusterName, parameters, context).block(); + beginEnableMonitoring(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -461,42 +596,6 @@ public void enableMonitoring(String resourceGroupName, String clusterName, Clust .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Operations Management Suite (OMS) on the HDInsight cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getMonitoringStatusWithResponseAsync(String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMonitoringStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); - } - /** * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. * @@ -529,7 +628,27 @@ private Mono getMonitoringStatusAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) public Response getMonitoringStatusWithResponse(String resourceGroupName, String clusterName, Context context) { - return getMonitoringStatusWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getMonitoringStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -588,34 +707,34 @@ private Mono>> disableMonitoringWithResponseAsync(Stri * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> disableMonitoringWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { + private Response disableMonitoringWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.disableMonitoring(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service.disableMonitoringSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -623,17 +742,36 @@ private Mono>> disableMonitoringWithResponseAsync(Stri * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDisableMonitoringAsync(String resourceGroupName, - String clusterName) { - Mono>> mono = disableMonitoringWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableMonitoringWithResponse(String resourceGroupName, String clusterName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.disableMonitoringSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -641,20 +779,17 @@ private PollerFlux, Void> beginDisableMonitoringAsync(String re * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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> beginDisableMonitoringAsync(String resourceGroupName, String clusterName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = disableMonitoringWithResponseAsync(resourceGroupName, clusterName, context); + private PollerFlux, Void> beginDisableMonitoringAsync(String resourceGroupName, + String clusterName) { + Mono>> mono = disableMonitoringWithResponseAsync(resourceGroupName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -669,7 +804,8 @@ private PollerFlux, Void> beginDisableMonitoringAsync(String re */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableMonitoring(String resourceGroupName, String clusterName) { - return this.beginDisableMonitoringAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = disableMonitoringWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -686,7 +822,8 @@ public SyncPoller, Void> beginDisableMonitoring(String resource @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableMonitoring(String resourceGroupName, String clusterName, Context context) { - return this.beginDisableMonitoringAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = disableMonitoringWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -705,23 +842,6 @@ private Mono disableMonitoringAsync(String resourceGroupName, String clust .flatMap(this.client::getLroFinalResultOrError); } - /** - * Disables the Operations Management Suite (OMS) on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 disableMonitoringAsync(String resourceGroupName, String clusterName, Context context) { - return beginDisableMonitoringAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Disables the Operations Management Suite (OMS) on the HDInsight cluster. * @@ -733,7 +853,7 @@ private Mono disableMonitoringAsync(String resourceGroupName, String clust */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableMonitoring(String resourceGroupName, String clusterName) { - disableMonitoringAsync(resourceGroupName, clusterName).block(); + beginDisableMonitoring(resourceGroupName, clusterName).getFinalResult(); } /** @@ -748,7 +868,7 @@ public void disableMonitoring(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableMonitoring(String resourceGroupName, String clusterName, Context context) { - disableMonitoringAsync(resourceGroupName, clusterName, context).block(); + beginDisableMonitoring(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -799,39 +919,41 @@ private Mono>> enableAzureMonitorWithResponseAsync(Str * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enableAzureMonitorWithResponseAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters, Context context) { + private Response enableAzureMonitorWithResponse(String resourceGroupName, String clusterName, + AzureMonitorRequest parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.enableAzureMonitor(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.enableAzureMonitorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -840,18 +962,42 @@ private Mono>> enableAzureMonitorWithResponseAsync(Str * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnableAzureMonitorAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters) { - Mono>> mono - = enableAzureMonitorWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableAzureMonitorWithResponse(String resourceGroupName, String clusterName, + AzureMonitorRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.enableAzureMonitorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -860,7 +1006,6 @@ private PollerFlux, Void> beginEnableAzureMonitorAsync(String r * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -868,12 +1013,11 @@ private PollerFlux, Void> beginEnableAzureMonitorAsync(String r */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginEnableAzureMonitorAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, AzureMonitorRequest parameters) { Mono>> mono - = enableAzureMonitorWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = enableAzureMonitorWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -890,7 +1034,8 @@ private PollerFlux, Void> beginEnableAzureMonitorAsync(String r @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableAzureMonitor(String resourceGroupName, String clusterName, AzureMonitorRequest parameters) { - return this.beginEnableAzureMonitorAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = enableAzureMonitorWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -908,7 +1053,9 @@ public SyncPoller, Void> beginEnableAzureMonitor(String resourc @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableAzureMonitor(String resourceGroupName, String clusterName, AzureMonitorRequest parameters, Context context) { - return this.beginEnableAzureMonitorAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response + = enableAzureMonitorWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -929,25 +1076,6 @@ private Mono enableAzureMonitorAsync(String resourceGroupName, String clus .flatMap(this.client::getLroFinalResultOrError); } - /** - * Enables the Azure Monitor on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enableAzureMonitorAsync(String resourceGroupName, String clusterName, - AzureMonitorRequest parameters, Context context) { - return beginEnableAzureMonitorAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Enables the Azure Monitor on the HDInsight cluster. * @@ -960,7 +1088,7 @@ private Mono enableAzureMonitorAsync(String resourceGroupName, String clus */ @ServiceMethod(returns = ReturnType.SINGLE) public void enableAzureMonitor(String resourceGroupName, String clusterName, AzureMonitorRequest parameters) { - enableAzureMonitorAsync(resourceGroupName, clusterName, parameters).block(); + beginEnableAzureMonitor(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -977,7 +1105,7 @@ public void enableAzureMonitor(String resourceGroupName, String clusterName, Azu @ServiceMethod(returns = ReturnType.SINGLE) public void enableAzureMonitor(String resourceGroupName, String clusterName, AzureMonitorRequest parameters, Context context) { - enableAzureMonitorAsync(resourceGroupName, clusterName, parameters, context).block(); + beginEnableAzureMonitor(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -1017,42 +1145,6 @@ private Mono> getAzureMonitorStatusWithRespo .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the status of Azure Monitor on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Azure Monitor on the HDInsight cluster along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAzureMonitorStatusWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureMonitorStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); - } - /** * Gets the status of Azure Monitor on the HDInsight cluster. * @@ -1083,7 +1175,27 @@ private Mono getAzureMonitorStatusAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureMonitorStatusWithResponse(String resourceGroupName, String clusterName, Context context) { - return getAzureMonitorStatusWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureMonitorStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -1142,34 +1254,34 @@ private Mono>> disableAzureMonitorWithResponseAsync(St * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> disableAzureMonitorWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { + private Response disableAzureMonitorWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.disableAzureMonitor(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); + return service.disableAzureMonitorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -1177,17 +1289,36 @@ private Mono>> disableAzureMonitorWithResponseAsync(St * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDisableAzureMonitorAsync(String resourceGroupName, - String clusterName) { - Mono>> mono = disableAzureMonitorWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableAzureMonitorWithResponse(String resourceGroupName, String clusterName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.disableAzureMonitorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -1195,7 +1326,6 @@ private PollerFlux, Void> beginDisableAzureMonitorAsync(String * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1203,12 +1333,10 @@ private PollerFlux, Void> beginDisableAzureMonitorAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDisableAzureMonitorAsync(String resourceGroupName, - String clusterName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = disableAzureMonitorWithResponseAsync(resourceGroupName, clusterName, context); + String clusterName) { + Mono>> mono = disableAzureMonitorWithResponseAsync(resourceGroupName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1223,7 +1351,8 @@ private PollerFlux, Void> beginDisableAzureMonitorAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableAzureMonitor(String resourceGroupName, String clusterName) { - return this.beginDisableAzureMonitorAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = disableAzureMonitorWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1240,7 +1369,8 @@ public SyncPoller, Void> beginDisableAzureMonitor(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableAzureMonitor(String resourceGroupName, String clusterName, Context context) { - return this.beginDisableAzureMonitorAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = disableAzureMonitorWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1259,23 +1389,6 @@ private Mono disableAzureMonitorAsync(String resourceGroupName, String clu .flatMap(this.client::getLroFinalResultOrError); } - /** - * Disables the Azure Monitor on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 disableAzureMonitorAsync(String resourceGroupName, String clusterName, Context context) { - return beginDisableAzureMonitorAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Disables the Azure Monitor on the HDInsight cluster. * @@ -1287,7 +1400,7 @@ private Mono disableAzureMonitorAsync(String resourceGroupName, String clu */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableAzureMonitor(String resourceGroupName, String clusterName) { - disableAzureMonitorAsync(resourceGroupName, clusterName).block(); + beginDisableAzureMonitor(resourceGroupName, clusterName).getFinalResult(); } /** @@ -1302,7 +1415,7 @@ public void disableAzureMonitor(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableAzureMonitor(String resourceGroupName, String clusterName, Context context) { - disableAzureMonitorAsync(resourceGroupName, clusterName, context).block(); + beginDisableAzureMonitor(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -1353,39 +1466,41 @@ private Mono>> enableAzureMonitorAgentWithResponseAsyn * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enableAzureMonitorAgentWithResponseAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters, Context context) { + private Response enableAzureMonitorAgentWithResponse(String resourceGroupName, String clusterName, + AzureMonitorRequest parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.enableAzureMonitorAgent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); + return service.enableAzureMonitorAgentSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -1394,18 +1509,42 @@ private Mono>> enableAzureMonitorAgentWithResponseAsyn * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnableAzureMonitorAgentAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters) { - Mono>> mono - = enableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableAzureMonitorAgentWithResponse(String resourceGroupName, String clusterName, + AzureMonitorRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.enableAzureMonitorAgentSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -1414,7 +1553,6 @@ private PollerFlux, Void> beginEnableAzureMonitorAgentAsync(Str * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1422,12 +1560,11 @@ private PollerFlux, Void> beginEnableAzureMonitorAgentAsync(Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginEnableAzureMonitorAgentAsync(String resourceGroupName, - String clusterName, AzureMonitorRequest parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, AzureMonitorRequest parameters) { Mono>> mono - = enableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = enableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1444,7 +1581,8 @@ private PollerFlux, Void> beginEnableAzureMonitorAgentAsync(Str @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableAzureMonitorAgent(String resourceGroupName, String clusterName, AzureMonitorRequest parameters) { - return this.beginEnableAzureMonitorAgentAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = enableAzureMonitorAgentWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1462,8 +1600,9 @@ public SyncPoller, Void> beginEnableAzureMonitorAgent(String re @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginEnableAzureMonitorAgent(String resourceGroupName, String clusterName, AzureMonitorRequest parameters, Context context) { - return this.beginEnableAzureMonitorAgentAsync(resourceGroupName, clusterName, parameters, context) - .getSyncPoller(); + Response response + = enableAzureMonitorAgentWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1484,25 +1623,6 @@ private Mono enableAzureMonitorAgentAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Enables the Azure Monitor Agent on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param parameters The Log Analytics workspace parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enableAzureMonitorAgentAsync(String resourceGroupName, String clusterName, - AzureMonitorRequest parameters, Context context) { - return beginEnableAzureMonitorAgentAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Enables the Azure Monitor Agent on the HDInsight cluster. * @@ -1515,7 +1635,7 @@ private Mono enableAzureMonitorAgentAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public void enableAzureMonitorAgent(String resourceGroupName, String clusterName, AzureMonitorRequest parameters) { - enableAzureMonitorAgentAsync(resourceGroupName, clusterName, parameters).block(); + beginEnableAzureMonitorAgent(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -1532,7 +1652,7 @@ public void enableAzureMonitorAgent(String resourceGroupName, String clusterName @ServiceMethod(returns = ReturnType.SINGLE) public void enableAzureMonitorAgent(String resourceGroupName, String clusterName, AzureMonitorRequest parameters, Context context) { - enableAzureMonitorAgentAsync(resourceGroupName, clusterName, parameters, context).block(); + beginEnableAzureMonitorAgent(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -1572,42 +1692,6 @@ public void enableAzureMonitorAgent(String resourceGroupName, String clusterName .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the status of Azure Monitor Agent on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Azure Monitor Agent on the HDInsight cluster along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getAzureMonitorAgentStatusWithResponseAsync(String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureMonitorAgentStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); - } - /** * Gets the status of Azure Monitor Agent on the HDInsight cluster. * @@ -1639,7 +1723,27 @@ private Mono getAzureMonitorAgentStatusAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureMonitorAgentStatusWithResponse(String resourceGroupName, String clusterName, Context context) { - return getAzureMonitorAgentStatusWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureMonitorAgentStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -1698,34 +1802,34 @@ private Mono>> disableAzureMonitorAgentWithResponseAsy * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> disableAzureMonitorAgentWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { + private Response disableAzureMonitorAgentWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.disableAzureMonitorAgent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); + return service.disableAzureMonitorAgentSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -1733,18 +1837,36 @@ private Mono>> disableAzureMonitorAgentWithResponseAsy * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDisableAzureMonitorAgentAsync(String resourceGroupName, - String clusterName) { - Mono>> mono - = disableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableAzureMonitorAgentWithResponse(String resourceGroupName, String clusterName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.disableAzureMonitorAgentSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), accept, context); } /** @@ -1752,7 +1874,6 @@ private PollerFlux, Void> beginDisableAzureMonitorAgentAsync(St * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1760,12 +1881,11 @@ private PollerFlux, Void> beginDisableAzureMonitorAgentAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDisableAzureMonitorAgentAsync(String resourceGroupName, - String clusterName, Context context) { - context = this.client.mergeContext(context); + String clusterName) { Mono>> mono - = disableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName, context); + = disableAzureMonitorAgentWithResponseAsync(resourceGroupName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1781,7 +1901,8 @@ private PollerFlux, Void> beginDisableAzureMonitorAgentAsync(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableAzureMonitorAgent(String resourceGroupName, String clusterName) { - return this.beginDisableAzureMonitorAgentAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = disableAzureMonitorAgentWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1798,7 +1919,8 @@ public SyncPoller, Void> beginDisableAzureMonitorAgent(String r @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDisableAzureMonitorAgent(String resourceGroupName, String clusterName, Context context) { - return this.beginDisableAzureMonitorAgentAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = disableAzureMonitorAgentWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1817,23 +1939,6 @@ private Mono disableAzureMonitorAgentAsync(String resourceGroupName, Strin .flatMap(this.client::getLroFinalResultOrError); } - /** - * Disables the Azure Monitor Agent on the HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 disableAzureMonitorAgentAsync(String resourceGroupName, String clusterName, Context context) { - return beginDisableAzureMonitorAgentAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Disables the Azure Monitor Agent on the HDInsight cluster. * @@ -1845,7 +1950,7 @@ private Mono disableAzureMonitorAgentAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableAzureMonitorAgent(String resourceGroupName, String clusterName) { - disableAzureMonitorAgentAsync(resourceGroupName, clusterName).block(); + beginDisableAzureMonitorAgent(resourceGroupName, clusterName).getFinalResult(); } /** @@ -1860,7 +1965,7 @@ public void disableAzureMonitorAgent(String resourceGroupName, String clusterNam */ @ServiceMethod(returns = ReturnType.SINGLE) public void disableAzureMonitorAgent(String resourceGroupName, String clusterName, Context context) { - disableAzureMonitorAgentAsync(resourceGroupName, clusterName, context).block(); + beginDisableAzureMonitorAgent(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -1916,42 +2021,45 @@ private Mono>> createWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. * @param parameters The cluster extensions create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, - String extensionName, Extension parameters, Context context) { + private Response createWithResponse(String resourceGroupName, String clusterName, String extensionName, + Extension parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, extensionName, this.client.getApiVersion(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, extensionName, this.client.getApiVersion(), parameters, accept, Context.NONE); } /** @@ -1961,18 +2069,46 @@ private Mono>> createWithResponseAsync(String resource * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. * @param parameters The cluster extensions create request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCreateAsync(String resourceGroupName, String clusterName, - String extensionName, Extension parameters) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, clusterName, extensionName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String clusterName, String extensionName, + Extension parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, extensionName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -1982,7 +2118,6 @@ private PollerFlux, Void> beginCreateAsync(String resourceGroup * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. * @param parameters The cluster extensions create request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1990,12 +2125,11 @@ private PollerFlux, Void> beginCreateAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateAsync(String resourceGroupName, String clusterName, - String extensionName, Extension parameters, Context context) { - context = this.client.mergeContext(context); + String extensionName, Extension parameters) { Mono>> mono - = createWithResponseAsync(resourceGroupName, clusterName, extensionName, parameters, context); + = createWithResponseAsync(resourceGroupName, clusterName, extensionName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -2013,7 +2147,8 @@ private PollerFlux, Void> beginCreateAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreate(String resourceGroupName, String clusterName, String extensionName, Extension parameters) { - return this.beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters).getSyncPoller(); + Response response = createWithResponse(resourceGroupName, clusterName, extensionName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2032,8 +2167,9 @@ public SyncPoller, Void> beginCreate(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreate(String resourceGroupName, String clusterName, String extensionName, Extension parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters, context) - .getSyncPoller(); + Response response + = createWithResponse(resourceGroupName, clusterName, extensionName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2055,26 +2191,6 @@ private Mono createAsync(String resourceGroupName, String clusterName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Creates an HDInsight cluster extension. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param extensionName The name of the cluster extension. - * @param parameters The cluster extensions create request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 createAsync(String resourceGroupName, String clusterName, String extensionName, - Extension parameters, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Creates an HDInsight cluster extension. * @@ -2088,7 +2204,7 @@ private Mono createAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void create(String resourceGroupName, String clusterName, String extensionName, Extension parameters) { - createAsync(resourceGroupName, clusterName, extensionName, parameters).block(); + beginCreate(resourceGroupName, clusterName, extensionName, parameters).getFinalResult(); } /** @@ -2106,7 +2222,7 @@ public void create(String resourceGroupName, String clusterName, String extensio @ServiceMethod(returns = ReturnType.SINGLE) public void create(String resourceGroupName, String clusterName, String extensionName, Extension parameters, Context context) { - createAsync(resourceGroupName, clusterName, extensionName, parameters, context).block(); + beginCreate(resourceGroupName, clusterName, extensionName, parameters, context).getFinalResult(); } /** @@ -2149,46 +2265,6 @@ private Mono> getWithResponseAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the extension properties for the specified HDInsight cluster extension. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param extensionName The name of the cluster extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the extension properties for the specified HDInsight cluster extension along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String clusterName, String extensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - extensionName, this.client.getApiVersion(), accept, context); - } - /** * Gets the extension properties for the specified HDInsight cluster extension. * @@ -2223,7 +2299,31 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, extensionName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, extensionName, this.client.getApiVersion(), accept, context); } /** @@ -2287,37 +2387,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String extensionName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String extensionName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, extensionName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, extensionName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -2326,17 +2428,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String extensionName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, extensionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, String extensionName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, extensionName, this.client.getApiVersion(), accept, context); } /** @@ -2345,7 +2470,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param extensionName The name of the cluster extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2353,12 +2477,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String extensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, extensionName, context); + String extensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, extensionName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -2375,7 +2497,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String extensionName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, extensionName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, extensionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2393,7 +2516,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String extensionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, extensionName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, extensionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2413,25 +2537,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes the specified extension for HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param extensionName The name of the cluster extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String extensionName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, extensionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes the specified extension for HDInsight cluster. * @@ -2444,7 +2549,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String extensionName) { - deleteAsync(resourceGroupName, clusterName, extensionName).block(); + beginDelete(resourceGroupName, clusterName, extensionName).getFinalResult(); } /** @@ -2460,7 +2565,7 @@ public void delete(String resourceGroupName, String clusterName, String extensio */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String extensionName, Context context) { - deleteAsync(resourceGroupName, clusterName, extensionName, context).block(); + beginDelete(resourceGroupName, clusterName, extensionName, context).getFinalResult(); } /** @@ -2507,49 +2612,6 @@ private Mono> getAzureAsyncOperationStatusWi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the async operation status. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param extensionName The name of the cluster extension. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAzureAsyncOperationStatusWithResponseAsync( - String resourceGroupName, String clusterName, String extensionName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, extensionName, this.client.getApiVersion(), operationId, accept, context); - } - /** * Gets the async operation status. * @@ -2585,8 +2647,35 @@ private Mono getAzureAsyncOperationStatusAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureAsyncOperationStatusWithResponse(String resourceGroupName, String clusterName, String extensionName, String operationId, Context context) { - return getAzureAsyncOperationStatusWithResponseAsync(resourceGroupName, clusterName, extensionName, operationId, - context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, extensionName, this.client.getApiVersion(), operationId, accept, context); } /** @@ -2607,4 +2696,6 @@ public AsyncOperationResultInner getAzureAsyncOperationStatus(String resourceGro return getAzureAsyncOperationStatusWithResponse(resourceGroupName, clusterName, extensionName, operationId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(ExtensionsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java index e6d499545b9e..621a0d8e5821 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.hdinsight.implementation; import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import com.azure.resourcemanager.hdinsight.models.EntraUserInfo; import com.azure.resourcemanager.hdinsight.models.GatewaySettings; +import java.util.Collections; +import java.util.List; public final class GatewaySettingsImpl implements GatewaySettings { private GatewaySettingsInner innerObject; @@ -30,6 +33,15 @@ public String password() { return this.innerModel().password(); } + public List restAuthEntraUsers() { + List inner = this.innerModel().restAuthEntraUsers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public GatewaySettingsInner innerModel() { return this.innerObject; } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java index cabbc74d7e56..3e579414a66d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java @@ -13,14 +13,17 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hdinsight.fluent.ApplicationsClient; @@ -307,7 +310,7 @@ public VirtualMachinesClient getVirtualMachines() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-08-01-preview"; + this.apiVersion = "2025-01-15-preview"; this.applications = new ApplicationsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); @@ -358,6 +361,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java index 788d74f63db7..9cef1beb00a2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.LocationsClient; import com.azure.resourcemanager.hdinsight.fluent.models.AsyncOperationResultInner; import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; @@ -74,6 +75,14 @@ Mono> getCapabilities(@HostParam("$host") Stri @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getCapabilitiesSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") @ExpectedResponses({ 200 }) @@ -82,6 +91,14 @@ Mono> listUsages(@HostParam("$host") String endp @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listUsagesSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs") @ExpectedResponses({ 200 }) @@ -90,6 +107,14 @@ Mono> listBillingSpecs(@HostParam("$hos @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBillingSpecsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/azureasyncoperations/{operationId}") @ExpectedResponses({ 200 }) @@ -99,6 +124,15 @@ Mono> getAzureAsyncOperationStatus(@HostPara @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/azureasyncoperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAzureAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability") @ExpectedResponses({ 200 }) @@ -109,6 +143,16 @@ Mono> checkNameAvailability(@HostPara @BodyParam("application/json") NameAvailabilityCheckRequestParameters parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NameAvailabilityCheckRequestParameters parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/validateCreateRequest") @ExpectedResponses({ 200 }) @@ -118,6 +162,16 @@ Mono> validateClusterCreateRequest( @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ClusterCreateRequestValidationParameters parameters, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/validateCreateRequest") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateClusterCreateRequestSync( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterCreateRequestValidationParameters parameters, + @HeaderParam("Accept") String accept, Context context); } /** @@ -150,36 +204,6 @@ private Mono> getCapabilitiesWithResponseAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the capabilities for the specified location. - * - * @param location The Azure location (region) for which to make the request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the capabilities for the specified location along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCapabilitiesWithResponseAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getCapabilities(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context); - } - /** * Gets the capabilities for the specified location. * @@ -206,7 +230,23 @@ private Mono getCapabilitiesAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getCapabilitiesWithResponse(String location, Context context) { - return getCapabilitiesWithResponseAsync(location, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getCapabilitiesSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context); } /** @@ -253,36 +293,6 @@ private Mono> listUsagesWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the usages for the specified location. - * - * @param location The Azure location (region) for which to make the request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response for the operation to get regional usages for a subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesWithResponseAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context); - } - /** * Lists the usages for the specified location. * @@ -310,7 +320,23 @@ private Mono listUsagesAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listUsagesWithResponse(String location, Context context) { - return listUsagesWithResponseAsync(location, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listUsagesSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context); } /** @@ -357,37 +383,6 @@ private Mono> listBillingSpecsWithRespo .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the billingSpecs for the specified subscription and location. - * - * @param location The Azure location (region) for which to make the request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response for the operation to get regional billingSpecs for a subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBillingSpecsWithResponseAsync(String location, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBillingSpecs(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context); - } - /** * Lists the billingSpecs for the specified subscription and location. * @@ -416,7 +411,23 @@ private Mono listBillingSpecsAsync(String locati */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listBillingSpecsWithResponse(String location, Context context) { - return listBillingSpecsWithResponseAsync(location, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listBillingSpecsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), accept, context); } /** @@ -467,40 +478,6 @@ private Mono> getAzureAsyncOperationStatusWi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the async operation status. - * - * @param location The Azure location (region) for which to make the request. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAzureAsyncOperationStatusWithResponseAsync(String location, - String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAzureAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - location, this.client.getApiVersion(), operationId, accept, context); - } - /** * Get the async operation status. * @@ -531,7 +508,27 @@ private Mono getAzureAsyncOperationStatusAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response getAzureAsyncOperationStatusWithResponse(String location, String operationId, Context context) { - return getAzureAsyncOperationStatusWithResponseAsync(location, operationId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAzureAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), operationId, accept, context); } /** @@ -586,43 +583,6 @@ private Mono> checkNameAvailabilityWi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Check the cluster name is available or not. - * - * @param location The Azure location (region) for which to make the request. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response spec of checking name availability along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(String location, - NameAvailabilityCheckRequestParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), parameters, accept, context); - } - /** * Check the cluster name is available or not. * @@ -654,7 +614,29 @@ private Mono checkNameAvailabilityAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse(String location, NameAvailabilityCheckRequestParameters parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), parameters, accept, context); } /** @@ -710,43 +692,6 @@ private Mono> validateClusterCreate .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Validate the cluster create request spec is valid or not. - * - * @param location The Azure location (region) for which to make the request. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of cluster create request validation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateClusterCreateRequestWithResponseAsync( - String location, ClusterCreateRequestValidationParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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.validateClusterCreateRequest(this.client.getEndpoint(), this.client.getSubscriptionId(), - location, this.client.getApiVersion(), parameters, accept, context); - } - /** * Validate the cluster create request spec is valid or not. * @@ -778,7 +723,29 @@ private Mono validateClusterCreateRequestAsy @ServiceMethod(returns = ReturnType.SINGLE) public Response validateClusterCreateRequestWithResponse(String location, ClusterCreateRequestValidationParameters parameters, Context context) { - return validateClusterCreateRequestWithResponseAsync(location, parameters, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.validateClusterCreateRequestSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), parameters, accept, context); } /** @@ -796,4 +763,6 @@ public ClusterCreateValidationResultInner validateClusterCreateRequest(String lo ClusterCreateRequestValidationParameters parameters) { return validateClusterCreateRequestWithResponse(location, parameters, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(LocationsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java index e1cc7b2da1dd..c203ebb6ee8d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.OperationsClient; import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; import com.azure.resourcemanager.hdinsight.models.OperationListResult; @@ -69,12 +70,26 @@ public interface OperationsService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.HDInsight/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -103,24 +118,13 @@ private Mono> listSinglePageAsync() { /** * Lists all of the available HDInsight REST API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list HDInsight operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list HDInsight operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,11 +132,20 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list HDInsight operations as paginated response with {@link PagedFlux}. + * @return result of the request to list HDInsight operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -142,12 +155,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list HDInsight operations as paginated response with {@link PagedFlux}. + * @return result of the request to list HDInsight operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -159,7 +180,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -173,7 +194,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -202,6 +223,33 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,22 +258,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list HDInsight operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list HDInsight operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateEndpointConnectionsClientImpl.java index c7302916e585..47118bcb0130 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateEndpointConnectionsClientImpl.java @@ -27,8 +27,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.PrivateEndpointConnectionsClient; @@ -79,6 +81,15 @@ Mono> listByCluster(@HostParam("$h @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 201 }) @@ -91,6 +102,18 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") PrivateEndpointConnectionInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @@ -102,6 +125,17 @@ Mono> get(@HostParam("$host") String en @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @@ -113,6 +147,17 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -120,6 +165,14 @@ Mono>> delete(@HostParam("$host") String endpoint, Mono> listByClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -165,38 +218,15 @@ private Mono> listByClusterSingleP * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list private endpoint connections response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the list private endpoint connections response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** @@ -207,12 +237,35 @@ private Mono> listByClusterSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list private endpoint connections response as paginated response with {@link PagedFlux}. + * @return the list private endpoint connections response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -224,13 +277,35 @@ private PagedFlux listByClusterAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list private endpoint connections response as paginated response with {@link PagedFlux}. + * @return the list private endpoint connections response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, - Context context) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -245,7 +320,8 @@ private PagedFlux listByClusterAsync(String reso */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); } /** @@ -262,7 +338,8 @@ public PagedIterable listByCluster(String resour @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); } /** @@ -319,44 +396,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param parameters The private endpoint connection create or update request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return the private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, - Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(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.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, privateEndpointConnectionName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateEndpointConnectionName, parameters, accept, Context.NONE); } /** @@ -366,20 +445,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param parameters The private endpoint connection create or update request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 the private endpoint connection. + * @return the private endpoint connection along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, - privateEndpointConnectionName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateEndpointConnectionName, parameters, accept, context); } /** @@ -389,7 +495,6 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param parameters The private endpoint connection create or update request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -398,13 +503,12 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, Context context) { - context = this.client.mergeContext(context); + PrivateEndpointConnectionInner parameters) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, - privateEndpointConnectionName, parameters, context); + privateEndpointConnectionName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - context); + this.client.getContext()); } /** @@ -423,8 +527,10 @@ private Mono>> createOrUpdateWithResponseAsync(String public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, parameters); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); } /** @@ -444,10 +550,10 @@ public SyncPoller, PrivateEndpointCon public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters, - context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, + privateEndpointConnectionName, parameters, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); } /** @@ -470,26 +576,6 @@ private Mono createOrUpdateAsync(String resource .flatMap(this.client::getLroFinalResultOrError); } - /** - * Approve or reject a private endpoint connection manually. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters The private endpoint connection create or update request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Approve or reject a private endpoint connection manually. * @@ -505,7 +591,8 @@ private Mono createOrUpdateAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, privateEndpointConnectionName, parameters) + .getFinalResult(); } /** @@ -524,8 +611,8 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context) + .getFinalResult(); } /** @@ -570,47 +657,6 @@ private Mono> getWithResponseAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specific private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific private endpoint connection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String clusterName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, privateEndpointConnectionName, accept, context); - } - /** * Gets the specific private endpoint connection. * @@ -644,7 +690,32 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateEndpointConnectionName, accept, context); } /** @@ -711,38 +782,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String privateEndpointConnectionName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, privateEndpointConnectionName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateEndpointConnectionName, accept, Context.NONE); } /** @@ -751,18 +824,41 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateEndpointConnectionName, accept, context); } /** @@ -771,7 +867,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -779,12 +874,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); + String privateEndpointConnectionName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -801,7 +895,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -819,8 +915,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -840,25 +937,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes the specific private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes the specific private endpoint connection. * @@ -871,7 +949,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName).block(); + beginDelete(resourceGroupName, clusterName, privateEndpointConnectionName).getFinalResult(); } /** @@ -888,7 +966,7 @@ public void delete(String resourceGroupName, String clusterName, String privateE @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - deleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + beginDelete(resourceGroupName, clusterName, privateEndpointConnectionName, context).getFinalResult(); } /** @@ -918,6 +996,33 @@ private Mono> listByClusterNextSin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list private endpoint connections response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -926,23 +1031,26 @@ private Mono> listByClusterNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list private endpoint connections response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the list private endpoint connections response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink, + private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateLinkResourcesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateLinkResourcesClientImpl.java index 79a176c3e827..f4c323bb263b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/PrivateLinkResourcesClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceListResultInner; @@ -67,6 +68,15 @@ Mono> listByCluster(@HostParam("$ho @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}") @ExpectedResponses({ 200 }) @@ -77,6 +87,17 @@ Mono> get(@HostParam("$host") String endpoint @PathParam("clusterName") String clusterName, @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); } /** @@ -114,41 +135,6 @@ private Mono> listByClusterWithResp .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the private link resources in a HDInsight cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, accept, context); - } - /** * Lists the private link resources in a HDInsight cluster. * @@ -179,7 +165,27 @@ private Mono listByClusterAsync(String resou @ServiceMethod(returns = ReturnType.SINGLE) public Response listByClusterWithResponse(String resourceGroupName, String clusterName, Context context) { - return listByClusterWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, accept, context); } /** @@ -237,46 +243,6 @@ private Mono> getWithResponseAsync(String res .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specific private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param privateLinkResourceName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific private link resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, - String privateLinkResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (privateLinkResourceName == null) { - return Mono.error( - new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), clusterName, privateLinkResourceName, accept, context); - } - /** * Gets the specific private link resource. * @@ -310,7 +276,31 @@ private Mono getAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String privateLinkResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, privateLinkResourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterName, privateLinkResourceName, accept, context); } /** @@ -328,4 +318,6 @@ public Response getWithResponse(String resourceGroupNa public PrivateLinkResourceInner get(String resourceGroupName, String clusterName, String privateLinkResourceName) { return getWithResponse(resourceGroupName, clusterName, privateLinkResourceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java index 66043502cf17..b39b4d5262b5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java @@ -26,6 +26,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.ScriptActionsClient; import com.azure.resourcemanager.hdinsight.fluent.models.AsyncOperationResultInner; import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; @@ -74,6 +75,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("scriptName") String scriptName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("scriptName") String scriptName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") @ExpectedResponses({ 200 }) @@ -83,6 +94,15 @@ Mono> listByCluster(@HostParam("$host") String endpo @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") @ExpectedResponses({ 200 }) @@ -93,6 +113,16 @@ Mono> getExecutionDetail(@HostParam("$h @PathParam("scriptExecutionId") String scriptExecutionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getExecutionDetailSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("scriptExecutionId") String scriptExecutionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions/azureasyncoperations/{operationId}") @ExpectedResponses({ 200 }) @@ -103,6 +133,16 @@ Mono> getExecutionAsyncOperationStatus(@Host @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions/azureasyncoperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getExecutionAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -110,6 +150,14 @@ Mono> getExecutionAsyncOperationStatus(@Host Mono> listByClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -151,45 +199,6 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a specified persisted script action of the cluster. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param scriptName The name of the script. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String scriptName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (scriptName == null) { - return Mono.error(new IllegalArgumentException("Parameter scriptName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, scriptName, this.client.getApiVersion(), accept, context); - } - /** * Deletes a specified persisted script action of the cluster. * @@ -221,7 +230,31 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String clusterName, String scriptName, Context context) { - return deleteWithResponseAsync(resourceGroupName, clusterName, scriptName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, scriptName, this.client.getApiVersion(), accept, context); } /** @@ -282,38 +315,15 @@ private Mono> listByClusterSingleP * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the persisted script action for the cluster along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the persisted script action for the cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** @@ -324,12 +334,35 @@ private Mono> listByClusterSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the persisted script action for the cluster as paginated response with {@link PagedFlux}. + * @return the persisted script action for the cluster along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -341,13 +374,35 @@ private PagedFlux listByClusterAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the persisted script action for the cluster as paginated response with {@link PagedFlux}. + * @return the persisted script action for the cluster along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, - Context context) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -362,7 +417,8 @@ private PagedFlux listByClusterAsync(String reso */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); } /** @@ -379,7 +435,8 @@ public PagedIterable listByCluster(String resour @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); } /** @@ -424,47 +481,6 @@ private Mono> getExecutionDetailWithRes .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the script execution detail for the given script execution ID. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param scriptExecutionId The script execution Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the script execution detail for the given script execution ID along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionDetailWithResponseAsync(String resourceGroupName, - String clusterName, String scriptExecutionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (scriptExecutionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getExecutionDetail(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, scriptExecutionId, this.client.getApiVersion(), accept, context); - } - /** * Gets the script execution detail for the given script execution ID. * @@ -498,7 +514,31 @@ private Mono getExecutionDetailAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) public Response getExecutionDetailWithResponse(String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { - return getExecutionDetailWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getExecutionDetailSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, scriptExecutionId, this.client.getApiVersion(), accept, context); } /** @@ -560,46 +600,6 @@ private Mono> getExecutionAsyncOperationStat .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the async operation status of execution operation. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operation status of execution operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionAsyncOperationStatusWithResponseAsync( - String resourceGroupName, String clusterName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getExecutionAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); - } - /** * Gets the async operation status of execution operation. * @@ -633,8 +633,31 @@ private Mono getExecutionAsyncOperationStatusAsync(St @ServiceMethod(returns = ReturnType.SINGLE) public Response getExecutionAsyncOperationStatusWithResponse(String resourceGroupName, String clusterName, String operationId, Context context) { - return getExecutionAsyncOperationStatusWithResponseAsync(resourceGroupName, clusterName, operationId, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getExecutionAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); } /** @@ -682,6 +705,33 @@ private Mono> listByClusterNextSin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -690,23 +740,26 @@ private Mono> listByClusterNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the persisted script action for the cluster along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the persisted script action for the cluster along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink, + private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptActionsClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java index 301f485df0b8..fbca521a9402 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java @@ -26,6 +26,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hdinsight.fluent.ScriptExecutionHistoriesClient; import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionHistoryList; @@ -72,6 +73,15 @@ Mono> listByCluster(@HostParam("$host @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") @ExpectedResponses({ 200 }) @@ -82,6 +92,16 @@ Mono> promote(@HostParam("$host") String endpoint, @PathParam("scriptExecutionId") String scriptExecutionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response promoteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("scriptExecutionId") String scriptExecutionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -89,6 +109,14 @@ Mono> promote(@HostParam("$host") String endpoint, Mono> listByClusterNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -134,38 +162,15 @@ private Mono> listByClusterSingleP * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list script execution history response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list script execution history response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** @@ -176,12 +181,35 @@ private Mono> listByClusterSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list script execution history response as paginated response with {@link PagedFlux}. + * @return the list script execution history response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -193,13 +221,35 @@ private PagedFlux listByClusterAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list script execution history response as paginated response with {@link PagedFlux}. + * @return the list script execution history response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, - Context context) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterSinglePage(String resourceGroupName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -214,7 +264,8 @@ private PagedFlux listByClusterAsync(String reso */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); } /** @@ -231,7 +282,8 @@ public PagedIterable listByCluster(String resour @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); } /** @@ -274,46 +326,6 @@ private Mono> promoteWithResponseAsync(String resourceGroupName, .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Promotes the specified ad-hoc script execution to a persisted script. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param scriptExecutionId The script execution Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> promoteWithResponseAsync(String resourceGroupName, String clusterName, - String scriptExecutionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (scriptExecutionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.promote(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, scriptExecutionId, this.client.getApiVersion(), accept, context); - } - /** * Promotes the specified ad-hoc script execution to a persisted script. * @@ -346,7 +358,31 @@ private Mono promoteAsync(String resourceGroupName, String clusterName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response promoteWithResponse(String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { - return promoteWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.promoteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, scriptExecutionId, this.client.getApiVersion(), accept, context); } /** @@ -391,6 +427,33 @@ private Mono> listByClusterNextSin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -399,23 +462,26 @@ private Mono> listByClusterNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list script execution history response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list script execution history response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterNextSinglePageAsync(String nextLink, + private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionHistoriesClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java index 88160d61f824..1e5f864d494f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java @@ -22,8 +22,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hdinsight.fluent.VirtualMachinesClient; @@ -75,6 +77,15 @@ Mono>> listHosts(@HostParam("$host") String endpoin @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/listHosts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> listHostsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts") @ExpectedResponses({ 200, 202 }) @@ -85,6 +96,16 @@ Mono>> restartHosts(@HostParam("$host") String endpoin @QueryParam("api-version") String apiVersion, @BodyParam("application/json") List hosts, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restartHostsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") List hosts, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts/azureasyncoperations/{operationId}") @ExpectedResponses({ 200 }) @@ -94,6 +115,16 @@ Mono> getAsyncOperationStatus(@HostParam("$h @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts/azureasyncoperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAsyncOperationStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -132,42 +163,6 @@ private Mono>> listHostsWithResponseAsync(String re .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the HDInsight clusters hosts. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list cluster hosts along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listHostsWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listHosts(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); - } - /** * Lists the HDInsight clusters hosts. * @@ -198,7 +193,27 @@ private Mono> listHostsAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response> listHostsWithResponse(String resourceGroupName, String clusterName, Context context) { - return listHostsWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listHostsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), accept, context); } /** @@ -261,37 +276,38 @@ private Mono>> restartHostsWithResponseAsync(String re * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param hosts The list of hosts to restart. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartHostsWithResponseAsync(String resourceGroupName, String clusterName, - List hosts, Context context) { + private Response restartHostsWithResponse(String resourceGroupName, String clusterName, + List hosts) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (hosts == null) { - return Mono.error(new IllegalArgumentException("Parameter hosts is required and cannot be null.")); + throw LOGGER.atError().log(new IllegalArgumentException("Parameter hosts is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restartHosts(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), hosts, accept, context); + return service.restartHostsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), hosts, accept, Context.NONE); } /** @@ -300,17 +316,39 @@ private Mono>> restartHostsWithResponseAsync(String re * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param hosts The list of hosts to restart. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartHostsAsync(String resourceGroupName, String clusterName, - List hosts) { - Mono>> mono = restartHostsWithResponseAsync(resourceGroupName, clusterName, hosts); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response restartHostsWithResponse(String resourceGroupName, String clusterName, + List hosts, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hosts == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter hosts is required and cannot be null.")); + } + final String accept = "application/json"; + return service.restartHostsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + clusterName, this.client.getApiVersion(), hosts, accept, context); } /** @@ -319,7 +357,6 @@ private PollerFlux, Void> beginRestartHostsAsync(String resourc * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param hosts The list of hosts to restart. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -327,12 +364,10 @@ private PollerFlux, Void> beginRestartHostsAsync(String resourc */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartHostsAsync(String resourceGroupName, String clusterName, - List hosts, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = restartHostsWithResponseAsync(resourceGroupName, clusterName, hosts, context); + List hosts) { + Mono>> mono = restartHostsWithResponseAsync(resourceGroupName, clusterName, hosts); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -349,7 +384,8 @@ private PollerFlux, Void> beginRestartHostsAsync(String resourc @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestartHosts(String resourceGroupName, String clusterName, List hosts) { - return this.beginRestartHostsAsync(resourceGroupName, clusterName, hosts).getSyncPoller(); + Response response = restartHostsWithResponse(resourceGroupName, clusterName, hosts); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -367,7 +403,8 @@ public SyncPoller, Void> beginRestartHosts(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestartHosts(String resourceGroupName, String clusterName, List hosts, Context context) { - return this.beginRestartHostsAsync(resourceGroupName, clusterName, hosts, context).getSyncPoller(); + Response response = restartHostsWithResponse(resourceGroupName, clusterName, hosts, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -387,25 +424,6 @@ private Mono restartHostsAsync(String resourceGroupName, String clusterNam .flatMap(this.client::getLroFinalResultOrError); } - /** - * Restarts the specified HDInsight cluster hosts. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param hosts The list of hosts to restart. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartHostsAsync(String resourceGroupName, String clusterName, List hosts, - Context context) { - return beginRestartHostsAsync(resourceGroupName, clusterName, hosts, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Restarts the specified HDInsight cluster hosts. * @@ -418,7 +436,7 @@ private Mono restartHostsAsync(String resourceGroupName, String clusterNam */ @ServiceMethod(returns = ReturnType.SINGLE) public void restartHosts(String resourceGroupName, String clusterName, List hosts) { - restartHostsAsync(resourceGroupName, clusterName, hosts).block(); + beginRestartHosts(resourceGroupName, clusterName, hosts).getFinalResult(); } /** @@ -434,7 +452,7 @@ public void restartHosts(String resourceGroupName, String clusterName, List hosts, Context context) { - restartHostsAsync(resourceGroupName, clusterName, hosts, context).block(); + beginRestartHosts(resourceGroupName, clusterName, hosts, context).getFinalResult(); } /** @@ -477,45 +495,6 @@ private Mono> getAsyncOperationStatusWithRes .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the async operation status. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster. - * @param operationId The long running operation id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the async operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAsyncOperationStatusWithResponseAsync(String resourceGroupName, - String clusterName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAsyncOperationStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); - } - /** * Gets the async operation status. * @@ -549,7 +528,31 @@ private Mono getAsyncOperationStatusAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) public Response getAsyncOperationStatusWithResponse(String resourceGroupName, String clusterName, String operationId, Context context) { - return getAsyncOperationStatusWithResponseAsync(resourceGroupName, clusterName, operationId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getAsyncOperationStatusSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, this.client.getApiVersion(), operationId, accept, context); } /** @@ -569,4 +572,6 @@ public AsyncOperationResultInner getAsyncOperationStatus(String resourceGroupNam return getAsyncOperationStatusWithResponse(resourceGroupName, clusterName, operationId, Context.NONE) .getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesClientImpl.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java index e94bd89d0358..71edfcbed411 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java @@ -289,9 +289,11 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: The identity of the cluster, if configured.. + * Specifies the identity property: The identity of the cluster, if configured. Setting this property will + * override the existing identity configuration of the cluster.. * - * @param identity The identity of the cluster, if configured. + * @param identity The identity of the cluster, if configured. Setting this property will override the + * existing identity configuration of the cluster. * @return the next definition stage. */ Update withIdentity(ClusterIdentity identity); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateRequestValidationParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateRequestValidationParameters.java index 3fca98cc0330..dba9dae13ed6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateRequestValidationParameters.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateRequestValidationParameters.java @@ -175,7 +175,12 @@ public ClusterCreateRequestValidationParameters withIdentity(ClusterIdentity ide */ @Override public void validate() { - super.validate(); + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } } /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java index 302e3adafb17..1928543be9f8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java @@ -141,7 +141,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("kind", this.kind); jsonWriter.writeMapField("componentVersion", this.componentVersion, (writer, element) -> writer.writeString(element)); - jsonWriter.writeUntypedField("configurations", this.configurations); + if (this.configurations != null) { + jsonWriter.writeUntypedField("configurations", this.configurations); + } return jsonWriter.writeEndObject(); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java index 66c02f87d781..b92d66c6c00b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java @@ -23,7 +23,8 @@ public final class ClusterPatchParameters implements JsonSerializable tags; /* - * The identity of the cluster, if configured. + * The identity of the cluster, if configured. Setting this property will override the existing identity + * configuration of the cluster. */ private ClusterIdentity identity; @@ -54,7 +55,8 @@ public ClusterPatchParameters withTags(Map tags) { } /** - * Get the identity property: The identity of the cluster, if configured. + * Get the identity property: The identity of the cluster, if configured. Setting this property will override the + * existing identity configuration of the cluster. * * @return the identity value. */ @@ -63,7 +65,8 @@ public ClusterIdentity identity() { } /** - * Set the identity property: The identity of the cluster, if configured. + * Set the identity property: The identity of the cluster, if configured. Setting this property will override the + * existing identity configuration of the cluster. * * @param identity the identity value to set. * @return the ClusterPatchParameters object itself. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EntraUserInfo.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EntraUserInfo.java new file mode 100644 index 000000000000..5b41e0de243f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EntraUserInfo.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of an Entra user for gateway access. + */ +@Fluent +public final class EntraUserInfo implements JsonSerializable { + /* + * The unique object ID of the Entra user or client ID of the enterprise applications. + */ + private String objectId; + + /* + * The display name of the Entra user. + */ + private String displayName; + + /* + * The User Principal Name (UPN) of the Entra user. It may be empty in certain cases, such as for enterprise + * applications. + */ + private String upn; + + /** + * Creates an instance of EntraUserInfo class. + */ + public EntraUserInfo() { + } + + /** + * Get the objectId property: The unique object ID of the Entra user or client ID of the enterprise applications. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The unique object ID of the Entra user or client ID of the enterprise applications. + * + * @param objectId the objectId value to set. + * @return the EntraUserInfo object itself. + */ + public EntraUserInfo withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the displayName property: The display name of the Entra user. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the Entra user. + * + * @param displayName the displayName value to set. + * @return the EntraUserInfo object itself. + */ + public EntraUserInfo withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the upn property: The User Principal Name (UPN) of the Entra user. It may be empty in certain cases, such as + * for enterprise applications. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Set the upn property: The User Principal Name (UPN) of the Entra user. It may be empty in certain cases, such as + * for enterprise applications. + * + * @param upn the upn value to set. + * @return the EntraUserInfo object itself. + */ + public EntraUserInfo withUpn(String upn) { + this.upn = upn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectId", this.objectId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("upn", this.upn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntraUserInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntraUserInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EntraUserInfo. + */ + public static EntraUserInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntraUserInfo deserializedEntraUserInfo = new EntraUserInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedEntraUserInfo.objectId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedEntraUserInfo.displayName = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedEntraUserInfo.upn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntraUserInfo; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java index 883a8a7c0d39..5cd14eef63d2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hdinsight.models; import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import java.util.List; /** * An immutable client-side representation of GatewaySettings. @@ -32,6 +33,13 @@ public interface GatewaySettings { */ String password(); + /** + * Gets the restAuthEntraUsers property: List of Entra users for gateway access. + * + * @return the restAuthEntraUsers value. + */ + List restAuthEntraUsers(); + /** * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner object. * diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java index 10a2044b96bf..1f6e68c56caa 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java @@ -10,9 +10,10 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** - * The update gateway settings request parameters. + * The update gateway settings request parameters. Note either basic or entra user should be provided at a time. */ @Fluent public final class UpdateGatewaySettingsParameters implements JsonSerializable { @@ -31,6 +32,11 @@ public final class UpdateGatewaySettingsParameters implements JsonSerializable restAuthEntraUsers; + /** * Creates an instance of UpdateGatewaySettingsParameters class. */ @@ -99,12 +105,35 @@ public UpdateGatewaySettingsParameters withPassword(String password) { return this; } + /** + * Get the restAuthEntraUsers property: List of Entra users for gateway access. + * + * @return the restAuthEntraUsers value. + */ + public List restAuthEntraUsers() { + return this.restAuthEntraUsers; + } + + /** + * Set the restAuthEntraUsers property: List of Entra users for gateway access. + * + * @param restAuthEntraUsers the restAuthEntraUsers value to set. + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withRestAuthEntraUsers(List restAuthEntraUsers) { + this.restAuthEntraUsers = restAuthEntraUsers; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (restAuthEntraUsers() != null) { + restAuthEntraUsers().forEach(e -> e.validate()); + } } /** @@ -116,6 +145,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("restAuthCredential.isEnabled", this.isCredentialEnabled); jsonWriter.writeStringField("restAuthCredential.username", this.username); jsonWriter.writeStringField("restAuthCredential.password", this.password); + jsonWriter.writeArrayField("restAuthEntraUsers", this.restAuthEntraUsers, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -142,6 +173,10 @@ public static UpdateGatewaySettingsParameters fromJson(JsonReader jsonReader) th deserializedUpdateGatewaySettingsParameters.username = reader.getString(); } else if ("restAuthCredential.password".equals(fieldName)) { deserializedUpdateGatewaySettingsParameters.password = reader.getString(); + } else if ("restAuthEntraUsers".equals(fieldName)) { + List restAuthEntraUsers + = reader.readArray(reader1 -> EntraUserInfo.fromJson(reader1)); + deserializedUpdateGatewaySettingsParameters.restAuthEntraUsers = restAuthEntraUsers; } else { reader.skipChildren(); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/resources/azure-resourcemanager-hdinsight.properties b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/resources/azure-resourcemanager-hdinsight.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/resources/azure-resourcemanager-hdinsight.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsCreateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsCreateSamples.java index be523a349601..c8825a704597 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsCreateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsCreateSamples.java @@ -18,7 +18,7 @@ public final class ApplicationsCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateApplication.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteSamples.java index 407f95ce3b35..eb722d26a406 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ApplicationsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DeleteApplication.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetAzureAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetAzureAsyncOperationStatusSamples.java index 5873b2596d2b..d9f3b7b39737 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetAzureAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetAzureAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class ApplicationsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetApplicationCreationAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetSamples.java index 87ef586a660d..099ffbaadc07 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsGetSamples.java @@ -10,7 +10,7 @@ public final class ApplicationsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetApplicationInProgress.json */ /** @@ -25,7 +25,7 @@ public static void getApplicationOnHDInsightClusterCreationInProgress( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetApplicationCreated.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsListByClusterSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsListByClusterSamples.java index 7b683dd0aae9..87f6cc0d8ceb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsListByClusterSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsListByClusterSamples.java @@ -10,7 +10,7 @@ public final class ApplicationsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetAllApplications.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersCreateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersCreateSamples.java index f7eef7340e65..38c87133cf14 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersCreateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersCreateSamples.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.hdinsight.models.ClientGroupInfo; import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; +import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; import com.azure.resourcemanager.hdinsight.models.ComputeIsolationProperties; import com.azure.resourcemanager.hdinsight.models.ComputeProfile; import com.azure.resourcemanager.hdinsight.models.DataDisksGroups; @@ -25,9 +26,10 @@ import com.azure.resourcemanager.hdinsight.models.KafkaRestProperties; import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; import com.azure.resourcemanager.hdinsight.models.NetworkProperties; -import com.azure.resourcemanager.hdinsight.models.OsProfile; import com.azure.resourcemanager.hdinsight.models.OSType; +import com.azure.resourcemanager.hdinsight.models.OsProfile; import com.azure.resourcemanager.hdinsight.models.PrivateLink; +import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; import com.azure.resourcemanager.hdinsight.models.ResourceProviderConnection; import com.azure.resourcemanager.hdinsight.models.Role; import com.azure.resourcemanager.hdinsight.models.SecurityProfile; @@ -36,6 +38,7 @@ import com.azure.resourcemanager.hdinsight.models.StorageAccount; import com.azure.resourcemanager.hdinsight.models.StorageProfile; import com.azure.resourcemanager.hdinsight.models.Tier; +import com.azure.resourcemanager.hdinsight.models.UserAssignedIdentity; import com.azure.resourcemanager.hdinsight.models.VirtualNetworkProfile; import java.io.IOException; import java.util.Arrays; @@ -48,7 +51,7 @@ public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateLinuxHadoopSshPassword.json */ /** @@ -103,7 +106,81 @@ public static void createHadoopOnLinuxClusterWithSSHPassword( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithADLSGen2Msi.json + */ + /** + * Sample code: Create cluster with storage ADLSGen2 + MSI. + * + * @param manager Entry point to HDInsightManager. + */ + public static void createClusterWithStorageADLSGen2MSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList(new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser").withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() + .withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withFileSystem("default") + .withResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage") + .withMsiResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"))))) + .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi", + new UserAssignedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateKafkaClusterWithKafkaRestProxy.json */ /** @@ -165,7 +242,7 @@ public static void createKafkaClusterWithKafkaRestProxy( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithAutoscaleConfig.json */ /** @@ -233,7 +310,7 @@ public static void createHDInsightClusterWithAutoscaleConfiguration( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateLinuxHadoopSshPublicKey.json */ /** @@ -293,7 +370,7 @@ public static void createHadoopOnLinuxClusterWithSSHPublicKey( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithAvailabilityZones.json */ /** @@ -350,7 +427,58 @@ public static void createClusterWithAvailabilityZones(com.azure.resourcemanager. /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithEntraUser.json + */ + /** + * Sample code: Create cluster with Entra User. + * + * @param manager Entry point to HDInsightManager. + */ + public static void createClusterWithEntraUser(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":false,\"restAuthEntraUsers\":[{\"displayName\":\"displayName\",\"objectId\":\"00000000-0000-0000-0000-000000000000\",\"upn\":\"user@microsoft.com\"}]}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList( + new Role().withName("headnode") + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("workernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))), + new Role().withName("zookeepernode") + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder")))))) + .withStorageProfile(new StorageProfile() + .withStorageaccounts(Arrays.asList(new StorageAccount().withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withKey("fakeTokenPlaceholder") + .withEnableSecureChannel(true))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateLinuxHadoopAdlsGen2.json */ /** @@ -405,7 +533,7 @@ public static void createHadoopClusterWithAzureDataLakeStorageGen2( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateLinuxHadoopSecureHadoop.json */ /** @@ -488,7 +616,81 @@ public static void createSecureHadoopCluster(com.azure.resourcemanager.hdinsight /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * CreateHDInsightClusterWithWasbMsi.json + */ + /** + * Sample code: Create cluster with storage WASB + MSI. + * + * @param manager Entry point to HDInsightManager. + */ + public static void createClusterWithStorageWASBMSI(com.azure.resourcemanager.hdinsight.HDInsightManager manager) + throws IOException { + manager.clusters() + .define("cluster1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterCreateProperties().withClusterVersion("5.1") + .withOsType(OSType.LINUX) + .withTier(Tier.STANDARD) + .withClusterDefinition(new ClusterDefinition().withKind("Hadoop") + .withConfigurations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"gateway\":{\"restAuthCredential.isEnabled\":true,\"restAuthCredential.password\":\"**********\",\"restAuthCredential.username\":\"admin\"}}", + Object.class, SerializerEncoding.JSON))) + .withComputeProfile(new ComputeProfile().withRoles(Arrays.asList(new Role().withName("headnode") + .withMinInstanceCount(1) + .withTargetInstanceCount(2) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile().withLinuxOperatingSystemProfile( + new LinuxOperatingSystemProfile().withUsername("sshuser").withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("workernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList()), + new Role().withName("zookeepernode") + .withMinInstanceCount(1) + .withTargetInstanceCount(3) + .withHardwareProfile(new HardwareProfile().withVmSize("Standard_E8_V3")) + .withOsProfile(new OsProfile() + .withLinuxOperatingSystemProfile(new LinuxOperatingSystemProfile().withUsername("sshuser") + .withPassword("fakeTokenPlaceholder"))) + .withVirtualNetworkProfile(new VirtualNetworkProfile().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname") + .withSubnet( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet")) + .withScriptActions(Arrays.asList())))) + .withStorageProfile(new StorageProfile().withStorageaccounts(Arrays.asList(new StorageAccount() + .withName("mystorage.blob.core.windows.net") + .withIsDefault(true) + .withContainer("containername") + .withResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage") + .withMsiResourceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"))))) + .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi", + new UserAssignedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateLinuxSparkSshPassword.json */ /** @@ -537,7 +739,7 @@ public static void createSparkOnLinuxClusterWithSSHPassword( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithCustomNetworkProperties.json */ /** @@ -597,7 +799,7 @@ public static void createClusterWithNetworkProperties(com.azure.resourcemanager. /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithTLS12.json */ /** @@ -649,7 +851,7 @@ public static void createClusterWithTLS12(com.azure.resourcemanager.hdinsight.HD /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithEncryptionAtHost.json */ /** @@ -701,7 +903,7 @@ public static void createClusterWithEncryptionAtHost(com.azure.resourcemanager.h /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithEncryptionInTransit.json */ /** @@ -754,7 +956,7 @@ public static void createClusterWithEncryptionInTransit( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * CreateHDInsightClusterWithComputeIsolationProperties.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteSamples.java index 86cda3de46a2..1820ba1ce8df 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteSamples.java @@ -10,7 +10,7 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DeleteLinuxHadoopCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsSamples.java index 4e3dc9b27663..2dbdf48b8ef8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsSamples.java @@ -14,7 +14,7 @@ public final class ClustersExecuteScriptActionsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * PostExecuteScriptAction.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetAzureAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetAzureAsyncOperationStatusSamples.java index 99b26552d620..e53dde5640d1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetAzureAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetAzureAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetClusterCreatingAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetByResourceGroupSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetByResourceGroupSamples.java index 97ee97495921..3f97fc97f1b1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxHadoopCluster.json */ /** @@ -24,7 +24,7 @@ public static void getHadoopOnLinuxCluster(com.azure.resourcemanager.hdinsight.H /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxSparkCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetGatewaySettingsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetGatewaySettingsSamples.java index 1366d560458c..463766b6ebc5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetGatewaySettingsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersGetGatewaySettingsSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetGatewaySettingsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Clusters_GetGatewaySettings.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListByResourceGroupSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListByResourceGroupSamples.java index 9cf662ca3b1a..0f853c46d4bf 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxHadoopAllClustersInResourceGroup.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListSamples.java index b90dac511fad..30e1bdf3bc34 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersListSamples.java @@ -10,7 +10,7 @@ public final class ClustersListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxHadoopAllClusters.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeSamples.java index 007d25d500bb..9ef4d436df63 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeSamples.java @@ -13,7 +13,7 @@ public final class ClustersResizeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * ResizeLinuxHadoopCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersRotateDiskEncryptionKeySamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersRotateDiskEncryptionKeySamples.java index fa829dd6c460..9ad6a9569c92 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersRotateDiskEncryptionKeySamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersRotateDiskEncryptionKeySamples.java @@ -12,7 +12,7 @@ public final class ClustersRotateDiskEncryptionKeySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * RotateLinuxHadoopClusterDiskEncryptionKey.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationSamples.java index be8a6a8063a2..fd302c3eda3a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationSamples.java @@ -20,7 +20,7 @@ public final class ClustersUpdateAutoScaleConfigurationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableOrUpdateAutoScaleWithLoadBasedConfiguration.json */ /** @@ -39,7 +39,7 @@ public static void enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHDInsi /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DisableClusterAutoScale.json */ /** @@ -56,7 +56,7 @@ public static void enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHDInsi /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableOrUpdateAutoScaleWithScheduleBasedConfiguration.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateGatewaySettingsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateGatewaySettingsSamples.java index 4ac6229c7e3e..4e96a75fa635 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateGatewaySettingsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateGatewaySettingsSamples.java @@ -4,7 +4,9 @@ package com.azure.resourcemanager.hdinsight.generated; +import com.azure.resourcemanager.hdinsight.models.EntraUserInfo; import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; +import java.util.Arrays; /** * Samples for Clusters UpdateGatewaySettings. @@ -12,7 +14,7 @@ public final class ClustersUpdateGatewaySettingsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Clusters_UpdateGatewaySettings_Enable.json */ /** @@ -25,4 +27,24 @@ public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HD .updateGatewaySettings("rg1", "cluster1", new UpdateGatewaySettingsParameters(), com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ + * HDI_Clusters_UpdateGatewaySettings_EntraUser.json + */ + /** + * Sample code: Update Entra User In HDInsight. + * + * @param manager Entry point to HDInsightManager. + */ + public static void updateEntraUserInHDInsight(com.azure.resourcemanager.hdinsight.HDInsightManager manager) { + manager.clusters() + .updateGatewaySettings("rg1", "cluster1", + new UpdateGatewaySettingsParameters().withRestAuthEntraUsers( + Arrays.asList(new EntraUserInfo().withObjectId("00000000-0000-0000-0000-000000000000") + .withDisplayName("displayName") + .withUpn("user@microsoft.com"))), + com.azure.core.util.Context.NONE); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateIdentityCertificateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateIdentityCertificateSamples.java index 766522a59fc4..a645d4448749 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateIdentityCertificateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateIdentityCertificateSamples.java @@ -12,7 +12,7 @@ public final class ClustersUpdateIdentityCertificateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Clusters_UpdateClusterIdentityCertificate.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateSamples.java index 540ad597b825..b41615100422 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateSamples.java @@ -16,7 +16,7 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * PatchLinuxHadoopCluster.json */ /** @@ -33,7 +33,7 @@ public static void patchHDInsightLinuxClusters(com.azure.resourcemanager.hdinsig /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * PatchLinuxHadoopClusterWithSystemMSI.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetSamples.java index 786e369f9f59..56d8d1dae8c1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Configurations_Get.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListSamples.java index 6f749f147f0d..5e52ca4305b4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Configurations_List.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateSamples.java index 730bf9a351e7..17ffa4ea7575 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateSamples.java @@ -13,7 +13,7 @@ public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * ChangeHttpConnectivityEnable.json */ /** @@ -31,7 +31,7 @@ public static void enableHTTPConnectivity(com.azure.resourcemanager.hdinsight.HD /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * ChangeHttpConnectivityDisable.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsCreateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsCreateSamples.java index 6a83dae0165e..c4cae301b393 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsCreateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsCreateSamples.java @@ -12,7 +12,7 @@ public final class ExtensionsCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/CreateExtension. + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateExtension. * json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteSamples.java index 6568c4cd9976..bc5c7aa6e72c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/DeleteExtension. + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteExtension. * json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentSamples.java index 92b4bef6ceca..39b2699da9f0 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsDisableAzureMonitorAgentSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DisableLinuxClusterAzureMonitorAgent.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorSamples.java index 3f1af93ac7e5..b3dd77f3edc1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsDisableAzureMonitorSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DisableLinuxClusterAzureMonitor.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringSamples.java index fd946c33b2b5..3928c730f665 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsDisableMonitoringSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DisableLinuxClusterMonitoring.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorAgentSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorAgentSamples.java index 9099ad04f992..a204261f2007 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorAgentSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorAgentSamples.java @@ -12,7 +12,7 @@ public final class ExtensionsEnableAzureMonitorAgentSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableLinuxClusterAzureMonitorAgent.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorSamples.java index 1e8a39e45e5d..0056e0ebdc08 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableAzureMonitorSamples.java @@ -12,7 +12,7 @@ public final class ExtensionsEnableAzureMonitorSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableLinuxClusterAzureMonitor.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableMonitoringSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableMonitoringSamples.java index 8276b3cec65b..8b79b5b745e2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableMonitoringSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsEnableMonitoringSamples.java @@ -12,7 +12,7 @@ public final class ExtensionsEnableMonitoringSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * EnableLinuxClusterMonitoring.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureAsyncOperationStatusSamples.java index 984b36c912c5..e8116cad65b3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetExtensionCreationAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusSamples.java index 71fa64fe4be6..626939a89741 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetAzureMonitorAgentStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxClusterAzureMonitorAgentStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusSamples.java index 1124405765f1..490931f623a6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetAzureMonitorStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxClusterAzureMonitorStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusSamples.java index 601cb4819b0c..cf2ff5bc0a5e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetMonitoringStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxClusterMonitoringStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetSamples.java index 187159c926b7..caefa88ee2e9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/GetExtension. + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetExtension. * json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilitySamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilitySamples.java index c394869d2a57..f10f92e7e804 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilitySamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilitySamples.java @@ -12,7 +12,7 @@ public final class LocationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Locations_CheckClusterNameAvailability.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetAzureAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetAzureAsyncOperationStatusSamples.java index 48f6475c0c42..d86ca240049a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetAzureAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetAzureAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class LocationsGetAzureAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Locations_GetAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesSamples.java index 39ff57a528f2..069ffa569c74 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesSamples.java @@ -10,7 +10,7 @@ public final class LocationsGetCapabilitiesSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetHDInsightCapabilities.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsSamples.java index 412b2502a727..b144b4116d7e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsSamples.java @@ -10,7 +10,7 @@ public final class LocationsListBillingSpecsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Locations_ListBillingSpecs.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesSamples.java index 854bf5ab7252..d872f08129cc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesSamples.java @@ -10,7 +10,7 @@ public final class LocationsListUsagesSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetHDInsightUsages.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsValidateClusterCreateRequestSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsValidateClusterCreateRequestSamples.java index 98aa7bcd2010..1335db5ef7fa 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsValidateClusterCreateRequestSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/LocationsValidateClusterCreateRequestSamples.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.hdinsight.models.ComputeProfile; import com.azure.resourcemanager.hdinsight.models.HardwareProfile; import com.azure.resourcemanager.hdinsight.models.LinuxOperatingSystemProfile; -import com.azure.resourcemanager.hdinsight.models.OsProfile; import com.azure.resourcemanager.hdinsight.models.OSType; +import com.azure.resourcemanager.hdinsight.models.OsProfile; import com.azure.resourcemanager.hdinsight.models.Role; import com.azure.resourcemanager.hdinsight.models.StorageAccount; import com.azure.resourcemanager.hdinsight.models.StorageProfile; @@ -29,7 +29,7 @@ public final class LocationsValidateClusterCreateRequestSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * HDI_Locations_ValidateClusterCreateRequest.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/OperationsListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/OperationsListSamples.java index d365891d7db9..49eb182edee4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/OperationsListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * ListHDInsightOperations.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 8e0f9c9c4f20..38f4fa6f2c01 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * ApprovePrivateEndpointConnection.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteSamples.java index e4671ec1cc64..0a84defb05ce 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DeletePrivateEndpointConnection.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetSamples.java index 690984985b2b..f611cf383a5e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetPrivateEndpointConnection.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterSamples.java index f88b4534f387..a0cec4dda949 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetAllPrivateEndpointConnectionsInCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetSamples.java index 37b6ca2a2df6..0b00c344d600 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetPrivateLinkResource.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterSamples.java index e097f28e66d6..dc8475d43a5c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetAllPrivateLinkResourcesInCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteSamples.java index 8d9e1adf34ad..5634d76dd552 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ScriptActionsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * DeleteScriptAction.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionAsyncOperationStatusSamples.java index 0f3a107bc2a9..7c3f0d4f2712 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class ScriptActionsGetExecutionAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetScriptExecutionAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailSamples.java index eb682fb4c8ca..0b405a044278 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailSamples.java @@ -10,7 +10,7 @@ public final class ScriptActionsGetExecutionDetailSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetScriptActionById.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterSamples.java index 8b8b40193329..e3cf2eaf1822 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterSamples.java @@ -10,7 +10,7 @@ public final class ScriptActionsListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetLinuxHadoopScriptAction.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryListByClusterSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryListByClusterSamples.java index 3922a2b29d25..8988e0c6fc96 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryListByClusterSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryListByClusterSamples.java @@ -10,7 +10,7 @@ public final class ScriptExecutionHistoryListByClusterSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetScriptExecutionHistory.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryPromoteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryPromoteSamples.java index 868303c519ae..88caab01b91d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryPromoteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoryPromoteSamples.java @@ -10,7 +10,7 @@ public final class ScriptExecutionHistoryPromoteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * PromoteLinuxHadoopScriptAction.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesGetAsyncOperationStatusSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesGetAsyncOperationStatusSamples.java index d6de1eea46a8..8dd39ec45bb3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesGetAsyncOperationStatusSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesGetAsyncOperationStatusSamples.java @@ -10,7 +10,7 @@ public final class VirtualMachinesGetAsyncOperationStatusSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetRestartHostsAsyncOperationStatus.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesListHostsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesListHostsSamples.java index d2422eeff9f8..6d2ff5cde57d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesListHostsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesListHostsSamples.java @@ -10,7 +10,7 @@ public final class VirtualMachinesListHostsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * GetClusterVirtualMachines.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsSamples.java index cc4a7486b377..855eb7fbc97b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/samples/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsSamples.java @@ -12,7 +12,7 @@ public final class VirtualMachinesRestartHostsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ * RestartVirtualMachinesOperation.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AaddsResourceDetailsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AaddsResourceDetailsTests.java deleted file mode 100644 index 30c832c77879..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AaddsResourceDetailsTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AaddsResourceDetails; -import org.junit.jupiter.api.Assertions; - -public final class AaddsResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AaddsResourceDetails model = BinaryData.fromString( - "{\"domainName\":\"gzslesjcbhernnti\",\"initialSyncComplete\":false,\"ldapsEnabled\":false,\"ldapsPublicCertificateInBase64\":\"bquwrbehw\",\"resourceId\":\"o\",\"subnetId\":\"uffkmrqemvvh\",\"tenantId\":\"tdrjfutacoebj\"}") - .toObject(AaddsResourceDetails.class); - Assertions.assertEquals("gzslesjcbhernnti", model.domainName()); - Assertions.assertEquals(false, model.initialSyncComplete()); - Assertions.assertEquals(false, model.ldapsEnabled()); - Assertions.assertEquals("bquwrbehw", model.ldapsPublicCertificateInBase64()); - Assertions.assertEquals("o", model.resourceId()); - Assertions.assertEquals("uffkmrqemvvh", model.subnetId()); - Assertions.assertEquals("tdrjfutacoebj", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AaddsResourceDetails model = new AaddsResourceDetails().withDomainName("gzslesjcbhernnti") - .withInitialSyncComplete(false) - .withLdapsEnabled(false) - .withLdapsPublicCertificateInBase64("bquwrbehw") - .withResourceId("o") - .withSubnetId("uffkmrqemvvh") - .withTenantId("tdrjfutacoebj"); - model = BinaryData.fromObject(model).toObject(AaddsResourceDetails.class); - Assertions.assertEquals("gzslesjcbhernnti", model.domainName()); - Assertions.assertEquals(false, model.initialSyncComplete()); - Assertions.assertEquals(false, model.ldapsEnabled()); - Assertions.assertEquals("bquwrbehw", model.ldapsPublicCertificateInBase64()); - Assertions.assertEquals("o", model.resourceId()); - Assertions.assertEquals("uffkmrqemvvh", model.subnetId()); - Assertions.assertEquals("tdrjfutacoebj", model.tenantId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetEndpointTests.java deleted file mode 100644 index a0588efcd652..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetEndpointTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ApplicationGetEndpoint; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationGetEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationGetEndpoint model = BinaryData.fromString( - "{\"location\":\"iith\",\"destinationPort\":63986979,\"publicPort\":511745945,\"privateIPAddress\":\"v\"}") - .toObject(ApplicationGetEndpoint.class); - Assertions.assertEquals("iith", model.location()); - Assertions.assertEquals(63986979, model.destinationPort()); - Assertions.assertEquals(511745945, model.publicPort()); - Assertions.assertEquals("v", model.privateIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationGetEndpoint model = new ApplicationGetEndpoint().withLocation("iith") - .withDestinationPort(63986979) - .withPublicPort(511745945) - .withPrivateIpAddress("v"); - model = BinaryData.fromObject(model).toObject(ApplicationGetEndpoint.class); - Assertions.assertEquals("iith", model.location()); - Assertions.assertEquals(63986979, model.destinationPort()); - Assertions.assertEquals(511745945, model.publicPort()); - Assertions.assertEquals("v", model.privateIpAddress()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetHttpsEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetHttpsEndpointTests.java deleted file mode 100644 index b26b9525647d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationGetHttpsEndpointTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ApplicationGetHttpsEndpoint; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationGetHttpsEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationGetHttpsEndpoint model = BinaryData.fromString( - "{\"accessModes\":[\"iwkuofos\",\"ghsauuimjmvxied\",\"ugidyjrr\",\"byao\"],\"location\":\"e\",\"destinationPort\":981492544,\"publicPort\":635298433,\"privateIPAddress\":\"clhocohsl\",\"subDomainSuffix\":\"vleggzfbuhfmvfax\",\"disableGatewayAuth\":true}") - .toObject(ApplicationGetHttpsEndpoint.class); - Assertions.assertEquals("iwkuofos", model.accessModes().get(0)); - Assertions.assertEquals(981492544, model.destinationPort()); - Assertions.assertEquals("clhocohsl", model.privateIpAddress()); - Assertions.assertEquals("vleggzfbuhfmvfax", model.subDomainSuffix()); - Assertions.assertEquals(true, model.disableGatewayAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationGetHttpsEndpoint model = new ApplicationGetHttpsEndpoint() - .withAccessModes(Arrays.asList("iwkuofos", "ghsauuimjmvxied", "ugidyjrr", "byao")) - .withDestinationPort(981492544) - .withPrivateIpAddress("clhocohsl") - .withSubDomainSuffix("vleggzfbuhfmvfax") - .withDisableGatewayAuth(true); - model = BinaryData.fromObject(model).toObject(ApplicationGetHttpsEndpoint.class); - Assertions.assertEquals("iwkuofos", model.accessModes().get(0)); - Assertions.assertEquals(981492544, model.destinationPort()); - Assertions.assertEquals("clhocohsl", model.privateIpAddress()); - Assertions.assertEquals("vleggzfbuhfmvfax", model.subDomainSuffix()); - Assertions.assertEquals(true, model.disableGatewayAuth()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteMockTests.java deleted file mode 100644 index 422f3ed8302b..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ApplicationsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.applications().delete("baxk", "eytu", "lbfjkwr", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleCapacityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleCapacityTests.java deleted file mode 100644 index 9570df492072..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleCapacityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoscaleCapacity model - = BinaryData.fromString("{\"minInstanceCount\":358956997,\"maxInstanceCount\":1965159297}") - .toObject(AutoscaleCapacity.class); - Assertions.assertEquals(358956997, model.minInstanceCount()); - Assertions.assertEquals(1965159297, model.maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoscaleCapacity model - = new AutoscaleCapacity().withMinInstanceCount(358956997).withMaxInstanceCount(1965159297); - model = BinaryData.fromObject(model).toObject(AutoscaleCapacity.class); - Assertions.assertEquals(358956997, model.minInstanceCount()); - Assertions.assertEquals(1965159297, model.maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleConfigurationUpdateParameterTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleConfigurationUpdateParameterTests.java deleted file mode 100644 index 9e76f2156a01..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleConfigurationUpdateParameterTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Autoscale; -import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; -import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleConfigurationUpdateParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoscaleConfigurationUpdateParameter model = BinaryData.fromString( - "{\"autoscale\":{\"capacity\":{\"minInstanceCount\":1606651649,\"maxInstanceCount\":1487162894},\"recurrence\":{\"timeZone\":\"rhzo\",\"schedule\":[{\"days\":[\"Wednesday\"],\"timeAndCapacity\":{\"time\":\"ibahwflus\",\"minInstanceCount\":2001573010,\"maxInstanceCount\":1319201753}}]}}}") - .toObject(AutoscaleConfigurationUpdateParameter.class); - Assertions.assertEquals(1606651649, model.autoscale().capacity().minInstanceCount()); - Assertions.assertEquals(1487162894, model.autoscale().capacity().maxInstanceCount()); - Assertions.assertEquals("rhzo", model.autoscale().recurrence().timeZone()); - Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.autoscale().recurrence().schedule().get(0).days().get(0)); - Assertions.assertEquals("ibahwflus", model.autoscale().recurrence().schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(2001573010, - model.autoscale().recurrence().schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(1319201753, - model.autoscale().recurrence().schedule().get(0).timeAndCapacity().maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoscaleConfigurationUpdateParameter model - = new AutoscaleConfigurationUpdateParameter().withAutoscale(new Autoscale() - .withCapacity(new AutoscaleCapacity().withMinInstanceCount(1606651649).withMaxInstanceCount(1487162894)) - .withRecurrence(new AutoscaleRecurrence().withTimeZone("rhzo") - .withSchedule(Arrays.asList(new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.WEDNESDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("ibahwflus") - .withMinInstanceCount(2001573010) - .withMaxInstanceCount(1319201753)))))); - model = BinaryData.fromObject(model).toObject(AutoscaleConfigurationUpdateParameter.class); - Assertions.assertEquals(1606651649, model.autoscale().capacity().minInstanceCount()); - Assertions.assertEquals(1487162894, model.autoscale().capacity().maxInstanceCount()); - Assertions.assertEquals("rhzo", model.autoscale().recurrence().timeZone()); - Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.autoscale().recurrence().schedule().get(0).days().get(0)); - Assertions.assertEquals("ibahwflus", model.autoscale().recurrence().schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(2001573010, - model.autoscale().recurrence().schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(1319201753, - model.autoscale().recurrence().schedule().get(0).timeAndCapacity().maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleRecurrenceTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleRecurrenceTests.java deleted file mode 100644 index b36dec0a6c43..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleRecurrenceTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleRecurrenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoscaleRecurrence model = BinaryData.fromString( - "{\"timeZone\":\"enevfyexfwhybci\",\"schedule\":[{\"days\":[\"Saturday\"],\"timeAndCapacity\":{\"time\":\"tynnaamdectehfi\",\"minInstanceCount\":494775669,\"maxInstanceCount\":478088047}},{\"days\":[\"Tuesday\",\"Thursday\"],\"timeAndCapacity\":{\"time\":\"rkgqhcjrefo\",\"minInstanceCount\":34828913,\"maxInstanceCount\":668805249}},{\"days\":[\"Friday\",\"Wednesday\"],\"timeAndCapacity\":{\"time\":\"xyqj\",\"minInstanceCount\":1744021341,\"maxInstanceCount\":203599917}}]}") - .toObject(AutoscaleRecurrence.class); - Assertions.assertEquals("enevfyexfwhybci", model.timeZone()); - Assertions.assertEquals(DaysOfWeek.SATURDAY, model.schedule().get(0).days().get(0)); - Assertions.assertEquals("tynnaamdectehfi", model.schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(494775669, model.schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(478088047, model.schedule().get(0).timeAndCapacity().maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoscaleRecurrence model = new AutoscaleRecurrence().withTimeZone("enevfyexfwhybci") - .withSchedule(Arrays.asList( - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.SATURDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("tynnaamdectehfi") - .withMinInstanceCount(494775669) - .withMaxInstanceCount(478088047)), - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.TUESDAY, DaysOfWeek.THURSDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("rkgqhcjrefo") - .withMinInstanceCount(34828913) - .withMaxInstanceCount(668805249)), - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.FRIDAY, DaysOfWeek.WEDNESDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("xyqj") - .withMinInstanceCount(1744021341) - .withMaxInstanceCount(203599917)))); - model = BinaryData.fromObject(model).toObject(AutoscaleRecurrence.class); - Assertions.assertEquals("enevfyexfwhybci", model.timeZone()); - Assertions.assertEquals(DaysOfWeek.SATURDAY, model.schedule().get(0).days().get(0)); - Assertions.assertEquals("tynnaamdectehfi", model.schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(494775669, model.schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(478088047, model.schedule().get(0).timeAndCapacity().maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleScheduleTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleScheduleTests.java deleted file mode 100644 index 0bc5fc66d2cf..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleScheduleTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoscaleSchedule model = BinaryData.fromString( - "{\"days\":[\"Monday\",\"Thursday\",\"Tuesday\",\"Sunday\"],\"timeAndCapacity\":{\"time\":\"czsqpjhvm\",\"minInstanceCount\":330627677,\"maxInstanceCount\":1964386727}}") - .toObject(AutoscaleSchedule.class); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.days().get(0)); - Assertions.assertEquals("czsqpjhvm", model.timeAndCapacity().time()); - Assertions.assertEquals(330627677, model.timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(1964386727, model.timeAndCapacity().maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoscaleSchedule model = new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.THURSDAY, DaysOfWeek.TUESDAY, DaysOfWeek.SUNDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("czsqpjhvm") - .withMinInstanceCount(330627677) - .withMaxInstanceCount(1964386727)); - model = BinaryData.fromObject(model).toObject(AutoscaleSchedule.class); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.days().get(0)); - Assertions.assertEquals("czsqpjhvm", model.timeAndCapacity().time()); - Assertions.assertEquals(330627677, model.timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(1964386727, model.timeAndCapacity().maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTests.java deleted file mode 100644 index 86cb0dec88c1..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Autoscale; -import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Autoscale model = BinaryData.fromString( - "{\"capacity\":{\"minInstanceCount\":1771103105,\"maxInstanceCount\":1913635803},\"recurrence\":{\"timeZone\":\"bjnpg\",\"schedule\":[{\"days\":[\"Wednesday\",\"Thursday\",\"Tuesday\",\"Monday\"],\"timeAndCapacity\":{\"time\":\"tyfsoppusuesn\",\"minInstanceCount\":1828932864,\"maxInstanceCount\":317621756}},{\"days\":[\"Thursday\"],\"timeAndCapacity\":{\"time\":\"xzdmohctb\",\"minInstanceCount\":1529084406,\"maxInstanceCount\":1727666858}},{\"days\":[\"Wednesday\",\"Monday\"],\"timeAndCapacity\":{\"time\":\"owgujjugwdkcglhs\",\"minInstanceCount\":525193865,\"maxInstanceCount\":1319267139}},{\"days\":[\"Saturday\"],\"timeAndCapacity\":{\"time\":\"jixhbk\",\"minInstanceCount\":696008357,\"maxInstanceCount\":662259969}}]}}") - .toObject(Autoscale.class); - Assertions.assertEquals(1771103105, model.capacity().minInstanceCount()); - Assertions.assertEquals(1913635803, model.capacity().maxInstanceCount()); - Assertions.assertEquals("bjnpg", model.recurrence().timeZone()); - Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.recurrence().schedule().get(0).days().get(0)); - Assertions.assertEquals("tyfsoppusuesn", model.recurrence().schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(1828932864, model.recurrence().schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(317621756, model.recurrence().schedule().get(0).timeAndCapacity().maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Autoscale model = new Autoscale() - .withCapacity(new AutoscaleCapacity().withMinInstanceCount(1771103105).withMaxInstanceCount(1913635803)) - .withRecurrence(new AutoscaleRecurrence().withTimeZone("bjnpg") - .withSchedule(Arrays.asList( - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.WEDNESDAY, DaysOfWeek.THURSDAY, DaysOfWeek.TUESDAY, - DaysOfWeek.MONDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("tyfsoppusuesn") - .withMinInstanceCount(1828932864) - .withMaxInstanceCount(317621756)), - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.THURSDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("xzdmohctb") - .withMinInstanceCount(1529084406) - .withMaxInstanceCount(1727666858)), - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.WEDNESDAY, DaysOfWeek.MONDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("owgujjugwdkcglhs") - .withMinInstanceCount(525193865) - .withMaxInstanceCount(1319267139)), - new AutoscaleSchedule().withDays(Arrays.asList(DaysOfWeek.SATURDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity().withTime("jixhbk") - .withMinInstanceCount(696008357) - .withMaxInstanceCount(662259969))))); - model = BinaryData.fromObject(model).toObject(Autoscale.class); - Assertions.assertEquals(1771103105, model.capacity().minInstanceCount()); - Assertions.assertEquals(1913635803, model.capacity().maxInstanceCount()); - Assertions.assertEquals("bjnpg", model.recurrence().timeZone()); - Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.recurrence().schedule().get(0).days().get(0)); - Assertions.assertEquals("tyfsoppusuesn", model.recurrence().schedule().get(0).timeAndCapacity().time()); - Assertions.assertEquals(1828932864, model.recurrence().schedule().get(0).timeAndCapacity().minInstanceCount()); - Assertions.assertEquals(317621756, model.recurrence().schedule().get(0).timeAndCapacity().maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTimeAndCapacityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTimeAndCapacityTests.java deleted file mode 100644 index 535e1ef94dc4..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AutoscaleTimeAndCapacityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import org.junit.jupiter.api.Assertions; - -public final class AutoscaleTimeAndCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoscaleTimeAndCapacity model = BinaryData - .fromString("{\"time\":\"sounqecanoaeu\",\"minInstanceCount\":453736827,\"maxInstanceCount\":2029190304}") - .toObject(AutoscaleTimeAndCapacity.class); - Assertions.assertEquals("sounqecanoaeu", model.time()); - Assertions.assertEquals(453736827, model.minInstanceCount()); - Assertions.assertEquals(2029190304, model.maxInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoscaleTimeAndCapacity model = new AutoscaleTimeAndCapacity().withTime("sounqecanoaeu") - .withMinInstanceCount(453736827) - .withMaxInstanceCount(2029190304); - model = BinaryData.fromObject(model).toObject(AutoscaleTimeAndCapacity.class); - Assertions.assertEquals("sounqecanoaeu", model.time()); - Assertions.assertEquals(453736827, model.minInstanceCount()); - Assertions.assertEquals(2029190304, model.maxInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorResponseInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorResponseInnerTests.java deleted file mode 100644 index d58c167a7b29..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorResponseInnerTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.AzureMonitorResponseInner; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorSelectedConfigurations; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorTableConfiguration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AzureMonitorResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureMonitorResponseInner model = BinaryData.fromString( - "{\"clusterMonitoringEnabled\":false,\"workspaceId\":\"dtlwwrlkd\",\"selectedConfigurations\":{\"configurationVersion\":\"cvokotllxdyhg\",\"globalConfigurations\":{\"hadoocrk\":\"cogjltdtbn\",\"amqgxqquezikyw\":\"cikhnv\"},\"tableList\":[{\"name\":\"allatmelwuipic\"},{\"name\":\"zkzivgvvcnay\"}]}}") - .toObject(AzureMonitorResponseInner.class); - Assertions.assertEquals(false, model.clusterMonitoringEnabled()); - Assertions.assertEquals("dtlwwrlkd", model.workspaceId()); - Assertions.assertEquals("cvokotllxdyhg", model.selectedConfigurations().configurationVersion()); - Assertions.assertEquals("cogjltdtbn", model.selectedConfigurations().globalConfigurations().get("hadoocrk")); - Assertions.assertEquals("allatmelwuipic", model.selectedConfigurations().tableList().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureMonitorResponseInner model = new AzureMonitorResponseInner().withClusterMonitoringEnabled(false) - .withWorkspaceId("dtlwwrlkd") - .withSelectedConfigurations( - new AzureMonitorSelectedConfigurations().withConfigurationVersion("cvokotllxdyhg") - .withGlobalConfigurations(mapOf("hadoocrk", "cogjltdtbn", "amqgxqquezikyw", "cikhnv")) - .withTableList(Arrays.asList(new AzureMonitorTableConfiguration().withName("allatmelwuipic"), - new AzureMonitorTableConfiguration().withName("zkzivgvvcnay")))); - model = BinaryData.fromObject(model).toObject(AzureMonitorResponseInner.class); - Assertions.assertEquals(false, model.clusterMonitoringEnabled()); - Assertions.assertEquals("dtlwwrlkd", model.workspaceId()); - Assertions.assertEquals("cvokotllxdyhg", model.selectedConfigurations().configurationVersion()); - Assertions.assertEquals("cogjltdtbn", model.selectedConfigurations().globalConfigurations().get("hadoocrk")); - Assertions.assertEquals("allatmelwuipic", model.selectedConfigurations().tableList().get(0).name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorSelectedConfigurationsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorSelectedConfigurationsTests.java deleted file mode 100644 index b32a58a68106..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorSelectedConfigurationsTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorSelectedConfigurations; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorTableConfiguration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AzureMonitorSelectedConfigurationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureMonitorSelectedConfigurations model = BinaryData.fromString( - "{\"configurationVersion\":\"odlqiyntor\",\"globalConfigurations\":{\"yzrpzbchckqqzq\":\"leosjswsrms\",\"ysuiizynkedya\":\"ox\"},\"tableList\":[{\"name\":\"hqmibzyhwit\"},{\"name\":\"ypyynpcdpumnzg\"},{\"name\":\"z\"},{\"name\":\"abikns\"}]}") - .toObject(AzureMonitorSelectedConfigurations.class); - Assertions.assertEquals("odlqiyntor", model.configurationVersion()); - Assertions.assertEquals("leosjswsrms", model.globalConfigurations().get("yzrpzbchckqqzq")); - Assertions.assertEquals("hqmibzyhwit", model.tableList().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureMonitorSelectedConfigurations model - = new AzureMonitorSelectedConfigurations().withConfigurationVersion("odlqiyntor") - .withGlobalConfigurations(mapOf("yzrpzbchckqqzq", "leosjswsrms", "ysuiizynkedya", "ox")) - .withTableList(Arrays.asList(new AzureMonitorTableConfiguration().withName("hqmibzyhwit"), - new AzureMonitorTableConfiguration().withName("ypyynpcdpumnzg"), - new AzureMonitorTableConfiguration().withName("z"), - new AzureMonitorTableConfiguration().withName("abikns"))); - model = BinaryData.fromObject(model).toObject(AzureMonitorSelectedConfigurations.class); - Assertions.assertEquals("odlqiyntor", model.configurationVersion()); - Assertions.assertEquals("leosjswsrms", model.globalConfigurations().get("yzrpzbchckqqzq")); - Assertions.assertEquals("hqmibzyhwit", model.tableList().get(0).name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorTableConfigurationTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorTableConfigurationTests.java deleted file mode 100644 index d0cb8b0b234b..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/AzureMonitorTableConfigurationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorTableConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class AzureMonitorTableConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureMonitorTableConfiguration model - = BinaryData.fromString("{\"name\":\"gj\"}").toObject(AzureMonitorTableConfiguration.class); - Assertions.assertEquals("gj", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureMonitorTableConfiguration model = new AzureMonitorTableConfiguration().withName("gj"); - model = BinaryData.fromObject(model).toObject(AzureMonitorTableConfiguration.class); - Assertions.assertEquals("gj", model.name()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingMetersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingMetersTests.java deleted file mode 100644 index fef31be95fa0..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingMetersTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.BillingMeters; -import org.junit.jupiter.api.Assertions; - -public final class BillingMetersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeters model - = BinaryData.fromString("{\"meterParameter\":\"fqntcyp\",\"meter\":\"jv\",\"unit\":\"imwkslircizj\"}") - .toObject(BillingMeters.class); - Assertions.assertEquals("fqntcyp", model.meterParameter()); - Assertions.assertEquals("jv", model.meter()); - Assertions.assertEquals("imwkslircizj", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeters model - = new BillingMeters().withMeterParameter("fqntcyp").withMeter("jv").withUnit("imwkslircizj"); - model = BinaryData.fromObject(model).toObject(BillingMeters.class); - Assertions.assertEquals("fqntcyp", model.meterParameter()); - Assertions.assertEquals("jv", model.meter()); - Assertions.assertEquals("imwkslircizj", model.unit()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResourcesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResourcesTests.java deleted file mode 100644 index a637cab8fcf2..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResourcesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.BillingMeters; -import com.azure.resourcemanager.hdinsight.models.BillingResources; -import com.azure.resourcemanager.hdinsight.models.DiskBillingMeters; -import com.azure.resourcemanager.hdinsight.models.Tier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BillingResourcesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingResources model = BinaryData.fromString( - "{\"region\":\"fcluyov\",\"billingMeters\":[{\"meterParameter\":\"kfezzxscyhwz\",\"meter\":\"irujbz\",\"unit\":\"mvzzbtdcqvp\"},{\"meterParameter\":\"yujviylwdshfssn\",\"meter\":\"gy\",\"unit\":\"rymsgaojfmw\"},{\"meterParameter\":\"otmrfhir\",\"meter\":\"ymoxoftpipiwyczu\",\"unit\":\"a\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"lihhyuspskasdvlm\",\"sku\":\"dgzxulucvpamrsr\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"xurisjnhnyt\",\"sku\":\"fq\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"mrhublwpc\",\"sku\":\"utr\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"auutpwoqhihe\",\"sku\":\"g\",\"tier\":\"Premium\"}]}") - .toObject(BillingResources.class); - Assertions.assertEquals("fcluyov", model.region()); - Assertions.assertEquals("kfezzxscyhwz", model.billingMeters().get(0).meterParameter()); - Assertions.assertEquals("irujbz", model.billingMeters().get(0).meter()); - Assertions.assertEquals("mvzzbtdcqvp", model.billingMeters().get(0).unit()); - Assertions.assertEquals("lihhyuspskasdvlm", model.diskBillingMeters().get(0).diskRpMeter()); - Assertions.assertEquals("dgzxulucvpamrsr", model.diskBillingMeters().get(0).sku()); - Assertions.assertEquals(Tier.PREMIUM, model.diskBillingMeters().get(0).tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingResources model = new BillingResources().withRegion("fcluyov") - .withBillingMeters(Arrays.asList( - new BillingMeters().withMeterParameter("kfezzxscyhwz").withMeter("irujbz").withUnit("mvzzbtdcqvp"), - new BillingMeters().withMeterParameter("yujviylwdshfssn").withMeter("gy").withUnit("rymsgaojfmw"), - new BillingMeters().withMeterParameter("otmrfhir").withMeter("ymoxoftpipiwyczu").withUnit("a"))) - .withDiskBillingMeters(Arrays.asList( - new DiskBillingMeters().withDiskRpMeter("lihhyuspskasdvlm") - .withSku("dgzxulucvpamrsr") - .withTier(Tier.PREMIUM), - new DiskBillingMeters().withDiskRpMeter("xurisjnhnyt").withSku("fq").withTier(Tier.PREMIUM), - new DiskBillingMeters().withDiskRpMeter("mrhublwpc").withSku("utr").withTier(Tier.STANDARD), - new DiskBillingMeters().withDiskRpMeter("auutpwoqhihe").withSku("g").withTier(Tier.PREMIUM))); - model = BinaryData.fromObject(model).toObject(BillingResources.class); - Assertions.assertEquals("fcluyov", model.region()); - Assertions.assertEquals("kfezzxscyhwz", model.billingMeters().get(0).meterParameter()); - Assertions.assertEquals("irujbz", model.billingMeters().get(0).meter()); - Assertions.assertEquals("mvzzbtdcqvp", model.billingMeters().get(0).unit()); - Assertions.assertEquals("lihhyuspskasdvlm", model.diskBillingMeters().get(0).diskRpMeter()); - Assertions.assertEquals("dgzxulucvpamrsr", model.diskBillingMeters().get(0).sku()); - Assertions.assertEquals(Tier.PREMIUM, model.diskBillingMeters().get(0).tier()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResponseListResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResponseListResultInnerTests.java deleted file mode 100644 index e2b5e415d671..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/BillingResponseListResultInnerTests.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; -import com.azure.resourcemanager.hdinsight.models.BillingMeters; -import com.azure.resourcemanager.hdinsight.models.BillingResources; -import com.azure.resourcemanager.hdinsight.models.DiskBillingMeters; -import com.azure.resourcemanager.hdinsight.models.FilterMode; -import com.azure.resourcemanager.hdinsight.models.OSType; -import com.azure.resourcemanager.hdinsight.models.Tier; -import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BillingResponseListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingResponseListResultInner model = BinaryData.fromString( - "{\"vmSizes\":[\"fdwoyuhh\",\"iuiefozbhdmsm\"],\"vmSizesWithEncryptionAtHost\":[\"qhoftrmaequiah\",\"icslfaoq\"],\"vmSizeFilters\":[{\"filterMode\":\"Recommend\",\"regions\":[\"alnswhccsphk\",\"ivwitqscywugg\"],\"clusterFlavors\":[\"uhczbwemh\",\"i\"],\"nodeTypes\":[\"rgzdwmsweyp\"],\"clusterVersions\":[\"xggicccnxqhuexmk\",\"tlstvlzywem\",\"zrncsdt\",\"lusiy\"],\"osType\":[\"Linux\",\"Linux\",\"Windows\",\"Windows\"],\"vmSizes\":[\"sl\",\"eadcygqukyhejhz\"],\"espApplied\":\"xgfpelolppv\",\"computeIsolationSupported\":\"r\"},{\"filterMode\":\"Exclude\",\"regions\":[\"zraehtwd\",\"r\",\"tswiby\"],\"clusterFlavors\":[\"l\"],\"nodeTypes\":[\"hfwpracstwit\",\"khevxccedc\",\"nmdyodnwzxl\",\"jc\"],\"clusterVersions\":[\"ltiugcxnavv\"],\"osType\":[\"Linux\"],\"vmSizes\":[\"qunyowxwlmdjr\"],\"espApplied\":\"fgbvfvpdbo\",\"computeIsolationSupported\":\"cizsjqlhkrribdei\"},{\"filterMode\":\"Default\",\"regions\":[\"kghv\"],\"clusterFlavors\":[\"zwmk\",\"efajpj\",\"rwkq\"],\"nodeTypes\":[\"gbijtjivfx\",\"sjabibs\"],\"clusterVersions\":[\"awfsdjpvkvpbjxbk\",\"bzkdvn\",\"jabudurgkakmo\"],\"osType\":[\"Windows\",\"Windows\"],\"vmSizes\":[\"ffhmouwqlgzr\",\"zeeyebi\",\"ikayuhqlbjbsybb\"],\"espApplied\":\"r\",\"computeIsolationSupported\":\"ldgmfpgvmpip\"},{\"filterMode\":\"Exclude\",\"regions\":[\"aqfxss\"],\"clusterFlavors\":[\"twbdsrezpdrhn\"],\"nodeTypes\":[\"owqkdwytisi\",\"ircgpikpz\",\"mejzanlfzxia\",\"rmbzo\"],\"clusterVersions\":[\"i\",\"rjqc\"],\"osType\":[\"Windows\",\"Windows\"],\"vmSizes\":[\"lazszrn\",\"oiindfpwpjy\",\"wbtlhflsjcdh\"],\"espApplied\":\"fjvfbgofeljagr\",\"computeIsolationSupported\":\"qhl\"}],\"vmSizeProperties\":[{\"name\":\"iiojnal\",\"cores\":524245347,\"dataDiskStorageTier\":\"vtvsexsowueluq\",\"label\":\"ahhxvrh\",\"maxDataDiskCount\":9171909100636996860,\"memoryInMb\":4157804500338386814,\"supportedByVirtualMachines\":true,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":7214299945919733789,\"webWorkerResourceDiskSizeInMb\":2856222414032375851},{\"name\":\"xhqxujxukndxdigr\",\"cores\":1599924393,\"dataDiskStorageTier\":\"fzdm\",\"label\":\"qtfihwhbotzinga\",\"maxDataDiskCount\":2353170453764663846,\"memoryInMb\":449816124137860976,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":8200061235460803535,\"webWorkerResourceDiskSizeInMb\":7279242451300460541},{\"name\":\"dkfw\",\"cores\":2014780251,\"dataDiskStorageTier\":\"vtbvkayh\",\"label\":\"nvyq\",\"maxDataDiskCount\":2949816427464265295,\"memoryInMb\":1497619530378227200,\"supportedByVirtualMachines\":true,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":941265626595578709,\"webWorkerResourceDiskSizeInMb\":2780468814645606920},{\"name\":\"vvsccyajguq\",\"cores\":1811586286,\"dataDiskStorageTier\":\"gzlvdnkfxu\",\"label\":\"mdwzrmuhapfcqdps\",\"maxDataDiskCount\":1717467823158981449,\"memoryInMb\":3875353793969101932,\"supportedByVirtualMachines\":true,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":5946523647295808209,\"webWorkerResourceDiskSizeInMb\":3613891103592609366}],\"billingResources\":[{\"region\":\"ypql\",\"billingMeters\":[{\"meterParameter\":\"kerqwkyh\",\"meter\":\"bopgxedkowepbqp\",\"unit\":\"fkbw\"},{\"meterParameter\":\"snjvcdwxlpqekftn\",\"meter\":\"tjsyin\",\"unit\":\"fq\"},{\"meterParameter\":\"mtdh\",\"meter\":\"dvypgikdgsz\",\"unit\":\"kbir\"},{\"meterParameter\":\"uzhlhkjoqrv\",\"meter\":\"aatjinrvgoupmfi\",\"unit\":\"fggjioolvr\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"tkkgllqwjy\",\"sku\":\"jayvblmhv\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"bxvvyhg\",\"sku\":\"pbyrqufegxu\",\"tier\":\"Standard\"}]},{\"region\":\"bnhlmc\",\"billingMeters\":[{\"meterParameter\":\"ngitvgbmhrixkwm\",\"meter\":\"jejveg\",\"unit\":\"bpnaixexccbdre\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"exdrrvqahqkg\",\"sku\":\"pwijnhy\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"ycxzbfvoo\",\"sku\":\"rvmtgjq\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"s\",\"sku\":\"on\",\"tier\":\"Premium\"}]},{\"region\":\"gfipnsxk\",\"billingMeters\":[{\"meterParameter\":\"ekrrjr\",\"meter\":\"fxtsgum\",\"unit\":\"glikkxwslolb\"},{\"meterParameter\":\"vuzlm\",\"meter\":\"elfk\",\"unit\":\"plcrpwjxeznoig\"},{\"meterParameter\":\"njwmwkpnbsazejj\",\"meter\":\"kagfhsxtt\",\"unit\":\"gzxnfaazpxdtnk\"},{\"meterParameter\":\"kqjjlwuenvrkp\",\"meter\":\"uaibrebqaaysj\",\"unit\":\"xqtnq\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"lwfffi\",\"sku\":\"pjpqqmtedltmmji\",\"tier\":\"Standard\"}]},{\"region\":\"zphv\",\"billingMeters\":[{\"meterParameter\":\"qncygupkvi\",\"meter\":\"dscwxqupevzhf\",\"unit\":\"otxhojujby\"},{\"meterParameter\":\"lmcuvhixb\",\"meter\":\"yfwnylr\",\"unit\":\"o\"},{\"meterParameter\":\"ttpkiwkkbnujrywv\",\"meter\":\"lbfpncurd\",\"unit\":\"wiithtywub\"},{\"meterParameter\":\"bihwqknfdnt\",\"meter\":\"chrdgoihxumwcto\",\"unit\":\"zj\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"fdlwg\",\"sku\":\"tsbwtovvtgse\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"iufxqknpir\",\"sku\":\"epttwqmsniff\",\"tier\":\"Premium\"}]}]}") - .toObject(BillingResponseListResultInner.class); - Assertions.assertEquals("fdwoyuhh", model.vmSizes().get(0)); - Assertions.assertEquals("qhoftrmaequiah", model.vmSizesWithEncryptionAtHost().get(0)); - Assertions.assertEquals(FilterMode.RECOMMEND, model.vmSizeFilters().get(0).filterMode()); - Assertions.assertEquals("alnswhccsphk", model.vmSizeFilters().get(0).regions().get(0)); - Assertions.assertEquals("uhczbwemh", model.vmSizeFilters().get(0).clusterFlavors().get(0)); - Assertions.assertEquals("rgzdwmsweyp", model.vmSizeFilters().get(0).nodeTypes().get(0)); - Assertions.assertEquals("xggicccnxqhuexmk", model.vmSizeFilters().get(0).clusterVersions().get(0)); - Assertions.assertEquals(OSType.LINUX, model.vmSizeFilters().get(0).osType().get(0)); - Assertions.assertEquals("sl", model.vmSizeFilters().get(0).vmSizes().get(0)); - Assertions.assertEquals("xgfpelolppv", model.vmSizeFilters().get(0).espApplied()); - Assertions.assertEquals("r", model.vmSizeFilters().get(0).computeIsolationSupported()); - Assertions.assertEquals("ypql", model.billingResources().get(0).region()); - Assertions.assertEquals("kerqwkyh", model.billingResources().get(0).billingMeters().get(0).meterParameter()); - Assertions.assertEquals("bopgxedkowepbqp", model.billingResources().get(0).billingMeters().get(0).meter()); - Assertions.assertEquals("fkbw", model.billingResources().get(0).billingMeters().get(0).unit()); - Assertions.assertEquals("tkkgllqwjy", model.billingResources().get(0).diskBillingMeters().get(0).diskRpMeter()); - Assertions.assertEquals("jayvblmhv", model.billingResources().get(0).diskBillingMeters().get(0).sku()); - Assertions.assertEquals(Tier.STANDARD, model.billingResources().get(0).diskBillingMeters().get(0).tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingResponseListResultInner model - = new BillingResponseListResultInner().withVmSizes(Arrays.asList("fdwoyuhh", "iuiefozbhdmsm")) - .withVmSizesWithEncryptionAtHost(Arrays.asList("qhoftrmaequiah", "icslfaoq")) - .withVmSizeFilters( - Arrays - .asList( - new VmSizeCompatibilityFilterV2().withFilterMode(FilterMode.RECOMMEND) - .withRegions(Arrays.asList("alnswhccsphk", "ivwitqscywugg")) - .withClusterFlavors(Arrays.asList("uhczbwemh", "i")) - .withNodeTypes(Arrays.asList("rgzdwmsweyp")) - .withClusterVersions( - Arrays.asList("xggicccnxqhuexmk", "tlstvlzywem", "zrncsdt", "lusiy")) - .withOsType(Arrays.asList(OSType.LINUX, OSType.LINUX, OSType.WINDOWS, OSType.WINDOWS)) - .withVmSizes(Arrays.asList("sl", "eadcygqukyhejhz")) - .withEspApplied("xgfpelolppv") - .withComputeIsolationSupported("r"), - new VmSizeCompatibilityFilterV2().withFilterMode(FilterMode.EXCLUDE) - .withRegions(Arrays.asList("zraehtwd", "r", "tswiby")) - .withClusterFlavors(Arrays.asList("l")) - .withNodeTypes(Arrays.asList("hfwpracstwit", "khevxccedc", "nmdyodnwzxl", "jc")) - .withClusterVersions(Arrays.asList("ltiugcxnavv")) - .withOsType(Arrays.asList(OSType.LINUX)) - .withVmSizes(Arrays.asList("qunyowxwlmdjr")) - .withEspApplied("fgbvfvpdbo") - .withComputeIsolationSupported("cizsjqlhkrribdei"), - new VmSizeCompatibilityFilterV2().withFilterMode(FilterMode.DEFAULT) - .withRegions(Arrays.asList("kghv")) - .withClusterFlavors(Arrays.asList("zwmk", "efajpj", "rwkq")) - .withNodeTypes(Arrays.asList("gbijtjivfx", "sjabibs")) - .withClusterVersions(Arrays.asList("awfsdjpvkvpbjxbk", "bzkdvn", "jabudurgkakmo")) - .withOsType(Arrays.asList(OSType.WINDOWS, OSType.WINDOWS)) - .withVmSizes(Arrays.asList("ffhmouwqlgzr", "zeeyebi", "ikayuhqlbjbsybb")) - .withEspApplied("r") - .withComputeIsolationSupported("ldgmfpgvmpip"), - new VmSizeCompatibilityFilterV2().withFilterMode(FilterMode.EXCLUDE) - .withRegions(Arrays.asList("aqfxss")) - .withClusterFlavors(Arrays.asList("twbdsrezpdrhn")) - .withNodeTypes(Arrays.asList("owqkdwytisi", "ircgpikpz", "mejzanlfzxia", "rmbzo")) - .withClusterVersions(Arrays.asList("i", "rjqc")) - .withOsType(Arrays.asList(OSType.WINDOWS, OSType.WINDOWS)) - .withVmSizes(Arrays.asList("lazszrn", "oiindfpwpjy", "wbtlhflsjcdh")) - .withEspApplied("fjvfbgofeljagr") - .withComputeIsolationSupported("qhl"))) - .withBillingResources(Arrays.asList( - new BillingResources().withRegion("ypql") - .withBillingMeters(Arrays.asList(new BillingMeters() - .withMeterParameter("kerqwkyh") - .withMeter("bopgxedkowepbqp") - .withUnit("fkbw"), - new BillingMeters().withMeterParameter("snjvcdwxlpqekftn") - .withMeter("tjsyin") - .withUnit("fq"), - new BillingMeters().withMeterParameter("mtdh").withMeter("dvypgikdgsz").withUnit("kbir"), - new BillingMeters() - .withMeterParameter("uzhlhkjoqrv") - .withMeter("aatjinrvgoupmfi") - .withUnit("fggjioolvr"))) - .withDiskBillingMeters(Arrays.asList( - new DiskBillingMeters().withDiskRpMeter("tkkgllqwjy") - .withSku("jayvblmhv") - .withTier(Tier.STANDARD), - new DiskBillingMeters() - .withDiskRpMeter("bxvvyhg") - .withSku("pbyrqufegxu") - .withTier(Tier.STANDARD))), - new BillingResources().withRegion("bnhlmc") - .withBillingMeters(Arrays - .asList(new BillingMeters().withMeterParameter("ngitvgbmhrixkwm") - .withMeter("jejveg") - .withUnit("bpnaixexccbdre"))) - .withDiskBillingMeters(Arrays.asList(new DiskBillingMeters() - .withDiskRpMeter("exdrrvqahqkg") - .withSku("pwijnhy") - .withTier(Tier.STANDARD), - new DiskBillingMeters() - .withDiskRpMeter("ycxzbfvoo") - .withSku("rvmtgjq") - .withTier(Tier.STANDARD), - new DiskBillingMeters().withDiskRpMeter("s").withSku("on").withTier(Tier.PREMIUM))), - new BillingResources().withRegion("gfipnsxk") - .withBillingMeters(Arrays.asList(new BillingMeters() - .withMeterParameter("ekrrjr") - .withMeter("fxtsgum") - .withUnit("glikkxwslolb"), - new BillingMeters().withMeterParameter("vuzlm") - .withMeter("elfk") - .withUnit("plcrpwjxeznoig"), - new BillingMeters().withMeterParameter("njwmwkpnbsazejj") - .withMeter("kagfhsxtt") - .withUnit("gzxnfaazpxdtnk"), - new BillingMeters().withMeterParameter("kqjjlwuenvrkp") - .withMeter("uaibrebqaaysj") - .withUnit("xqtnq"))) - .withDiskBillingMeters(Arrays.asList(new DiskBillingMeters().withDiskRpMeter("lwfffi") - .withSku("pjpqqmtedltmmji") - .withTier(Tier.STANDARD))), - new BillingResources().withRegion("zphv") - .withBillingMeters(Arrays.asList( - new BillingMeters().withMeterParameter("qncygupkvi") - .withMeter("dscwxqupevzhf") - .withUnit("otxhojujby"), - new BillingMeters().withMeterParameter("lmcuvhixb").withMeter("yfwnylr").withUnit("o"), - new BillingMeters().withMeterParameter("ttpkiwkkbnujrywv") - .withMeter("lbfpncurd") - .withUnit("wiithtywub"), - new BillingMeters().withMeterParameter("bihwqknfdnt") - .withMeter("chrdgoihxumwcto") - .withUnit("zj"))) - .withDiskBillingMeters(Arrays.asList( - new DiskBillingMeters().withDiskRpMeter("fdlwg") - .withSku("tsbwtovvtgse") - .withTier(Tier.STANDARD), - new DiskBillingMeters().withDiskRpMeter("iufxqknpir") - .withSku("epttwqmsniff") - .withTier(Tier.PREMIUM))))); - model = BinaryData.fromObject(model).toObject(BillingResponseListResultInner.class); - Assertions.assertEquals("fdwoyuhh", model.vmSizes().get(0)); - Assertions.assertEquals("qhoftrmaequiah", model.vmSizesWithEncryptionAtHost().get(0)); - Assertions.assertEquals(FilterMode.RECOMMEND, model.vmSizeFilters().get(0).filterMode()); - Assertions.assertEquals("alnswhccsphk", model.vmSizeFilters().get(0).regions().get(0)); - Assertions.assertEquals("uhczbwemh", model.vmSizeFilters().get(0).clusterFlavors().get(0)); - Assertions.assertEquals("rgzdwmsweyp", model.vmSizeFilters().get(0).nodeTypes().get(0)); - Assertions.assertEquals("xggicccnxqhuexmk", model.vmSizeFilters().get(0).clusterVersions().get(0)); - Assertions.assertEquals(OSType.LINUX, model.vmSizeFilters().get(0).osType().get(0)); - Assertions.assertEquals("sl", model.vmSizeFilters().get(0).vmSizes().get(0)); - Assertions.assertEquals("xgfpelolppv", model.vmSizeFilters().get(0).espApplied()); - Assertions.assertEquals("r", model.vmSizeFilters().get(0).computeIsolationSupported()); - Assertions.assertEquals("ypql", model.billingResources().get(0).region()); - Assertions.assertEquals("kerqwkyh", model.billingResources().get(0).billingMeters().get(0).meterParameter()); - Assertions.assertEquals("bopgxedkowepbqp", model.billingResources().get(0).billingMeters().get(0).meter()); - Assertions.assertEquals("fkbw", model.billingResources().get(0).billingMeters().get(0).unit()); - Assertions.assertEquals("tkkgllqwjy", model.billingResources().get(0).diskBillingMeters().get(0).diskRpMeter()); - Assertions.assertEquals("jayvblmhv", model.billingResources().get(0).diskBillingMeters().get(0).sku()); - Assertions.assertEquals(Tier.STANDARD, model.billingResources().get(0).diskBillingMeters().get(0).tier()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/CapabilitiesResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/CapabilitiesResultInnerTests.java deleted file mode 100644 index 88186ca8368c..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/CapabilitiesResultInnerTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; -import com.azure.resourcemanager.hdinsight.models.RegionsCapability; -import com.azure.resourcemanager.hdinsight.models.VersionsCapability; -import com.azure.resourcemanager.hdinsight.models.VersionSpec; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CapabilitiesResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitiesResultInner model = BinaryData.fromString( - "{\"versions\":{\"a\":{\"available\":[{\"friendlyName\":\"alm\",\"displayName\":\"tdaaygdvwvg\",\"isDefault\":true,\"componentVersions\":{\"udxepxgyqagv\":\"wxrt\"}},{\"friendlyName\":\"mnpkukghimdblxg\",\"displayName\":\"mfnjh\",\"isDefault\":false,\"componentVersions\":{\"fkzikfj\":\"szkkfoqre\",\"wczelpci\":\"wneaiv\"}},{\"friendlyName\":\"lsfeaenwabfatkld\",\"displayName\":\"bjhwuaan\",\"isDefault\":false,\"componentVersions\":{\"oulpjrv\":\"ph\",\"rvimjwosytxitcsk\":\"ag\",\"hlyfjhdgqgg\":\"cktqumiekkezzi\",\"qfatpxllrxcyjm\":\"bdunygaeqid\"}}]},\"d\":{\"available\":[{\"friendlyName\":\"arm\",\"displayName\":\"dmjsjqb\",\"isDefault\":true,\"componentVersions\":{\"duhpk\":\"xrwlyc\"}},{\"friendlyName\":\"gymare\",\"displayName\":\"ajxq\",\"isDefault\":false,\"componentVersions\":{\"ofwq\":\"ycubeddgs\"}},{\"friendlyName\":\"qal\",\"displayName\":\"mnjijpxacqqudf\",\"isDefault\":true,\"componentVersions\":{\"m\":\"aaabjyvayff\"}},{\"friendlyName\":\"rtuzqogs\",\"displayName\":\"nevfdnw\",\"isDefault\":false,\"componentVersions\":{\"bjudpfrxtrthzv\":\"zsyyceuzso\",\"qbrqubpaxhexiili\":\"ytdw\",\"q\":\"pdtii\"}}]}},\"regions\":{\"nwxuqlcvydyp\":{\"available\":[\"r\",\"zfgs\",\"uyfxrxxleptramxj\",\"zwl\"]},\"ggkfpagaowpul\":{\"available\":[\"ooaojkniodkooebw\",\"ujhemmsbvdkcrodt\",\"infwjlfltkacjve\",\"kdlfoa\"]},\"nqicvinvkjjxdxrb\":{\"available\":[\"lyls\",\"xkqjnsjervt\",\"agxsdszuemps\",\"zkfzbeyv\"]}},\"features\":[\"zclewyhmlw\",\"aztz\"],\"quota\":{\"coresUsed\":4977542958455551003,\"maxCoresAllowed\":9013966511894256740,\"regionalQuotas\":[{\"regionName\":\"qwhxxbuyqaxzfeqz\",\"coresUsed\":5894027165628852811,\"coresAvailable\":344862766670091820}]}}") - .toObject(CapabilitiesResultInner.class); - Assertions.assertEquals("alm", model.versions().get("a").available().get(0).friendlyName()); - Assertions.assertEquals("tdaaygdvwvg", model.versions().get("a").available().get(0).displayName()); - Assertions.assertEquals(true, model.versions().get("a").available().get(0).isDefault()); - Assertions.assertEquals("wxrt", - model.versions().get("a").available().get(0).componentVersions().get("udxepxgyqagv")); - Assertions.assertEquals("r", model.regions().get("nwxuqlcvydyp").available().get(0)); - Assertions.assertEquals("zclewyhmlw", model.features().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesResultInner model - = new CapabilitiesResultInner() - .withVersions( - mapOf("a", - new VersionsCapability().withAvailable(Arrays.asList( - new VersionSpec().withFriendlyName("alm") - .withDisplayName("tdaaygdvwvg") - .withIsDefault(true) - .withComponentVersions(mapOf("udxepxgyqagv", "wxrt")), - new VersionSpec().withFriendlyName("mnpkukghimdblxg") - .withDisplayName("mfnjh") - .withIsDefault(false) - .withComponentVersions(mapOf("fkzikfj", "szkkfoqre", "wczelpci", "wneaiv")), - new VersionSpec().withFriendlyName("lsfeaenwabfatkld") - .withDisplayName("bjhwuaan") - .withIsDefault(false) - .withComponentVersions(mapOf("oulpjrv", "ph", "rvimjwosytxitcsk", "ag", "hlyfjhdgqgg", - "cktqumiekkezzi", "qfatpxllrxcyjm", "bdunygaeqid")))), - "d", - new VersionsCapability() - .withAvailable(Arrays.asList( - new VersionSpec().withFriendlyName("arm") - .withDisplayName("dmjsjqb") - .withIsDefault(true) - .withComponentVersions(mapOf("duhpk", "xrwlyc")), - new VersionSpec().withFriendlyName("gymare") - .withDisplayName("ajxq") - .withIsDefault(false) - .withComponentVersions(mapOf("ofwq", "ycubeddgs")), - new VersionSpec().withFriendlyName("qal") - .withDisplayName("mnjijpxacqqudf") - .withIsDefault(true) - .withComponentVersions(mapOf("m", "aaabjyvayff")), - new VersionSpec().withFriendlyName("rtuzqogs") - .withDisplayName("nevfdnw") - .withIsDefault(false) - .withComponentVersions(mapOf("bjudpfrxtrthzv", "zsyyceuzso", "qbrqubpaxhexiili", - "ytdw", "q", "pdtii")))))) - .withRegions(mapOf("nwxuqlcvydyp", - new RegionsCapability().withAvailable(Arrays.asList("r", "zfgs", "uyfxrxxleptramxj", "zwl")), - "ggkfpagaowpul", - new RegionsCapability().withAvailable( - Arrays.asList("ooaojkniodkooebw", "ujhemmsbvdkcrodt", "infwjlfltkacjve", "kdlfoa")), - "nqicvinvkjjxdxrb", - new RegionsCapability() - .withAvailable(Arrays.asList("lyls", "xkqjnsjervt", "agxsdszuemps", "zkfzbeyv")))) - .withFeatures(Arrays.asList("zclewyhmlw", "aztz")); - model = BinaryData.fromObject(model).toObject(CapabilitiesResultInner.class); - Assertions.assertEquals("alm", model.versions().get("a").available().get(0).friendlyName()); - Assertions.assertEquals("tdaaygdvwvg", model.versions().get("a").available().get(0).displayName()); - Assertions.assertEquals(true, model.versions().get("a").available().get(0).isDefault()); - Assertions.assertEquals("wxrt", - model.versions().get("a").available().get(0).componentVersions().get("udxepxgyqagv")); - Assertions.assertEquals("r", model.regions().get("nwxuqlcvydyp").available().get(0)); - Assertions.assertEquals("zclewyhmlw", model.features().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClientGroupInfoTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClientGroupInfoTests.java deleted file mode 100644 index 6091a60e3bab..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClientGroupInfoTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClientGroupInfo; -import org.junit.jupiter.api.Assertions; - -public final class ClientGroupInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientGroupInfo model = BinaryData.fromString("{\"groupName\":\"anuzbpzkafkuw\",\"groupId\":\"rnwb\"}") - .toObject(ClientGroupInfo.class); - Assertions.assertEquals("anuzbpzkafkuw", model.groupName()); - Assertions.assertEquals("rnwb", model.groupId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientGroupInfo model = new ClientGroupInfo().withGroupName("anuzbpzkafkuw").withGroupId("rnwb"); - model = BinaryData.fromObject(model).toObject(ClientGroupInfo.class); - Assertions.assertEquals("anuzbpzkafkuw", model.groupName()); - Assertions.assertEquals("rnwb", model.groupId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterConfigurationsInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterConfigurationsInnerTests.java deleted file mode 100644 index 6570c6aa1522..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterConfigurationsInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterConfigurationsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterConfigurationsInner model = BinaryData.fromString( - "{\"configurations\":{\"lpichk\":{\"bdbutauvf\":\"qlpqwcciuq\",\"afnn\":\"tkuwhhmhykojo\"},\"qnzarrwl\":{\"novvqfovljxy\":\"mkcdyhbpkkpwdre\",\"tgadgvraeaen\":\"suwsyrsnds\"}}}") - .toObject(ClusterConfigurationsInner.class); - Assertions.assertEquals("qlpqwcciuq", model.configurations().get("lpichk").get("bdbutauvf")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterConfigurationsInner model = new ClusterConfigurationsInner() - .withConfigurations(mapOf("lpichk", mapOf("bdbutauvf", "qlpqwcciuq", "afnn", "tkuwhhmhykojo"), "qnzarrwl", - mapOf("novvqfovljxy", "mkcdyhbpkkpwdre", "tgadgvraeaen", "suwsyrsnds"))); - model = BinaryData.fromObject(model).toObject(ClusterConfigurationsInner.class); - Assertions.assertEquals("qlpqwcciuq", model.configurations().get("lpichk").get("bdbutauvf")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterDefinitionTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterDefinitionTests.java deleted file mode 100644 index 566ffce38fea..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterDefinitionTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClusterDefinition; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterDefinitionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterDefinition model = BinaryData.fromString( - "{\"blueprint\":\"vce\",\"kind\":\"eil\",\"componentVersion\":{\"jfcn\":\"oty\",\"x\":\"bkc\",\"nv\":\"hbttkphyw\",\"qnermclfplphoxu\":\"t\"},\"configurations\":\"datarpabg\"}") - .toObject(ClusterDefinition.class); - Assertions.assertEquals("vce", model.blueprint()); - Assertions.assertEquals("eil", model.kind()); - Assertions.assertEquals("oty", model.componentVersion().get("jfcn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterDefinition model = new ClusterDefinition().withBlueprint("vce") - .withKind("eil") - .withComponentVersion(mapOf("jfcn", "oty", "x", "bkc", "nv", "hbttkphyw", "qnermclfplphoxu", "t")) - .withConfigurations("datarpabg"); - model = BinaryData.fromObject(model).toObject(ClusterDefinition.class); - Assertions.assertEquals("vce", model.blueprint()); - Assertions.assertEquals("eil", model.kind()); - Assertions.assertEquals("oty", model.componentVersion().get("jfcn")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterIdentityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterIdentityTests.java deleted file mode 100644 index 856887e78403..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterIdentityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; -import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; -import com.azure.resourcemanager.hdinsight.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterIdentity model = BinaryData.fromString( - "{\"principalId\":\"wpr\",\"tenantId\":\"lve\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"tjrip\":{\"principalId\":\"mkh\",\"clientId\":\"obbc\",\"tenantId\":\"s\"},\"t\":{\"principalId\":\"bpbewtghfgb\",\"clientId\":\"gw\",\"tenantId\":\"vlvqhjkbegi\"},\"rknftguvriuhprwm\":{\"principalId\":\"xiebwwaloayqcg\",\"clientId\":\"tzjuzgwyzmhtxo\",\"tenantId\":\"mtsavjcbpwxqp\"}}}") - .toObject(ClusterIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - Assertions.assertEquals("s", model.userAssignedIdentities().get("tjrip").tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterIdentity model = new ClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("tjrip", new UserAssignedIdentity().withTenantId("s"), "t", - new UserAssignedIdentity().withTenantId("vlvqhjkbegi"), "rknftguvriuhprwm", - new UserAssignedIdentity().withTenantId("mtsavjcbpwxqp"))); - model = BinaryData.fromObject(model).toObject(ClusterIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - Assertions.assertEquals("s", model.userAssignedIdentities().get("tjrip").tenantId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterMonitoringResponseInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterMonitoringResponseInnerTests.java deleted file mode 100644 index 253d9a5e24c1..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterMonitoringResponseInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMonitoringResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMonitoringResponseInner model - = BinaryData.fromString("{\"clusterMonitoringEnabled\":false,\"workspaceId\":\"fpubjibwwi\"}") - .toObject(ClusterMonitoringResponseInner.class); - Assertions.assertEquals(false, model.clusterMonitoringEnabled()); - Assertions.assertEquals("fpubjibwwi", model.workspaceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMonitoringResponseInner model - = new ClusterMonitoringResponseInner().withClusterMonitoringEnabled(false).withWorkspaceId("fpubjibwwi"); - model = BinaryData.fromObject(model).toObject(ClusterMonitoringResponseInner.class); - Assertions.assertEquals(false, model.clusterMonitoringEnabled()); - Assertions.assertEquals("fpubjibwwi", model.workspaceId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterPatchParametersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterPatchParametersTests.java deleted file mode 100644 index 5dc19b5ad59a..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterPatchParametersTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; -import com.azure.resourcemanager.hdinsight.models.ClusterPatchParameters; -import com.azure.resourcemanager.hdinsight.models.ResourceIdentityType; -import com.azure.resourcemanager.hdinsight.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPatchParameters model = BinaryData.fromString( - "{\"tags\":{\"iplbpodxunkbebxm\":\"bogqxndlkzgxhu\",\"oievseotgqrlltm\":\"byyntwlrbqt\",\"jefuzmuvpbttdumo\":\"wlauwzizxbmpg\",\"xe\":\"p\"},\"identity\":{\"principalId\":\"zbtbhj\",\"tenantId\":\"lkfg\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"zfikd\":{\"principalId\":\"el\",\"clientId\":\"hsd\",\"tenantId\":\"t\"}}}}") - .toObject(ClusterPatchParameters.class); - Assertions.assertEquals("bogqxndlkzgxhu", model.tags().get("iplbpodxunkbebxm")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("t", model.identity().userAssignedIdentities().get("zfikd").tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPatchParameters model = new ClusterPatchParameters() - .withTags(mapOf("iplbpodxunkbebxm", "bogqxndlkzgxhu", "oievseotgqrlltm", "byyntwlrbqt", "jefuzmuvpbttdumo", - "wlauwzizxbmpg", "xe", "p")) - .withIdentity(new ClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("zfikd", new UserAssignedIdentity().withTenantId("t")))); - model = BinaryData.fromObject(model).toObject(ClusterPatchParameters.class); - Assertions.assertEquals("bogqxndlkzgxhu", model.tags().get("iplbpodxunkbebxm")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("t", model.identity().userAssignedIdentities().get("zfikd").tenantId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterResizeParametersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterResizeParametersTests.java deleted file mode 100644 index 8840c48fe146..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClusterResizeParametersTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; -import org.junit.jupiter.api.Assertions; - -public final class ClusterResizeParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterResizeParameters model - = BinaryData.fromString("{\"targetInstanceCount\":792920613}").toObject(ClusterResizeParameters.class); - Assertions.assertEquals(792920613, model.targetInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterResizeParameters model = new ClusterResizeParameters().withTargetInstanceCount(792920613); - model = BinaryData.fromObject(model).toObject(ClusterResizeParameters.class); - Assertions.assertEquals(792920613, model.targetInstanceCount()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteMockTests.java deleted file mode 100644 index e5f5ebe57eb9..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().delete("hzjqatucoige", "xncnwfe", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsMockTests.java deleted file mode 100644 index cc4d54f21e59..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersExecuteScriptActionsMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersExecuteScriptActionsMockTests { - @Test - public void testExecuteScriptActions() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters() - .executeScriptActions("hsrrryejylmbkz", "dnigrfihot", - new ExecuteScriptActionParameters().withScriptActions(Arrays.asList( - new RuntimeScriptAction().withName("lpxuzzjgnrefq") - .withUri("hqo") - .withParameters("ihiqakydiw") - .withRoles(Arrays.asList("rkwpzdqtvhcspod", "qaxsipietgbebjf", "lbmoichd")), - new RuntimeScriptAction().withName("iqsowsaaelc") - .withUri("ttcjuhplrvkmjc") - .withParameters("jvlgfggcvkyyliz") - .withRoles(Arrays.asList("bjpsfxsfuztlvtm")), - new RuntimeScriptAction().withName("koveof") - .withUri("zrvjfnmjmvlwyzgi") - .withParameters("kujrllfojui") - .withRoles(Arrays.asList("puuyjucejik")))) - .withPersistOnSuccess(true), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeMockTests.java deleted file mode 100644 index f5e693ac363a..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersResizeMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; -import com.azure.resourcemanager.hdinsight.models.RoleName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersResizeMockTests { - @Test - public void testResize() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters() - .resize("dxxewuninv", "db", RoleName.WORKERNODE, - new ClusterResizeParameters().withTargetInstanceCount(1594166889), com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationMockTests.java deleted file mode 100644 index 41102a62ee90..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ClustersUpdateAutoScaleConfigurationMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.Autoscale; -import com.azure.resourcemanager.hdinsight.models.AutoscaleCapacity; -import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; -import com.azure.resourcemanager.hdinsight.models.AutoscaleRecurrence; -import com.azure.resourcemanager.hdinsight.models.AutoscaleSchedule; -import com.azure.resourcemanager.hdinsight.models.AutoscaleTimeAndCapacity; -import com.azure.resourcemanager.hdinsight.models.DaysOfWeek; -import com.azure.resourcemanager.hdinsight.models.RoleName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersUpdateAutoScaleConfigurationMockTests { - @Test - public void testUpdateAutoScaleConfiguration() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters() - .updateAutoScaleConfiguration("dtvqe", "rqctmxxdtdd", RoleName.WORKERNODE, - new AutoscaleConfigurationUpdateParameter() - .withAutoscale( - new Autoscale() - .withCapacity(new AutoscaleCapacity().withMinInstanceCount(1948227960) - .withMaxInstanceCount(1691518178)) - .withRecurrence( - new AutoscaleRecurrence().withTimeZone("tznapxbannovv") - .withSchedule(Arrays.asList( - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.FRIDAY, DaysOfWeek.SATURDAY, - DaysOfWeek.SATURDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity()), - new AutoscaleSchedule() - .withDays(Arrays.asList(DaysOfWeek.WEDNESDAY, DaysOfWeek.SUNDAY, - DaysOfWeek.MONDAY, DaysOfWeek.SATURDAY)) - .withTimeAndCapacity(new AutoscaleTimeAndCapacity()))))), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ComputeIsolationPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ComputeIsolationPropertiesTests.java deleted file mode 100644 index 8faecb3de0d0..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ComputeIsolationPropertiesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ComputeIsolationProperties; -import org.junit.jupiter.api.Assertions; - -public final class ComputeIsolationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeIsolationProperties model - = BinaryData.fromString("{\"enableComputeIsolation\":true,\"hostSku\":\"dhxujznbmpo\"}") - .toObject(ComputeIsolationProperties.class); - Assertions.assertEquals(true, model.enableComputeIsolation()); - Assertions.assertEquals("dhxujznbmpo", model.hostSku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeIsolationProperties model - = new ComputeIsolationProperties().withEnableComputeIsolation(true).withHostSku("dhxujznbmpo"); - model = BinaryData.fromObject(model).toObject(ComputeIsolationProperties.class); - Assertions.assertEquals(true, model.enableComputeIsolation()); - Assertions.assertEquals("dhxujznbmpo", model.hostSku()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index bcdbe23c8392..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsGetWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr = "{\"ikjcjcazt\":\"kkum\",\"comlikytwvczc\":\"wsnsqowx\",\"ve\":\"wka\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Map response = manager.configurations() - .getWithResponse("rhpw", "gddeimaw", "o", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kkum", response.get("ikjcjcazt")); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListWithResponseMockTests.java deleted file mode 100644 index b76d6b7990b8..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsListWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.ClusterConfigurations; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"configurations\":{\"uvqejosovyrrle\":{\"pedwqsl\":\"whqjjyslurlpshhk\",\"ndcbrwi\":\"rhmpqvwwsk\"}}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterConfigurations response = manager.configurations() - .listWithResponse("plkeuachtomflryt", "wfpfmdgycx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("whqjjyslurlpshhk", response.configurations().get("uvqejosovyrrle").get("pedwqsl")); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateMockTests.java deleted file mode 100644 index e4a6f9bb64a3..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConfigurationsUpdateMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.configurations() - .update("esi", "uqtljqobbpih", "hcecybmrqbr", - mapOf("s", "bmpxdlvykfrexc", "xog", "qwjksghudgz", "rkmdyom", "ggsvoujkxibdaf", "dy", "xfbvfb"), - com.azure.core.util.Context.NONE); - - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConnectivityEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConnectivityEndpointTests.java deleted file mode 100644 index a93742559b13..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ConnectivityEndpointTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ConnectivityEndpoint; -import org.junit.jupiter.api.Assertions; - -public final class ConnectivityEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectivityEndpoint model = BinaryData.fromString( - "{\"name\":\"lbg\",\"protocol\":\"duiertgcc\",\"location\":\"vaolpsslqlf\",\"port\":219002993,\"privateIPAddress\":\"bbglzpswiydmc\"}") - .toObject(ConnectivityEndpoint.class); - Assertions.assertEquals("lbg", model.name()); - Assertions.assertEquals("duiertgcc", model.protocol()); - Assertions.assertEquals("vaolpsslqlf", model.location()); - Assertions.assertEquals(219002993, model.port()); - Assertions.assertEquals("bbglzpswiydmc", model.privateIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectivityEndpoint model = new ConnectivityEndpoint().withName("lbg") - .withProtocol("duiertgcc") - .withLocation("vaolpsslqlf") - .withPort(219002993) - .withPrivateIpAddress("bbglzpswiydmc"); - model = BinaryData.fromObject(model).toObject(ConnectivityEndpoint.class); - Assertions.assertEquals("lbg", model.name()); - Assertions.assertEquals("duiertgcc", model.protocol()); - Assertions.assertEquals("vaolpsslqlf", model.location()); - Assertions.assertEquals(219002993, model.port()); - Assertions.assertEquals("bbglzpswiydmc", model.privateIpAddress()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DataDisksGroupsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DataDisksGroupsTests.java deleted file mode 100644 index 0cf5df59fb3a..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DataDisksGroupsTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.DataDisksGroups; -import org.junit.jupiter.api.Assertions; - -public final class DataDisksGroupsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataDisksGroups model = BinaryData - .fromString("{\"disksPerNode\":1173289641,\"storageAccountType\":\"qyud\",\"diskSizeGB\":2120884016}") - .toObject(DataDisksGroups.class); - Assertions.assertEquals(1173289641, model.disksPerNode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataDisksGroups model = new DataDisksGroups().withDisksPerNode(1173289641); - model = BinaryData.fromObject(model).toObject(DataDisksGroups.class); - Assertions.assertEquals(1173289641, model.disksPerNode()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DimensionTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DimensionTests.java deleted file mode 100644 index 218a0bb7d333..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DimensionTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Dimension; -import org.junit.jupiter.api.Assertions; - -public final class DimensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Dimension model = BinaryData.fromString( - "{\"name\":\"gg\",\"displayName\":\"pijrajcivmmghf\",\"internalName\":\"iwrxgkn\",\"toBeExportedForShoebox\":false}") - .toObject(Dimension.class); - Assertions.assertEquals("gg", model.name()); - Assertions.assertEquals("pijrajcivmmghf", model.displayName()); - Assertions.assertEquals("iwrxgkn", model.internalName()); - Assertions.assertEquals(false, model.toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Dimension model = new Dimension().withName("gg") - .withDisplayName("pijrajcivmmghf") - .withInternalName("iwrxgkn") - .withToBeExportedForShoebox(false); - model = BinaryData.fromObject(model).toObject(Dimension.class); - Assertions.assertEquals("gg", model.name()); - Assertions.assertEquals("pijrajcivmmghf", model.displayName()); - Assertions.assertEquals("iwrxgkn", model.internalName()); - Assertions.assertEquals(false, model.toBeExportedForShoebox()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DiskBillingMetersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DiskBillingMetersTests.java deleted file mode 100644 index f6b37c9a1bad..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/DiskBillingMetersTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.DiskBillingMeters; -import com.azure.resourcemanager.hdinsight.models.Tier; -import org.junit.jupiter.api.Assertions; - -public final class DiskBillingMetersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskBillingMeters model - = BinaryData.fromString("{\"diskRpMeter\":\"ydfce\",\"sku\":\"vlhv\",\"tier\":\"Premium\"}") - .toObject(DiskBillingMeters.class); - Assertions.assertEquals("ydfce", model.diskRpMeter()); - Assertions.assertEquals("vlhv", model.sku()); - Assertions.assertEquals(Tier.PREMIUM, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskBillingMeters model - = new DiskBillingMeters().withDiskRpMeter("ydfce").withSku("vlhv").withTier(Tier.PREMIUM); - model = BinaryData.fromObject(model).toObject(DiskBillingMeters.class); - Assertions.assertEquals("ydfce", model.diskRpMeter()); - Assertions.assertEquals("vlhv", model.sku()); - Assertions.assertEquals(Tier.PREMIUM, model.tier()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/EncryptionInTransitPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/EncryptionInTransitPropertiesTests.java deleted file mode 100644 index 8d76d150533d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/EncryptionInTransitPropertiesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.EncryptionInTransitProperties; -import org.junit.jupiter.api.Assertions; - -public final class EncryptionInTransitPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EncryptionInTransitProperties model = BinaryData.fromString("{\"isEncryptionInTransitEnabled\":false}") - .toObject(EncryptionInTransitProperties.class); - Assertions.assertEquals(false, model.isEncryptionInTransitEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EncryptionInTransitProperties model - = new EncryptionInTransitProperties().withIsEncryptionInTransitEnabled(false); - model = BinaryData.fromObject(model).toObject(EncryptionInTransitProperties.class); - Assertions.assertEquals(false, model.isEncryptionInTransitEnabled()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExcludedServicesConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExcludedServicesConfigTests.java deleted file mode 100644 index 12f7b9ad7838..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExcludedServicesConfigTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ExcludedServicesConfig; -import org.junit.jupiter.api.Assertions; - -public final class ExcludedServicesConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExcludedServicesConfig model = BinaryData - .fromString("{\"excludedServicesConfigId\":\"hzdxssadbzm\",\"excludedServicesList\":\"dfznudaodv\"}") - .toObject(ExcludedServicesConfig.class); - Assertions.assertEquals("hzdxssadbzm", model.excludedServicesConfigId()); - Assertions.assertEquals("dfznudaodv", model.excludedServicesList()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExcludedServicesConfig model = new ExcludedServicesConfig().withExcludedServicesConfigId("hzdxssadbzm") - .withExcludedServicesList("dfznudaodv"); - model = BinaryData.fromObject(model).toObject(ExcludedServicesConfig.class); - Assertions.assertEquals("hzdxssadbzm", model.excludedServicesConfigId()); - Assertions.assertEquals("dfznudaodv", model.excludedServicesList()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExecuteScriptActionParametersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExecuteScriptActionParametersTests.java deleted file mode 100644 index 3f84874b861e..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExecuteScriptActionParametersTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExecuteScriptActionParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExecuteScriptActionParameters model = BinaryData.fromString( - "{\"scriptActions\":[{\"name\":\"ddjib\",\"uri\":\"bxv\",\"parameters\":\"itvtzeexavo\",\"roles\":[\"fglecdmdqbwp\",\"pqtgsfjac\"],\"applicationName\":\"lhhxudbxvodhtnsi\"},{\"name\":\"ud\",\"uri\":\"z\",\"parameters\":\"es\",\"roles\":[\"dlpagzrcxfail\",\"f\"],\"applicationName\":\"m\"}],\"persistOnSuccess\":true}") - .toObject(ExecuteScriptActionParameters.class); - Assertions.assertEquals("ddjib", model.scriptActions().get(0).name()); - Assertions.assertEquals("bxv", model.scriptActions().get(0).uri()); - Assertions.assertEquals("itvtzeexavo", model.scriptActions().get(0).parameters()); - Assertions.assertEquals("fglecdmdqbwp", model.scriptActions().get(0).roles().get(0)); - Assertions.assertEquals(true, model.persistOnSuccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExecuteScriptActionParameters model = new ExecuteScriptActionParameters().withScriptActions(Arrays.asList( - new RuntimeScriptAction().withName("ddjib") - .withUri("bxv") - .withParameters("itvtzeexavo") - .withRoles(Arrays.asList("fglecdmdqbwp", "pqtgsfjac")), - new RuntimeScriptAction().withName("ud") - .withUri("z") - .withParameters("es") - .withRoles(Arrays.asList("dlpagzrcxfail", "f")))) - .withPersistOnSuccess(true); - model = BinaryData.fromObject(model).toObject(ExecuteScriptActionParameters.class); - Assertions.assertEquals("ddjib", model.scriptActions().get(0).name()); - Assertions.assertEquals("bxv", model.scriptActions().get(0).uri()); - Assertions.assertEquals("itvtzeexavo", model.scriptActions().get(0).parameters()); - Assertions.assertEquals("fglecdmdqbwp", model.scriptActions().get(0).roles().get(0)); - Assertions.assertEquals(true, model.persistOnSuccess()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteMockTests.java deleted file mode 100644 index 0849467c463f..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions().delete("luzvxnq", "hrpq", "df", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentMockTests.java deleted file mode 100644 index c4986986e988..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorAgentMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDisableAzureMonitorAgentMockTests { - @Test - public void testDisableAzureMonitorAgent() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions().disableAzureMonitorAgent("psmgo", "guamlj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorMockTests.java deleted file mode 100644 index 47f19828c17d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableAzureMonitorMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDisableAzureMonitorMockTests { - @Test - public void testDisableAzureMonitor() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions().disableAzureMonitor("gygqwah", "iul", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringMockTests.java deleted file mode 100644 index cbf6ce3f42be..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsDisableMonitoringMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDisableMonitoringMockTests { - @Test - public void testDisableMonitoring() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions().disableMonitoring("klelssxb", "ycsxzu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusWithResponseMockTests.java deleted file mode 100644 index d6bfe11af499..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorAgentStatusWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetAzureMonitorAgentStatusWithResponseMockTests { - @Test - public void testGetAzureMonitorAgentStatusWithResponse() throws Exception { - String responseStr - = "{\"clusterMonitoringEnabled\":false,\"workspaceId\":\"oknssqyzqedikdf\",\"selectedConfigurations\":{\"configurationVersion\":\"iqmrjgeihfqlggw\",\"globalConfigurations\":{\"mgtvlj\":\"zcxmjpbyep\",\"yfqi\":\"rc\",\"ui\":\"gxhnpomyqwcabv\",\"augmrmfjlr\":\"eeyaswl\"},\"tableList\":[{\"name\":\"aukhfkvcisiz\"},{\"name\":\"a\"},{\"name\":\"sx\"},{\"name\":\"uivedwcgyeewxeiq\"}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureMonitorResponse response = manager.extensions() - .getAzureMonitorAgentStatusWithResponse("mhbrbqgvg", "vpbbt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.clusterMonitoringEnabled()); - Assertions.assertEquals("oknssqyzqedikdf", response.workspaceId()); - Assertions.assertEquals("iqmrjgeihfqlggw", response.selectedConfigurations().configurationVersion()); - Assertions.assertEquals("zcxmjpbyep", response.selectedConfigurations().globalConfigurations().get("mgtvlj")); - Assertions.assertEquals("aukhfkvcisiz", response.selectedConfigurations().tableList().get(0).name()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusWithResponseMockTests.java deleted file mode 100644 index 2b564566b760..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetAzureMonitorStatusWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.AzureMonitorResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetAzureMonitorStatusWithResponseMockTests { - @Test - public void testGetAzureMonitorStatusWithResponse() throws Exception { - String responseStr - = "{\"clusterMonitoringEnabled\":true,\"workspaceId\":\"khvuhxepmrutz\",\"selectedConfigurations\":{\"configurationVersion\":\"aobn\",\"globalConfigurations\":{\"ywart\":\"jdjltymkmvgui\",\"j\":\"pphkixkykxds\",\"kkflrmymyincqlhr\":\"emmucfxh\"},\"tableList\":[{\"name\":\"lmiiiovg\"},{\"name\":\"gxuugqkctotio\"},{\"name\":\"xteqdptjgwdtg\"},{\"name\":\"ranblwphqlkccu\"}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureMonitorResponse response = manager.extensions() - .getAzureMonitorStatusWithResponse("fsxzecp", "xw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.clusterMonitoringEnabled()); - Assertions.assertEquals("khvuhxepmrutz", response.workspaceId()); - Assertions.assertEquals("aobn", response.selectedConfigurations().configurationVersion()); - Assertions.assertEquals("jdjltymkmvgui", response.selectedConfigurations().globalConfigurations().get("ywart")); - Assertions.assertEquals("lmiiiovg", response.selectedConfigurations().tableList().get(0).name()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusWithResponseMockTests.java deleted file mode 100644 index 43e192fdc62d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetMonitoringStatusWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetMonitoringStatusWithResponseMockTests { - @Test - public void testGetMonitoringStatusWithResponse() throws Exception { - String responseStr = "{\"clusterMonitoringEnabled\":true,\"workspaceId\":\"eeczgfbu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterMonitoringResponse response = manager.extensions() - .getMonitoringStatusWithResponse("sggux", "eml", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.clusterMonitoringEnabled()); - Assertions.assertEquals("eeczgfbu", response.workspaceId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetWithResponseMockTests.java deleted file mode 100644 index 69ce5dca3f02..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ExtensionsGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr = "{\"clusterMonitoringEnabled\":true,\"workspaceId\":\"hvyoma\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterMonitoringResponse response = manager.extensions() - .getWithResponse("xcy", "hkgmnsg", "pxycphdr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.clusterMonitoringEnabled()); - Assertions.assertEquals("hvyoma", response.workspaceId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/HardwareProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/HardwareProfileTests.java deleted file mode 100644 index ede667fa5396..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/HardwareProfileTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.HardwareProfile; -import org.junit.jupiter.api.Assertions; - -public final class HardwareProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareProfile model = BinaryData.fromString("{\"vmSize\":\"trpmo\"}").toObject(HardwareProfile.class); - Assertions.assertEquals("trpmo", model.vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareProfile model = new HardwareProfile().withVmSize("trpmo"); - model = BinaryData.fromObject(model).toObject(HardwareProfile.class); - Assertions.assertEquals("trpmo", model.vmSize()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationPropertiesTests.java deleted file mode 100644 index de4f3702526c..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.IpConfigurationProperties; -import com.azure.resourcemanager.hdinsight.models.PrivateIpAllocationMethod; -import com.azure.resourcemanager.hdinsight.models.ResourceId; -import org.junit.jupiter.api.Assertions; - -public final class IpConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpConfigurationProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Deleting\",\"primary\":false,\"privateIPAddress\":\"yq\",\"privateIPAllocationMethod\":\"dynamic\",\"subnet\":{\"id\":\"j\"}}") - .toObject(IpConfigurationProperties.class); - Assertions.assertEquals(false, model.primary()); - Assertions.assertEquals("yq", model.privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.DYNAMIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("j", model.subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpConfigurationProperties model = new IpConfigurationProperties().withPrimary(false) - .withPrivateIpAddress("yq") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.DYNAMIC) - .withSubnet(new ResourceId().withId("j")); - model = BinaryData.fromObject(model).toObject(IpConfigurationProperties.class); - Assertions.assertEquals(false, model.primary()); - Assertions.assertEquals("yq", model.privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.DYNAMIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("j", model.subnet().id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationTests.java deleted file mode 100644 index 497924249753..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpConfigurationTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.IpConfiguration; -import com.azure.resourcemanager.hdinsight.models.PrivateIpAllocationMethod; -import com.azure.resourcemanager.hdinsight.models.ResourceId; -import org.junit.jupiter.api.Assertions; - -public final class IpConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpConfiguration model = BinaryData.fromString( - "{\"id\":\"tvfcivfsn\",\"name\":\"ymuctqhjfbebrj\",\"type\":\"erfuwuttt\",\"properties\":{\"provisioningState\":\"Failed\",\"primary\":true,\"privateIPAddress\":\"rp\",\"privateIPAllocationMethod\":\"static\",\"subnet\":{\"id\":\"yva\"}}}") - .toObject(IpConfiguration.class); - Assertions.assertEquals("ymuctqhjfbebrj", model.name()); - Assertions.assertEquals(true, model.primary()); - Assertions.assertEquals("rp", model.privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("yva", model.subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpConfiguration model = new IpConfiguration().withName("ymuctqhjfbebrj") - .withPrimary(true) - .withPrivateIpAddress("rp") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.STATIC) - .withSubnet(new ResourceId().withId("yva")); - model = BinaryData.fromObject(model).toObject(IpConfiguration.class); - Assertions.assertEquals("ymuctqhjfbebrj", model.name()); - Assertions.assertEquals(true, model.primary()); - Assertions.assertEquals("rp", model.privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("yva", model.subnet().id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpTagTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpTagTests.java deleted file mode 100644 index 9af4af7f35a5..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/IpTagTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.IpTag; -import org.junit.jupiter.api.Assertions; - -public final class IpTagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpTag model = BinaryData.fromString("{\"ipTagType\":\"klwndnhjdauwhv\",\"tag\":\"l\"}").toObject(IpTag.class); - Assertions.assertEquals("klwndnhjdauwhv", model.ipTagType()); - Assertions.assertEquals("l", model.tag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpTag model = new IpTag().withIpTagType("klwndnhjdauwhv").withTag("l"); - model = BinaryData.fromObject(model).toObject(IpTag.class); - Assertions.assertEquals("klwndnhjdauwhv", model.ipTagType()); - Assertions.assertEquals("l", model.tag()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/KafkaRestPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/KafkaRestPropertiesTests.java deleted file mode 100644 index 536b70edfe6d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/KafkaRestPropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ClientGroupInfo; -import com.azure.resourcemanager.hdinsight.models.KafkaRestProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KafkaRestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KafkaRestProperties model = BinaryData.fromString( - "{\"clientGroupInfo\":{\"groupName\":\"sbj\",\"groupId\":\"zq\"},\"configurationOverride\":{\"jidsuyonobglaoc\":\"ywpmueefjzwfqkq\",\"udxytlmoyrx\":\"xtccmg\",\"qj\":\"wfudwpzntxhdzhl\",\"bkyvp\":\"hckfrlhrx\"}}") - .toObject(KafkaRestProperties.class); - Assertions.assertEquals("sbj", model.clientGroupInfo().groupName()); - Assertions.assertEquals("zq", model.clientGroupInfo().groupId()); - Assertions.assertEquals("ywpmueefjzwfqkq", model.configurationOverride().get("jidsuyonobglaoc")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KafkaRestProperties model = new KafkaRestProperties() - .withClientGroupInfo(new ClientGroupInfo().withGroupName("sbj").withGroupId("zq")) - .withConfigurationOverride(mapOf("jidsuyonobglaoc", "ywpmueefjzwfqkq", "udxytlmoyrx", "xtccmg", "qj", - "wfudwpzntxhdzhl", "bkyvp", "hckfrlhrx")); - model = BinaryData.fromObject(model).toObject(KafkaRestProperties.class); - Assertions.assertEquals("sbj", model.clientGroupInfo().groupName()); - Assertions.assertEquals("zq", model.clientGroupInfo().groupId()); - Assertions.assertEquals("ywpmueefjzwfqkq", model.configurationOverride().get("jidsuyonobglaoc")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocalizedNameTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocalizedNameTests.java deleted file mode 100644 index 434e70e8f90c..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocalizedNameTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.LocalizedName; -import org.junit.jupiter.api.Assertions; - -public final class LocalizedNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocalizedName model = BinaryData.fromString("{\"value\":\"rdgrtw\",\"localizedValue\":\"nuuzkopbm\"}") - .toObject(LocalizedName.class); - Assertions.assertEquals("rdgrtw", model.value()); - Assertions.assertEquals("nuuzkopbm", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocalizedName model = new LocalizedName().withValue("rdgrtw").withLocalizedValue("nuuzkopbm"); - model = BinaryData.fromObject(model).toObject(LocalizedName.class); - Assertions.assertEquals("rdgrtw", model.value()); - Assertions.assertEquals("nuuzkopbm", model.localizedValue()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 2eb82a6012fc..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsCheckNameAvailabilityWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.NameAvailabilityCheckRequestParameters; -import com.azure.resourcemanager.hdinsight.models.NameAvailabilityCheckResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"rrslblxydkx\",\"message\":\"vvbxiwkgfbqljnq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailabilityCheckResult response = manager.locations() - .checkNameAvailabilityWithResponse("sczuejdtxptlghwz", - new NameAvailabilityCheckRequestParameters().withName("mewjjstliuhq").withType("moaiancz"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesWithResponseMockTests.java deleted file mode 100644 index 9f18449877fd..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsGetCapabilitiesWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.CapabilitiesResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationsGetCapabilitiesWithResponseMockTests { - @Test - public void testGetCapabilitiesWithResponse() throws Exception { - String responseStr - = "{\"versions\":{\"oyueayfbpcmsp\":{\"available\":[{\"friendlyName\":\"qbnqbpizxqltgrdo\",\"displayName\":\"pxrxvbfihwu\",\"isDefault\":true,\"componentVersions\":{\"rblmli\":\"fsrb\"}},{\"friendlyName\":\"xihspnxwq\",\"displayName\":\"nepzwakls\",\"isDefault\":true,\"componentVersions\":{\"sgl\":\"qagwwrxaomz\",\"jadhqoawj\":\"rczezkhhlt\"}}]},\"fiqwoy\":{\"available\":[{\"friendlyName\":\"rueqthwm\",\"displayName\":\"mbscbbx\",\"isDefault\":true,\"componentVersions\":{\"dbwdpyqyybxubmdn\":\"iidlop\",\"acigel\":\"fcbqwremjela\",\"pwbeonr\":\"ohdbvqvwzkj\"}},{\"friendlyName\":\"wzdqybxceakxcpts\",\"displayName\":\"fyiaseqch\",\"isDefault\":true,\"componentVersions\":{\"kiuemv\":\"razisg\",\"klinhmdptysprq\":\"nbwzohmnrxxbso\",\"pli\":\"gnzxojpslsvj\"}}]},\"cxneh\":{\"available\":[{\"friendlyName\":\"pcohhoucqpqojx\",\"displayName\":\"zrzdcgd\",\"isDefault\":false,\"componentVersions\":{\"ljhznamtuatmzwcj\":\"ibcawetzqddtjw\",\"tjzmi\":\"nc\",\"ebwgga\":\"vgbgatzuuvbxng\",\"oqza\":\"ttzlswvajqfutlx\"}},{\"friendlyName\":\"nwqrjzfrgqh\",\"displayName\":\"hcmbuocnjrohmbp\",\"isDefault\":false,\"componentVersions\":{\"vkfkmr\":\"meblyd\"}}]}},\"regions\":{\"gvvpasek\":{\"available\":[\"dlfp\",\"apucygvo\",\"vyuns\",\"xlghieegj\"]},\"mjnlexwhcb\":{\"available\":[\"uxantuygdhgaqipi\",\"piwrqofu\",\"o\"]}},\"features\":[\"bke\",\"hu\"],\"quota\":{\"coresUsed\":5032005553771086807,\"maxCoresAllowed\":5825591327077815588,\"regionalQuotas\":[{\"regionName\":\"ntqpbr\",\"coresUsed\":7453365577501286272,\"coresAvailable\":5915975308764094349},{\"regionName\":\"kg\",\"coresUsed\":3170849573195747250,\"coresAvailable\":5670456401736991740},{\"regionName\":\"cvcrrp\",\"coresUsed\":5679636640607196195,\"coresAvailable\":1765568550536459632}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CapabilitiesResult response = manager.locations() - .getCapabilitiesWithResponse("rdcoxnbkkj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qbnqbpizxqltgrdo", - response.versions().get("oyueayfbpcmsp").available().get(0).friendlyName()); - Assertions.assertEquals("pxrxvbfihwu", - response.versions().get("oyueayfbpcmsp").available().get(0).displayName()); - Assertions.assertEquals(true, response.versions().get("oyueayfbpcmsp").available().get(0).isDefault()); - Assertions.assertEquals("fsrb", - response.versions().get("oyueayfbpcmsp").available().get(0).componentVersions().get("rblmli")); - Assertions.assertEquals("dlfp", response.regions().get("gvvpasek").available().get(0)); - Assertions.assertEquals("bke", response.features().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsWithResponseMockTests.java deleted file mode 100644 index 2b780d4e99b4..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListBillingSpecsWithResponseMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.BillingResponseListResult; -import com.azure.resourcemanager.hdinsight.models.FilterMode; -import com.azure.resourcemanager.hdinsight.models.OSType; -import com.azure.resourcemanager.hdinsight.models.Tier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationsListBillingSpecsWithResponseMockTests { - @Test - public void testListBillingSpecsWithResponse() throws Exception { - String responseStr - = "{\"vmSizes\":[\"gbrt\",\"uiaclkiexhajlfn\"],\"vmSizesWithEncryptionAtHost\":[\"qfyuttd\",\"ygbpvnwswmt\",\"k\"],\"vmSizeFilters\":[{\"filterMode\":\"Default\",\"regions\":[\"wxjlmec\",\"og\"],\"clusterFlavors\":[\"yvneeza\",\"fg\",\"tmoqqtlffhzb\",\"rkjjjavfqnvhnq\"],\"nodeTypes\":[\"dogiyetesyp\",\"idbz\",\"jhqt\"],\"clusterVersions\":[\"vnynkb\",\"etnjuhpsprkz\",\"aupia\",\"cxnafbwqrooh\"],\"osType\":[\"Linux\",\"Windows\",\"Linux\"],\"vmSizes\":[\"urjtumghi\"],\"espApplied\":\"ve\",\"computeIsolationSupported\":\"slclblyjxltbsju\"},{\"filterMode\":\"Default\",\"regions\":[\"xigc\"],\"clusterFlavors\":[\"xu\",\"pbezqccydrtceu\",\"d\",\"kkyihzt\"],\"nodeTypes\":[\"mgqzgwldoyc\"],\"clusterVersions\":[\"lcecfeh\",\"waoaguhi\",\"qllizstac\",\"jvhrweft\"],\"osType\":[\"Linux\",\"Windows\",\"Linux\",\"Windows\"],\"vmSizes\":[\"s\"],\"espApplied\":\"aepwamcxtcz\",\"computeIsolationSupported\":\"peuknijd\"}],\"vmSizeProperties\":[{\"name\":\"spyd\",\"cores\":170648646,\"dataDiskStorageTier\":\"c\",\"label\":\"hhulrtywikdm\",\"maxDataDiskCount\":8125875686859497328,\"memoryInMb\":8589946500530915839,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":1422437735145461244,\"webWorkerResourceDiskSizeInMb\":4631933065455269635},{\"name\":\"mxu\",\"cores\":665007263,\"dataDiskStorageTier\":\"yjq\",\"label\":\"kfnozoeoqbvj\",\"maxDataDiskCount\":1136473991978940820,\"memoryInMb\":3118293287303219985,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":false,\"virtualMachineResourceDiskSizeInMb\":2962662676791309250,\"webWorkerResourceDiskSizeInMb\":2279733952870508149},{\"name\":\"ymxbulpzealb\",\"cores\":204967420,\"dataDiskStorageTier\":\"ojwyvf\",\"label\":\"btsuahxs\",\"maxDataDiskCount\":3253463579939415002,\"memoryInMb\":6128823487295073104,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":false,\"virtualMachineResourceDiskSizeInMb\":5228689904808376707,\"webWorkerResourceDiskSizeInMb\":1482066446768394569},{\"name\":\"npxqwodi\",\"cores\":1160303234,\"dataDiskStorageTier\":\"cjrmmua\",\"label\":\"ibvjogjonmcy\",\"maxDataDiskCount\":6735107623298340704,\"memoryInMb\":9033210529539978303,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":false,\"virtualMachineResourceDiskSizeInMb\":5845997176249673648,\"webWorkerResourceDiskSizeInMb\":4142402580801552647}],\"billingResources\":[{\"region\":\"oldtvevboclzhz\",\"billingMeters\":[{\"meterParameter\":\"uxgvttxpnr\",\"meter\":\"zaamrdixtrekid\",\"unit\":\"yskbruff\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"k\",\"sku\":\"tvlxhrpqh\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"couqehb\",\"sku\":\"cdsziryrand\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"blto\",\"sku\":\"mkfqlwxldy\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"ygaolnjpnnb\",\"sku\":\"ksibjgsjjxx\",\"tier\":\"Standard\"}]},{\"region\":\"nadzyq\",\"billingMeters\":[{\"meterParameter\":\"iv\",\"meter\":\"nbm\",\"unit\":\"bjijkgqxnh\"},{\"meterParameter\":\"keznjaujvaa\",\"meter\":\"ggiycwkdtaawxwf\",\"unit\":\"aumrrqmbzmqkrat\"},{\"meterParameter\":\"xwbjs\",\"meter\":\"birkfpksokdg\",\"unit\":\"ewijymrhbguz\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"ewnf\",\"sku\":\"hhhqosm\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"utycyarnroohguab\",\"sku\":\"ghktdpy\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"oeocnhzqrott\",\"sku\":\"cfyjzp\",\"tier\":\"Standard\"},{\"diskRpMeter\":\"ohapqinfsz\",\"sku\":\"glqdhm\",\"tier\":\"Premium\"}]},{\"region\":\"alcxpjbyy\",\"billingMeters\":[{\"meterParameter\":\"qcjenkyhf\",\"meter\":\"vsqxfxjelgcmpzqj\",\"unit\":\"hqxu\"},{\"meterParameter\":\"vcacoyv\",\"meter\":\"bsizus\",\"unit\":\"zlbscmnlziji\"},{\"meterParameter\":\"ehgmvflnwyv\",\"meter\":\"xrerlniylylyf\",\"unit\":\"zutgqztwhghmupg\"},{\"meterParameter\":\"jtcdxabbujftaben\",\"meter\":\"klqpx\",\"unit\":\"cafeddw\"}],\"diskBillingMeters\":[{\"diskRpMeter\":\"a\",\"sku\":\"xud\",\"tier\":\"Premium\"},{\"diskRpMeter\":\"ookrtalvnbw\",\"sku\":\"bemeluclvd\",\"tier\":\"Premium\"}]}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingResponseListResult response - = manager.locations().listBillingSpecsWithResponse("qa", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("gbrt", response.vmSizes().get(0)); - Assertions.assertEquals("qfyuttd", response.vmSizesWithEncryptionAtHost().get(0)); - Assertions.assertEquals(FilterMode.DEFAULT, response.vmSizeFilters().get(0).filterMode()); - Assertions.assertEquals("wxjlmec", response.vmSizeFilters().get(0).regions().get(0)); - Assertions.assertEquals("yvneeza", response.vmSizeFilters().get(0).clusterFlavors().get(0)); - Assertions.assertEquals("dogiyetesyp", response.vmSizeFilters().get(0).nodeTypes().get(0)); - Assertions.assertEquals("vnynkb", response.vmSizeFilters().get(0).clusterVersions().get(0)); - Assertions.assertEquals(OSType.LINUX, response.vmSizeFilters().get(0).osType().get(0)); - Assertions.assertEquals("urjtumghi", response.vmSizeFilters().get(0).vmSizes().get(0)); - Assertions.assertEquals("ve", response.vmSizeFilters().get(0).espApplied()); - Assertions.assertEquals("slclblyjxltbsju", response.vmSizeFilters().get(0).computeIsolationSupported()); - Assertions.assertEquals("oldtvevboclzhz", response.billingResources().get(0).region()); - Assertions.assertEquals("uxgvttxpnr", - response.billingResources().get(0).billingMeters().get(0).meterParameter()); - Assertions.assertEquals("zaamrdixtrekid", response.billingResources().get(0).billingMeters().get(0).meter()); - Assertions.assertEquals("yskbruff", response.billingResources().get(0).billingMeters().get(0).unit()); - Assertions.assertEquals("k", response.billingResources().get(0).diskBillingMeters().get(0).diskRpMeter()); - Assertions.assertEquals("tvlxhrpqh", response.billingResources().get(0).diskBillingMeters().get(0).sku()); - Assertions.assertEquals(Tier.PREMIUM, response.billingResources().get(0).diskBillingMeters().get(0).tier()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesWithResponseMockTests.java deleted file mode 100644 index e74e3557e845..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/LocationsListUsagesWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.UsagesListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationsListUsagesWithResponseMockTests { - @Test - public void testListUsagesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"unit\":\"uidvrmazlpdwwex\",\"currentValue\":8913959723686771783,\"limit\":3631683090324496952,\"name\":{\"value\":\"bhpwvqsgnyy\",\"localizedValue\":\"ziven\"}},{\"unit\":\"pmeyyvpkpatlbijp\",\"currentValue\":7653783145819772188,\"limit\":6070721512636115339,\"name\":{\"value\":\"v\",\"localizedValue\":\"mknbnxwcdommpv\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UsagesListResult response = manager.locations() - .listUsagesWithResponse("vjeaqnrmvvfkoxml", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uidvrmazlpdwwex", response.value().get(0).unit()); - Assertions.assertEquals(8913959723686771783L, response.value().get(0).currentValue()); - Assertions.assertEquals(3631683090324496952L, response.value().get(0).limit()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/MetricSpecificationsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/MetricSpecificationsTests.java deleted file mode 100644 index 8b9e386e168d..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/MetricSpecificationsTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Dimension; -import com.azure.resourcemanager.hdinsight.models.MetricSpecifications; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricSpecificationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricSpecifications model = BinaryData.fromString( - "{\"name\":\"g\",\"displayName\":\"joxslhvnhla\",\"displayDescription\":\"q\",\"unit\":\"kzjcjbtrgae\",\"aggregationType\":\"vibr\",\"supportedAggregationTypes\":[\"s\"],\"supportedTimeGrainTypes\":[\"beitpkx\",\"tmo\",\"bklftidgfcwqmpim\",\"qxzhem\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"hujswtwkozzwcul\",\"sourceMdmNamespace\":\"awpfajnjwltlwtjj\",\"metricFilterPattern\":\"ktalhsnvkcdmxz\",\"fillGapWithZero\":false,\"category\":\"imlnwiaaomylw\",\"resourceIdDimensionNameOverride\":\"z\",\"isInternal\":false,\"delegateMetricNameOverride\":\"ethwwnpjhlfz\",\"dimensions\":[{\"name\":\"hwahfbousn\",\"displayName\":\"pgfewetwlyx\",\"internalName\":\"cxy\",\"toBeExportedForShoebox\":true},{\"name\":\"jhlimmbcxfhbcpo\",\"displayName\":\"vxcjzhqizxfpxtgq\",\"internalName\":\"javftjuhdqa\",\"toBeExportedForShoebox\":false}]}") - .toObject(MetricSpecifications.class); - Assertions.assertEquals("g", model.name()); - Assertions.assertEquals("joxslhvnhla", model.displayName()); - Assertions.assertEquals("q", model.displayDescription()); - Assertions.assertEquals("kzjcjbtrgae", model.unit()); - Assertions.assertEquals("vibr", model.aggregationType()); - Assertions.assertEquals("s", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("beitpkx", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.enableRegionalMdmAccount()); - Assertions.assertEquals("hujswtwkozzwcul", model.sourceMdmAccount()); - Assertions.assertEquals("awpfajnjwltlwtjj", model.sourceMdmNamespace()); - Assertions.assertEquals("ktalhsnvkcdmxz", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("imlnwiaaomylw", model.category()); - Assertions.assertEquals("z", model.resourceIdDimensionNameOverride()); - Assertions.assertEquals(false, model.isInternal()); - Assertions.assertEquals("ethwwnpjhlfz", model.delegateMetricNameOverride()); - Assertions.assertEquals("hwahfbousn", model.dimensions().get(0).name()); - Assertions.assertEquals("pgfewetwlyx", model.dimensions().get(0).displayName()); - Assertions.assertEquals("cxy", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecifications model = new MetricSpecifications().withName("g") - .withDisplayName("joxslhvnhla") - .withDisplayDescription("q") - .withUnit("kzjcjbtrgae") - .withAggregationType("vibr") - .withSupportedAggregationTypes(Arrays.asList("s")) - .withSupportedTimeGrainTypes(Arrays.asList("beitpkx", "tmo", "bklftidgfcwqmpim", "qxzhem")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("hujswtwkozzwcul") - .withSourceMdmNamespace("awpfajnjwltlwtjj") - .withMetricFilterPattern("ktalhsnvkcdmxz") - .withFillGapWithZero(false) - .withCategory("imlnwiaaomylw") - .withResourceIdDimensionNameOverride("z") - .withIsInternal(false) - .withDelegateMetricNameOverride("ethwwnpjhlfz") - .withDimensions(Arrays.asList( - new Dimension().withName("hwahfbousn") - .withDisplayName("pgfewetwlyx") - .withInternalName("cxy") - .withToBeExportedForShoebox(true), - new Dimension().withName("jhlimmbcxfhbcpo") - .withDisplayName("vxcjzhqizxfpxtgq") - .withInternalName("javftjuhdqa") - .withToBeExportedForShoebox(false))); - model = BinaryData.fromObject(model).toObject(MetricSpecifications.class); - Assertions.assertEquals("g", model.name()); - Assertions.assertEquals("joxslhvnhla", model.displayName()); - Assertions.assertEquals("q", model.displayDescription()); - Assertions.assertEquals("kzjcjbtrgae", model.unit()); - Assertions.assertEquals("vibr", model.aggregationType()); - Assertions.assertEquals("s", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("beitpkx", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.enableRegionalMdmAccount()); - Assertions.assertEquals("hujswtwkozzwcul", model.sourceMdmAccount()); - Assertions.assertEquals("awpfajnjwltlwtjj", model.sourceMdmNamespace()); - Assertions.assertEquals("ktalhsnvkcdmxz", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("imlnwiaaomylw", model.category()); - Assertions.assertEquals("z", model.resourceIdDimensionNameOverride()); - Assertions.assertEquals(false, model.isInternal()); - Assertions.assertEquals("ethwwnpjhlfz", model.delegateMetricNameOverride()); - Assertions.assertEquals("hwahfbousn", model.dimensions().get(0).name()); - Assertions.assertEquals("pgfewetwlyx", model.dimensions().get(0).displayName()); - Assertions.assertEquals("cxy", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckRequestParametersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckRequestParametersTests.java deleted file mode 100644 index 7e71b3d65ba2..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckRequestParametersTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.NameAvailabilityCheckRequestParameters; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityCheckRequestParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityCheckRequestParameters model - = BinaryData.fromString("{\"name\":\"ftumrtwnawjslbiw\",\"type\":\"jgcyztsfmznba\"}") - .toObject(NameAvailabilityCheckRequestParameters.class); - Assertions.assertEquals("ftumrtwnawjslbiw", model.name()); - Assertions.assertEquals("jgcyztsfmznba", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityCheckRequestParameters model - = new NameAvailabilityCheckRequestParameters().withName("ftumrtwnawjslbiw").withType("jgcyztsfmznba"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityCheckRequestParameters.class); - Assertions.assertEquals("ftumrtwnawjslbiw", model.name()); - Assertions.assertEquals("jgcyztsfmznba", model.type()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckResultInnerTests.java deleted file mode 100644 index a8ca08d50916..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NameAvailabilityCheckResultInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.NameAvailabilityCheckResultInner; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityCheckResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityCheckResultInner model - = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"chqnrnrpxehuwry\",\"message\":\"gaifmvik\"}") - .toObject(NameAvailabilityCheckResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityCheckResultInner model = new NameAvailabilityCheckResultInner().withNameAvailable(false); - model = BinaryData.fromObject(model).toObject(NameAvailabilityCheckResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NetworkPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NetworkPropertiesTests.java deleted file mode 100644 index ddaf871f61d6..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/NetworkPropertiesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.IpTag; -import com.azure.resourcemanager.hdinsight.models.NetworkProperties; -import com.azure.resourcemanager.hdinsight.models.OutboundDependenciesManagedType; -import com.azure.resourcemanager.hdinsight.models.PrivateLink; -import com.azure.resourcemanager.hdinsight.models.ResourceProviderConnection; -import org.junit.jupiter.api.Assertions; - -public final class NetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkProperties model = BinaryData.fromString( - "{\"outboundDependenciesManagedType\":\"Managed\",\"resourceProviderConnection\":\"Inbound\",\"privateLink\":\"Disabled\",\"publicIpTag\":{\"ipTagType\":\"nrjawgqwg\",\"tag\":\"hniskxfbkpyc\"}}") - .toObject(NetworkProperties.class); - Assertions.assertEquals(OutboundDependenciesManagedType.MANAGED, model.outboundDependenciesManagedType()); - Assertions.assertEquals(ResourceProviderConnection.INBOUND, model.resourceProviderConnection()); - Assertions.assertEquals(PrivateLink.DISABLED, model.privateLink()); - Assertions.assertEquals("nrjawgqwg", model.publicIpTag().ipTagType()); - Assertions.assertEquals("hniskxfbkpyc", model.publicIpTag().tag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkProperties model - = new NetworkProperties().withOutboundDependenciesManagedType(OutboundDependenciesManagedType.MANAGED) - .withResourceProviderConnection(ResourceProviderConnection.INBOUND) - .withPrivateLink(PrivateLink.DISABLED) - .withPublicIpTag(new IpTag().withIpTagType("nrjawgqwg").withTag("hniskxfbkpyc")); - model = BinaryData.fromObject(model).toObject(NetworkProperties.class); - Assertions.assertEquals(OutboundDependenciesManagedType.MANAGED, model.outboundDependenciesManagedType()); - Assertions.assertEquals(ResourceProviderConnection.INBOUND, model.resourceProviderConnection()); - Assertions.assertEquals(PrivateLink.DISABLED, model.privateLink()); - Assertions.assertEquals("nrjawgqwg", model.publicIpTag().ipTagType()); - Assertions.assertEquals("hniskxfbkpyc", model.publicIpTag().tag()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationDisplayTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationDisplayTests.java deleted file mode 100644 index 30590d2b0c82..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"hrnxrxc\",\"resource\":\"uisavokq\",\"operation\":\"fvazivjlfrqttba\",\"description\":\"katnwxyi\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("hrnxrxc", model.provider()); - Assertions.assertEquals("uisavokq", model.resource()); - Assertions.assertEquals("fvazivjlfrqttba", model.operation()); - Assertions.assertEquals("katnwxyi", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("hrnxrxc") - .withResource("uisavokq") - .withOperation("fvazivjlfrqttba") - .withDescription("katnwxyi"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("hrnxrxc", model.provider()); - Assertions.assertEquals("uisavokq", model.resource()); - Assertions.assertEquals("fvazivjlfrqttba", model.operation()); - Assertions.assertEquals("katnwxyi", model.description()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationInnerTests.java deleted file mode 100644 index 07ad5a191c81..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationInnerTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; -import com.azure.resourcemanager.hdinsight.models.Dimension; -import com.azure.resourcemanager.hdinsight.models.MetricSpecifications; -import com.azure.resourcemanager.hdinsight.models.OperationDisplay; -import com.azure.resourcemanager.hdinsight.models.OperationProperties; -import com.azure.resourcemanager.hdinsight.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"hvcyyysfg\",\"display\":{\"provider\":\"cubiipuipw\",\"resource\":\"onmacjekniz\",\"operation\":\"qvci\",\"description\":\"ev\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"rilbywdx\",\"displayName\":\"icc\",\"displayDescription\":\"wfscjfn\",\"unit\":\"szqujizdvoq\",\"aggregationType\":\"ibyowbblgyavutp\",\"supportedAggregationTypes\":[\"oxoismsksbpim\",\"qolj\"],\"supportedTimeGrainTypes\":[\"gxxlxsffgcvizq\",\"dwl\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"oupfgfb\",\"sourceMdmNamespace\":\"ubdyhgk\",\"metricFilterPattern\":\"in\",\"fillGapWithZero\":true,\"category\":\"zfttsttktlahb\",\"resourceIdDimensionNameOverride\":\"ctxtgzukxi\",\"isInternal\":false,\"delegateMetricNameOverride\":\"tg\",\"dimensions\":[{}]}]}}}") - .toObject(OperationInner.class); - Assertions.assertEquals("hvcyyysfg", model.name()); - Assertions.assertEquals("cubiipuipw", model.display().provider()); - Assertions.assertEquals("onmacjekniz", model.display().resource()); - Assertions.assertEquals("qvci", model.display().operation()); - Assertions.assertEquals("ev", model.display().description()); - Assertions.assertEquals("rilbywdx", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("icc", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("wfscjfn", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("szqujizdvoq", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("ibyowbblgyavutp", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("oxoismsksbpim", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("gxxlxsffgcvizq", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("oupfgfb", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("ubdyhgk", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("in", - model.properties().serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("zfttsttktlahb", - model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("ctxtgzukxi", - model.properties().serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("tg", - model.properties().serviceSpecification().metricSpecifications().get(0).delegateMetricNameOverride()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("hvcyyysfg") - .withDisplay(new OperationDisplay().withProvider("cubiipuipw") - .withResource("onmacjekniz") - .withOperation("qvci") - .withDescription("ev")) - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecifications().withName("rilbywdx") - .withDisplayName("icc") - .withDisplayDescription("wfscjfn") - .withUnit("szqujizdvoq") - .withAggregationType("ibyowbblgyavutp") - .withSupportedAggregationTypes(Arrays.asList("oxoismsksbpim", "qolj")) - .withSupportedTimeGrainTypes(Arrays.asList("gxxlxsffgcvizq", "dwl")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("oupfgfb") - .withSourceMdmNamespace("ubdyhgk") - .withMetricFilterPattern("in") - .withFillGapWithZero(true) - .withCategory("zfttsttktlahb") - .withResourceIdDimensionNameOverride("ctxtgzukxi") - .withIsInternal(false) - .withDelegateMetricNameOverride("tg") - .withDimensions(Arrays.asList(new Dimension())))))); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("hvcyyysfg", model.name()); - Assertions.assertEquals("cubiipuipw", model.display().provider()); - Assertions.assertEquals("onmacjekniz", model.display().resource()); - Assertions.assertEquals("qvci", model.display().operation()); - Assertions.assertEquals("ev", model.display().description()); - Assertions.assertEquals("rilbywdx", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("icc", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("wfscjfn", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("szqujizdvoq", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("ibyowbblgyavutp", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("oxoismsksbpim", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("gxxlxsffgcvizq", - model.properties().serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("oupfgfb", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("ubdyhgk", - model.properties().serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("in", - model.properties().serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("zfttsttktlahb", - model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("ctxtgzukxi", - model.properties().serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("tg", - model.properties().serviceSpecification().metricSpecifications().get(0).delegateMetricNameOverride()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationListResultTests.java deleted file mode 100644 index 74f68ea2ee68..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationListResultTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; -import com.azure.resourcemanager.hdinsight.models.MetricSpecifications; -import com.azure.resourcemanager.hdinsight.models.OperationDisplay; -import com.azure.resourcemanager.hdinsight.models.OperationListResult; -import com.azure.resourcemanager.hdinsight.models.OperationProperties; -import com.azure.resourcemanager.hdinsight.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"cjznmwcpmg\",\"display\":{\"provider\":\"draufactkah\",\"resource\":\"v\",\"operation\":\"j\",\"description\":\"uxxpshne\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{},{}]}}},{\"name\":\"slqubkwdl\",\"display\":{\"provider\":\"d\",\"resource\":\"tujbazpju\",\"operation\":\"minyflnorwm\",\"description\":\"vwpklvxwmygdxp\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{},{},{}]}}},{\"name\":\"sze\",\"display\":{\"provider\":\"bjcrxgibbdaxco\",\"resource\":\"ozauorsukokwb\",\"operation\":\"lhlv\",\"description\":\"uepzl\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}]}}},{\"name\":\"oldweyuqdu\",\"display\":{\"provider\":\"nnrwrbiork\",\"resource\":\"lywjhh\",\"operation\":\"nhxmsi\",\"description\":\"omi\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}]}}}],\"nextLink\":\"ufiqndieuzaof\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("cjznmwcpmg", model.value().get(0).name()); - Assertions.assertEquals("draufactkah", model.value().get(0).display().provider()); - Assertions.assertEquals("v", model.value().get(0).display().resource()); - Assertions.assertEquals("j", model.value().get(0).display().operation()); - Assertions.assertEquals("uxxpshne", model.value().get(0).display().description()); - Assertions.assertEquals("ufiqndieuzaof", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model - = new OperationListResult() - .withValue(Arrays.asList( - new OperationInner().withName("cjznmwcpmg") - .withDisplay(new OperationDisplay().withProvider("draufactkah") - .withResource("v") - .withOperation("j") - .withDescription("uxxpshne")) - .withProperties(new OperationProperties().withServiceSpecification( - new ServiceSpecification().withMetricSpecifications(Arrays.asList( - new MetricSpecifications(), new MetricSpecifications(), new MetricSpecifications())))), - new OperationInner() - .withName("slqubkwdl") - .withDisplay(new OperationDisplay().withProvider("d") - .withResource("tujbazpju") - .withOperation("minyflnorwm") - .withDescription("vwpklvxwmygdxp")) - .withProperties(new OperationProperties() - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications( - Arrays.asList(new MetricSpecifications(), new MetricSpecifications(), - new MetricSpecifications(), new MetricSpecifications())))), - new OperationInner().withName("sze") - .withDisplay(new OperationDisplay().withProvider("bjcrxgibbdaxco") - .withResource("ozauorsukokwb") - .withOperation("lhlv") - .withDescription("uepzl")) - .withProperties(new OperationProperties().withServiceSpecification( - new ServiceSpecification().withMetricSpecifications( - Arrays.asList(new MetricSpecifications(), new MetricSpecifications())))), - new OperationInner().withName("oldweyuqdu") - .withDisplay(new OperationDisplay().withProvider("nnrwrbiork") - .withResource("lywjhh") - .withOperation("nhxmsi") - .withDescription("omi")) - .withProperties(new OperationProperties() - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications( - Arrays.asList(new MetricSpecifications(), new MetricSpecifications())))))) - .withNextLink("ufiqndieuzaof"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("cjznmwcpmg", model.value().get(0).name()); - Assertions.assertEquals("draufactkah", model.value().get(0).display().provider()); - Assertions.assertEquals("v", model.value().get(0).display().resource()); - Assertions.assertEquals("j", model.value().get(0).display().operation()); - Assertions.assertEquals("uxxpshne", model.value().get(0).display().description()); - Assertions.assertEquals("ufiqndieuzaof", model.nextLink()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationPropertiesTests.java deleted file mode 100644 index e9f6409f4020..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Dimension; -import com.azure.resourcemanager.hdinsight.models.MetricSpecifications; -import com.azure.resourcemanager.hdinsight.models.OperationProperties; -import com.azure.resourcemanager.hdinsight.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"qqfkuv\",\"displayName\":\"xkdmligo\",\"displayDescription\":\"brxk\",\"unit\":\"loazuruocbgoo\",\"aggregationType\":\"te\",\"supportedAggregationTypes\":[\"fhjxakvvjgs\",\"ordilmywwtkgkxny\",\"dabg\",\"vudtjuewbcihx\"],\"supportedTimeGrainTypes\":[\"hcjyxc\",\"ybvpay\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"dzpxgwjpl\",\"sourceMdmNamespace\":\"gstcyohpf\",\"metricFilterPattern\":\"rkdbdgiogsjkmnwq\",\"fillGapWithZero\":true,\"category\":\"aiy\",\"resourceIdDimensionNameOverride\":\"d\",\"isInternal\":true,\"delegateMetricNameOverride\":\"egfnmntfpmvmemfn\",\"dimensions\":[{\"name\":\"vvbalx\",\"displayName\":\"lchpodbzevwrdn\",\"internalName\":\"ukuv\",\"toBeExportedForShoebox\":true},{\"name\":\"wsmystuluqypf\",\"displayName\":\"lerchpq\",\"internalName\":\"f\",\"toBeExportedForShoebox\":true}]},{\"name\":\"bwidfcxsspuunn\",\"displayName\":\"yhkx\",\"displayDescription\":\"ddrihpf\",\"unit\":\"qcaaewdaomdjvl\",\"aggregationType\":\"x\",\"supportedAggregationTypes\":[\"brm\"],\"supportedTimeGrainTypes\":[\"ivsiy\",\"zkdnc\",\"dxonbzoggculap\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"pgogtqxepny\",\"sourceMdmNamespace\":\"fuajly\",\"metricFilterPattern\":\"lvofqzhvfcibyfmo\",\"fillGapWithZero\":false,\"category\":\"kjpvdwxf\",\"resourceIdDimensionNameOverride\":\"iivwzjbhyzsxjrka\",\"isInternal\":true,\"delegateMetricNameOverride\":\"negvmnvuqe\",\"dimensions\":[{\"name\":\"spastjbkkdmf\",\"displayName\":\"est\",\"internalName\":\"lx\",\"toBeExportedForShoebox\":true}]},{\"name\":\"ozapeew\",\"displayName\":\"pxlktwkuziycsl\",\"displayDescription\":\"ufuztcktyhjtq\",\"unit\":\"cgzulwmmrqzzr\",\"aggregationType\":\"vpglydz\",\"supportedAggregationTypes\":[\"vqeevtoep\",\"yutnwytpzdmov\",\"vf\",\"aawzqadfl\"],\"supportedTimeGrainTypes\":[\"riglaec\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"icokpv\",\"sourceMdmNamespace\":\"lqtmldgxob\",\"metricFilterPattern\":\"rclnpkc\",\"fillGapWithZero\":false,\"category\":\"riykhyawfvjlbox\",\"resourceIdDimensionNameOverride\":\"kjlmx\",\"isInternal\":false,\"delegateMetricNameOverride\":\"ynhdwdigum\",\"dimensions\":[{\"name\":\"auzzptjazysd\",\"displayName\":\"ezwwv\",\"internalName\":\"qyuvvfonkp\",\"toBeExportedForShoebox\":false},{\"name\":\"ikvylauya\",\"displayName\":\"uwmncs\",\"internalName\":\"ijf\",\"toBeExportedForShoebox\":false}]},{\"name\":\"o\",\"displayName\":\"rsg\",\"displayDescription\":\"b\",\"unit\":\"uzqgnjdgkynsc\",\"aggregationType\":\"qhzvhxnkomt\",\"supportedAggregationTypes\":[\"otppnv\"],\"supportedTimeGrainTypes\":[\"xhihfrbbcevqagtl\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"fkqojpy\",\"sourceMdmNamespace\":\"gtrd\",\"metricFilterPattern\":\"ifmzzsd\",\"fillGapWithZero\":false,\"category\":\"nysuxmprafwgckh\",\"resourceIdDimensionNameOverride\":\"xvd\",\"isInternal\":true,\"delegateMetricNameOverride\":\"afqr\",\"dimensions\":[{\"name\":\"spave\",\"displayName\":\"r\",\"internalName\":\"bunzozudh\",\"toBeExportedForShoebox\":true},{\"name\":\"moy\",\"displayName\":\"dyuib\",\"internalName\":\"fdn\",\"toBeExportedForShoebox\":true},{\"name\":\"vfvfcj\",\"displayName\":\"eoisrvhmgor\",\"internalName\":\"ukiscvwmzhw\",\"toBeExportedForShoebox\":true}]}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("qqfkuv", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("xkdmligo", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("brxk", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("loazuruocbgoo", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("te", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("fhjxakvvjgs", - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("hcjyxc", - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("dzpxgwjpl", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("gstcyohpf", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("rkdbdgiogsjkmnwq", - model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("aiy", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("d", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("egfnmntfpmvmemfn", - model.serviceSpecification().metricSpecifications().get(0).delegateMetricNameOverride()); - Assertions.assertEquals("vvbalx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lchpodbzevwrdn", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ukuv", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties() - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications(Arrays.asList( - new MetricSpecifications().withName("qqfkuv") - .withDisplayName("xkdmligo") - .withDisplayDescription("brxk") - .withUnit("loazuruocbgoo") - .withAggregationType("te") - .withSupportedAggregationTypes( - Arrays.asList("fhjxakvvjgs", "ordilmywwtkgkxny", "dabg", "vudtjuewbcihx")) - .withSupportedTimeGrainTypes(Arrays.asList("hcjyxc", "ybvpay")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("dzpxgwjpl") - .withSourceMdmNamespace("gstcyohpf") - .withMetricFilterPattern("rkdbdgiogsjkmnwq") - .withFillGapWithZero(true) - .withCategory("aiy") - .withResourceIdDimensionNameOverride("d") - .withIsInternal(true) - .withDelegateMetricNameOverride("egfnmntfpmvmemfn") - .withDimensions(Arrays.asList( - new Dimension().withName("vvbalx") - .withDisplayName("lchpodbzevwrdn") - .withInternalName("ukuv") - .withToBeExportedForShoebox(true), - new Dimension().withName("wsmystuluqypf") - .withDisplayName("lerchpq") - .withInternalName("f") - .withToBeExportedForShoebox(true))), - new MetricSpecifications().withName("bwidfcxsspuunn") - .withDisplayName("yhkx") - .withDisplayDescription("ddrihpf") - .withUnit("qcaaewdaomdjvl") - .withAggregationType("x") - .withSupportedAggregationTypes(Arrays.asList("brm")) - .withSupportedTimeGrainTypes(Arrays.asList("ivsiy", "zkdnc", "dxonbzoggculap")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("pgogtqxepny") - .withSourceMdmNamespace("fuajly") - .withMetricFilterPattern("lvofqzhvfcibyfmo") - .withFillGapWithZero(false) - .withCategory("kjpvdwxf") - .withResourceIdDimensionNameOverride("iivwzjbhyzsxjrka") - .withIsInternal(true) - .withDelegateMetricNameOverride("negvmnvuqe") - .withDimensions(Arrays.asList(new Dimension().withName("spastjbkkdmf") - .withDisplayName("est") - .withInternalName("lx") - .withToBeExportedForShoebox(true))), - new MetricSpecifications().withName("ozapeew") - .withDisplayName("pxlktwkuziycsl") - .withDisplayDescription("ufuztcktyhjtq") - .withUnit("cgzulwmmrqzzr") - .withAggregationType("vpglydz") - .withSupportedAggregationTypes(Arrays.asList("vqeevtoep", "yutnwytpzdmov", "vf", "aawzqadfl")) - .withSupportedTimeGrainTypes(Arrays.asList("riglaec")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("icokpv") - .withSourceMdmNamespace("lqtmldgxob") - .withMetricFilterPattern("rclnpkc") - .withFillGapWithZero(false) - .withCategory("riykhyawfvjlbox") - .withResourceIdDimensionNameOverride("kjlmx") - .withIsInternal(false) - .withDelegateMetricNameOverride("ynhdwdigum") - .withDimensions(Arrays.asList( - new Dimension().withName("auzzptjazysd") - .withDisplayName("ezwwv") - .withInternalName("qyuvvfonkp") - .withToBeExportedForShoebox(false), - new Dimension().withName("ikvylauya") - .withDisplayName("uwmncs") - .withInternalName("ijf") - .withToBeExportedForShoebox(false))), - new MetricSpecifications().withName("o") - .withDisplayName("rsg") - .withDisplayDescription("b") - .withUnit("uzqgnjdgkynsc") - .withAggregationType("qhzvhxnkomt") - .withSupportedAggregationTypes(Arrays.asList("otppnv")) - .withSupportedTimeGrainTypes(Arrays.asList("xhihfrbbcevqagtl")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("fkqojpy") - .withSourceMdmNamespace("gtrd") - .withMetricFilterPattern("ifmzzsd") - .withFillGapWithZero(false) - .withCategory("nysuxmprafwgckh") - .withResourceIdDimensionNameOverride("xvd") - .withIsInternal(true) - .withDelegateMetricNameOverride("afqr") - .withDimensions(Arrays.asList( - new Dimension().withName("spave") - .withDisplayName("r") - .withInternalName("bunzozudh") - .withToBeExportedForShoebox(true), - new Dimension().withName("moy") - .withDisplayName("dyuib") - .withInternalName("fdn") - .withToBeExportedForShoebox(true), - new Dimension().withName("vfvfcj") - .withDisplayName("eoisrvhmgor") - .withInternalName("ukiscvwmzhw") - .withToBeExportedForShoebox(true)))))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("qqfkuv", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("xkdmligo", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("brxk", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("loazuruocbgoo", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("te", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("fhjxakvvjgs", - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("hcjyxc", - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("dzpxgwjpl", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("gstcyohpf", - model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("rkdbdgiogsjkmnwq", - model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("aiy", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("d", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("egfnmntfpmvmemfn", - model.serviceSpecification().metricSpecifications().get(0).delegateMetricNameOverride()); - Assertions.assertEquals("vvbalx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lchpodbzevwrdn", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ukuv", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationsListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationsListMockTests.java deleted file mode 100644 index 67f48645fbed..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/OperationsListMockTests.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"dqq\",\"display\":{\"provider\":\"kva\",\"resource\":\"l\",\"operation\":\"jqvq\",\"description\":\"wehtaemxh\"},\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"usxivzrrryvei\",\"displayName\":\"pskdyzatvfuzk\",\"displayDescription\":\"tjvv\",\"unit\":\"xwigsye\",\"aggregationType\":\"qdsmjtg\",\"supportedAggregationTypes\":[\"dgkkile\",\"lkcsmknhwtbbae\"],\"supportedTimeGrainTypes\":[\"vv\",\"qfloygbdgwum\",\"xdgd\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"gdexjd\",\"sourceMdmNamespace\":\"jsaqwotmmwllcols\",\"metricFilterPattern\":\"xaptefhexcgjok\",\"fillGapWithZero\":true,\"category\":\"hv\",\"resourceIdDimensionNameOverride\":\"jbekpeeksnbksdq\",\"isInternal\":true,\"delegateMetricNameOverride\":\"klxesl\",\"dimensions\":[{},{},{},{}]}]}}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dqq", response.iterator().next().name()); - Assertions.assertEquals("kva", response.iterator().next().display().provider()); - Assertions.assertEquals("l", response.iterator().next().display().resource()); - Assertions.assertEquals("jqvq", response.iterator().next().display().operation()); - Assertions.assertEquals("wehtaemxh", response.iterator().next().display().description()); - Assertions.assertEquals("usxivzrrryvei", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("pskdyzatvfuzk", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("tjvv", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .displayDescription()); - Assertions.assertEquals("xwigsye", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("qdsmjtg", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .aggregationType()); - Assertions.assertEquals("dgkkile", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedAggregationTypes() - .get(0)); - Assertions.assertEquals("vv", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedTimeGrainTypes() - .get(0)); - Assertions.assertEquals(false, - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .enableRegionalMdmAccount()); - Assertions.assertEquals("gdexjd", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .sourceMdmAccount()); - Assertions.assertEquals("jsaqwotmmwllcols", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .sourceMdmNamespace()); - Assertions.assertEquals("xaptefhexcgjok", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .metricFilterPattern()); - Assertions.assertEquals(true, - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .fillGapWithZero()); - Assertions.assertEquals("hv", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("jbekpeeksnbksdq", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .resourceIdDimensionNameOverride()); - Assertions.assertEquals(true, - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("klxesl", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .delegateMetricNameOverride()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index e16c0f078c3c..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"ncblylpst\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"hxsrzdzucersc\",\"actionsRequired\":\"t\"},\"linkIdentifier\":\"vfiwjmygtdss\",\"provisioningState\":\"InProgress\"},\"id\":\"mweriofzpy\",\"name\":\"semwabnet\",\"type\":\"hhszh\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hxsrzdzucersc", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.PENDING) - .withDescription("hxsrzdzucersc") - .withActionsRequired("t")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hxsrzdzucersc", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 807f4890628f..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hdinsight.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"qodfvp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"oxgsgbpfgzdjtx\",\"actionsRequired\":\"flbqvgaq\"},\"linkIdentifier\":\"gafcqu\",\"provisioningState\":\"Succeeded\"},\"id\":\"etnwsdtutnw\",\"name\":\"duy\",\"type\":\"vuzhyr\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"ipmve\"},\"privateLinkServiceConnectionState\":{\"status\":\"Removed\",\"description\":\"ukuqgsj\",\"actionsRequired\":\"undxgketw\"},\"linkIdentifier\":\"hzjhf\",\"provisioningState\":\"InProgress\"},\"id\":\"vmuvgpmu\",\"name\":\"eqsx\",\"type\":\"mhfbuzjy\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"as\"},\"privateLinkServiceConnectionState\":{\"status\":\"Removed\",\"description\":\"dyp\",\"actionsRequired\":\"yue\"},\"linkIdentifier\":\"lynsqyrpf\",\"provisioningState\":\"Canceled\"},\"id\":\"lttymsjn\",\"name\":\"gqdnfwqzd\",\"type\":\"gtilax\"}],\"nextLink\":\"fhqlyvi\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("oxgsgbpfgzdjtx", - model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("flbqvgaq", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult().withValue(Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.REJECTED) - .withDescription("oxgsgbpfgzdjtx") - .withActionsRequired("flbqvgaq")), - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.REMOVED) - .withDescription("ukuqgsj") - .withActionsRequired("undxgketw")), - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.REMOVED) - .withDescription("dyp") - .withActionsRequired("yue")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("oxgsgbpfgzdjtx", - model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("flbqvgaq", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index f925693cdfb6..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionPropertiesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"lvwiwubmwmbesl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"wwtppj\",\"actionsRequired\":\"cxogaokonzm\"},\"linkIdentifier\":\"ikvmkqzeqqk\",\"provisioningState\":\"Updating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wwtppj", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cxogaokonzm", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("wwtppj") - .withActionsRequired("cxogaokonzm")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wwtppj", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cxogaokonzm", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index 128954bfefce..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"sjybvitv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"y\",\"actionsRequired\":\"nu\"},\"linkIdentifier\":\"ggmuwdcho\",\"provisioningState\":\"Succeeded\"},\"id\":\"fexl\",\"name\":\"xn\",\"type\":\"akizvoaikna\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .define("selpkpbaf") - .withExistingCluster("fbzkk", "tnhqsycl") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("d") - .withActionsRequired("rsofpltdbmairrh")) - .create(); - - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("y", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("nu", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index 6a15b48d2759..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections().delete("zlex", "sfledyn", "jpziu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index f34608ddf5a9..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsGetWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"wsrsxkrplbja\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"wwviyo\",\"actionsRequired\":\"suhbrnn\"},\"linkIdentifier\":\"xs\",\"provisioningState\":\"Failed\"},\"id\":\"qkbiwet\",\"name\":\"ozycy\",\"type\":\"iqyhgfse\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("fz", "bfw", "rzx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wwviyo", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("suhbrnn", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterMockTests.java deleted file mode 100644 index fc904a15d959..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointConnectionsListByClusterMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"knlejjjkxybwfd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Removed\",\"description\":\"bztensvkzykjtj\",\"actionsRequired\":\"sxfwushcdp\"},\"linkIdentifier\":\"pn\",\"provisioningState\":\"Updating\"},\"id\":\"jfbp\",\"name\":\"uwxeoiojfizf\",\"type\":\"vkjzwfbcyaykm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.privateEndpointConnections().listByCluster("ustcpoq", "avnwqj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REMOVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("bztensvkzykjtj", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("sxfwushcdp", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointTests.java deleted file mode 100644 index 501e497f873c..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.PrivateEndpoint; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"zxmhhvhgu\"}").toObject(PrivateEndpoint.class); - Assertions.assertEquals("zxmhhvhgu", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint().withId("zxmhhvhgu"); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - Assertions.assertEquals("zxmhhvhgu", model.id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationPropertiesTests.java deleted file mode 100644 index d5bc717895cf..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkConfigurationProperties; -import com.azure.resourcemanager.hdinsight.models.IpConfiguration; -import com.azure.resourcemanager.hdinsight.models.PrivateIpAllocationMethod; -import com.azure.resourcemanager.hdinsight.models.ResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkConfigurationProperties model = BinaryData.fromString( - "{\"groupId\":\"jzicwifsjt\",\"provisioningState\":\"Failed\",\"ipConfigurations\":[{\"id\":\"ishc\",\"name\":\"khaj\",\"type\":\"yeamdphagalpb\",\"properties\":{\"provisioningState\":\"Deleting\",\"primary\":true,\"privateIPAddress\":\"honowkgshwank\",\"privateIPAllocationMethod\":\"static\",\"subnet\":{\"id\":\"njeputtmrywn\"}}},{\"id\":\"oqftiyqzrnkcq\",\"name\":\"yx\",\"type\":\"hzls\",\"properties\":{\"provisioningState\":\"Succeeded\",\"primary\":false,\"privateIPAddress\":\"nwvlryavwhheunmm\",\"privateIPAllocationMethod\":\"dynamic\",\"subnet\":{\"id\":\"zko\"}}},{\"id\":\"cukoklyaxuconu\",\"name\":\"szfkbe\",\"type\":\"ewrmjmwvvjektc\",\"properties\":{\"provisioningState\":\"Succeeded\",\"primary\":true,\"privateIPAddress\":\"rsffrzpwvlqdqgbi\",\"privateIPAllocationMethod\":\"static\",\"subnet\":{\"id\":\"kaet\"}}}]}") - .toObject(PrivateLinkConfigurationProperties.class); - Assertions.assertEquals("jzicwifsjt", model.groupId()); - Assertions.assertEquals("khaj", model.ipConfigurations().get(0).name()); - Assertions.assertEquals(true, model.ipConfigurations().get(0).primary()); - Assertions.assertEquals("honowkgshwank", model.ipConfigurations().get(0).privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.STATIC, - model.ipConfigurations().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("njeputtmrywn", model.ipConfigurations().get(0).subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkConfigurationProperties model = new PrivateLinkConfigurationProperties().withGroupId("jzicwifsjt") - .withIpConfigurations(Arrays.asList( - new IpConfiguration().withName("khaj") - .withPrimary(true) - .withPrivateIpAddress("honowkgshwank") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.STATIC) - .withSubnet(new ResourceId().withId("njeputtmrywn")), - new IpConfiguration().withName("yx") - .withPrimary(false) - .withPrivateIpAddress("nwvlryavwhheunmm") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.DYNAMIC) - .withSubnet(new ResourceId().withId("zko")), - new IpConfiguration().withName("szfkbe") - .withPrimary(true) - .withPrivateIpAddress("rsffrzpwvlqdqgbi") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.STATIC) - .withSubnet(new ResourceId().withId("kaet")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkConfigurationProperties.class); - Assertions.assertEquals("jzicwifsjt", model.groupId()); - Assertions.assertEquals("khaj", model.ipConfigurations().get(0).name()); - Assertions.assertEquals(true, model.ipConfigurations().get(0).primary()); - Assertions.assertEquals("honowkgshwank", model.ipConfigurations().get(0).privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.STATIC, - model.ipConfigurations().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("njeputtmrywn", model.ipConfigurations().get(0).subnet().id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationTests.java deleted file mode 100644 index 9b6a400d4130..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkConfigurationTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.IpConfiguration; -import com.azure.resourcemanager.hdinsight.models.PrivateIpAllocationMethod; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkConfiguration; -import com.azure.resourcemanager.hdinsight.models.ResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkConfiguration model = BinaryData.fromString( - "{\"id\":\"rxwburv\",\"name\":\"xxjnspydptk\",\"type\":\"nkoukn\",\"properties\":{\"groupId\":\"udwtiukbl\",\"provisioningState\":\"Succeeded\",\"ipConfigurations\":[{\"id\":\"ocipazyxoeg\",\"name\":\"kgjn\",\"type\":\"ucgygevqz\",\"properties\":{\"provisioningState\":\"Succeeded\",\"primary\":false,\"privateIPAddress\":\"p\",\"privateIPAllocationMethod\":\"dynamic\",\"subnet\":{\"id\":\"qjsdpydnfyhxdeo\"}}}]}}") - .toObject(PrivateLinkConfiguration.class); - Assertions.assertEquals("xxjnspydptk", model.name()); - Assertions.assertEquals("udwtiukbl", model.groupId()); - Assertions.assertEquals("kgjn", model.ipConfigurations().get(0).name()); - Assertions.assertEquals(false, model.ipConfigurations().get(0).primary()); - Assertions.assertEquals("p", model.ipConfigurations().get(0).privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.DYNAMIC, - model.ipConfigurations().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("qjsdpydnfyhxdeo", model.ipConfigurations().get(0).subnet().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkConfiguration model = new PrivateLinkConfiguration().withName("xxjnspydptk") - .withGroupId("udwtiukbl") - .withIpConfigurations(Arrays.asList(new IpConfiguration().withName("kgjn") - .withPrimary(false) - .withPrivateIpAddress("p") - .withPrivateIpAllocationMethod(PrivateIpAllocationMethod.DYNAMIC) - .withSubnet(new ResourceId().withId("qjsdpydnfyhxdeo")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkConfiguration.class); - Assertions.assertEquals("xxjnspydptk", model.name()); - Assertions.assertEquals("udwtiukbl", model.groupId()); - Assertions.assertEquals("kgjn", model.ipConfigurations().get(0).name()); - Assertions.assertEquals(false, model.ipConfigurations().get(0).primary()); - Assertions.assertEquals("p", model.ipConfigurations().get(0).privateIpAddress()); - Assertions.assertEquals(PrivateIpAllocationMethod.DYNAMIC, - model.ipConfigurations().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("qjsdpydnfyhxdeo", model.ipConfigurations().get(0).subnet().id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 5a1312d8a4f6..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"ahhvjhhna\",\"requiredMembers\":[\"bbjjidjksyxk\",\"xvxevblbjednljla\",\"euaulxu\"],\"requiredZoneNames\":[\"jbnkpp\",\"ynenlsvxeizz\"]},\"id\":\"klnsrmffey\",\"name\":\"xcktpiymerteeamm\",\"type\":\"qiekkkzddrt\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("jbnkpp", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model - = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("jbnkpp", "ynenlsvxeizz")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("jbnkpp", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceListResultInnerTests.java deleted file mode 100644 index e5cfa69a8f92..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourceListResultInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceListResultInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"vk\",\"requiredMembers\":[\"zunbixx\",\"ti\",\"vcpwpgclrc\",\"vtsoxf\"],\"requiredZoneNames\":[\"nxpmyyefrpmpdnq\",\"skawaoqvmmb\",\"pqfrtqlkz\"]},\"id\":\"gnitgvkxlzyq\",\"name\":\"rfe\",\"type\":\"cealzxwh\"},{\"properties\":{\"groupId\":\"symoyq\",\"requiredMembers\":[\"igdivbkbxg\",\"mf\"],\"requiredZoneNames\":[\"wasqvdaeyyg\",\"xakjsqzhzb\"]},\"id\":\"kgimsidxasic\",\"name\":\"dyvvjskgfmocwahp\",\"type\":\"gat\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("nxpmyyefrpmpdnq", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model = new PrivateLinkResourceListResultInner().withValue(Arrays.asList( - new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("nxpmyyefrpmpdnq", "skawaoqvmmb", "pqfrtqlkz")), - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("wasqvdaeyyg", "xakjsqzhzb")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("nxpmyyefrpmpdnq", model.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index a1021a0fff47..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcePropertiesTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"doj\",\"requiredMembers\":[\"vavrefdees\"],\"requiredZoneNames\":[\"uij\",\"xtxsuwprtujw\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("uij", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model - = new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("uij", "xtxsuwprtujw")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("uij", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index 754ea73195f5..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"xeg\",\"requiredMembers\":[\"rtudawlpjfel\",\"erppt\",\"bgqnz\",\"nhii\"],\"requiredZoneNames\":[\"lwcjgckbbcccgzpr\",\"oxnyuffatsg\",\"tipwcxbyubhiqd\"]},\"id\":\"urnpnuhzafccnuh\",\"name\":\"i\",\"type\":\"byl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("bizt", "ofqcvovjufycsjm", "bemyeji", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lwcjgckbbcccgzpr", response.requiredZoneNames().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterWithResponseMockTests.java deleted file mode 100644 index d16feeeb3afe..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkResourcesListByClusterWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkResourceListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByClusterWithResponseMockTests { - @Test - public void testListByClusterWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"pejtl\",\"requiredMembers\":[\"aonwivkcqhrxh\",\"knlccrmmkyup\",\"jubyqjfkakfq\"],\"requiredZoneNames\":[\"em\",\"il\"]},\"id\":\"dxjascowvfdj\",\"name\":\"pdxphlkksnmgzvyf\",\"type\":\"jd\"},{\"properties\":{\"groupId\":\"qnwsithuqolyah\",\"requiredMembers\":[\"wqulsutrjbhxykf\",\"y\"],\"requiredZoneNames\":[\"vqqugdrftbcv\",\"xreuquowtlj\",\"fwhreagkhyxv\",\"qtvbczsu\"]},\"id\":\"dgglmepjpfs\",\"name\":\"ykgsangpszng\",\"type\":\"fpgylkve\"},{\"properties\":{\"groupId\":\"jcngoadyed\",\"requiredMembers\":[\"gjfoknubnoitpkpz\",\"rgdg\",\"vcoqraswugyxpqi\"],\"requiredZoneNames\":[\"ialwv\",\"kbuhzaca\",\"ty\"]},\"id\":\"co\",\"name\":\"cujp\",\"type\":\"sxzakuejkm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResourceListResult response = manager.privateLinkResources() - .listByClusterWithResponse("lnuwiguy", "lykwphvxz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("em", response.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 82c5f1decac6..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Pending\",\"description\":\"dkwobdagx\",\"actionsRequired\":\"bqdxbx\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("dkwobdagx", model.description()); - Assertions.assertEquals("bqdxbx", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.PENDING) - .withDescription("dkwobdagx") - .withActionsRequired("bqdxbx"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("dkwobdagx", model.description()); - Assertions.assertEquals("bqdxbx", model.actionsRequired()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaCapabilityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaCapabilityTests.java deleted file mode 100644 index 830af79278b2..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaCapabilityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.QuotaCapability; -import com.azure.resourcemanager.hdinsight.models.RegionalQuotaCapability; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaCapability model = BinaryData.fromString( - "{\"coresUsed\":3612110443400649371,\"maxCoresAllowed\":137695562924143561,\"regionalQuotas\":[{\"regionName\":\"qlgkfbtn\",\"coresUsed\":6879764245530477433,\"coresAvailable\":6187820984312370265},{\"regionName\":\"cn\",\"coresUsed\":5913508679242564666,\"coresAvailable\":456815432362653733}]}") - .toObject(QuotaCapability.class); - Assertions.assertEquals(3612110443400649371L, model.coresUsed()); - Assertions.assertEquals(137695562924143561L, model.maxCoresAllowed()); - Assertions.assertEquals("qlgkfbtn", model.regionalQuotas().get(0).regionName()); - Assertions.assertEquals(6879764245530477433L, model.regionalQuotas().get(0).coresUsed()); - Assertions.assertEquals(6187820984312370265L, model.regionalQuotas().get(0).coresAvailable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaCapability model = new QuotaCapability().withCoresUsed(3612110443400649371L) - .withMaxCoresAllowed(137695562924143561L) - .withRegionalQuotas(Arrays.asList( - new RegionalQuotaCapability().withRegionName("qlgkfbtn") - .withCoresUsed(6879764245530477433L) - .withCoresAvailable(6187820984312370265L), - new RegionalQuotaCapability().withRegionName("cn") - .withCoresUsed(5913508679242564666L) - .withCoresAvailable(456815432362653733L))); - model = BinaryData.fromObject(model).toObject(QuotaCapability.class); - Assertions.assertEquals(3612110443400649371L, model.coresUsed()); - Assertions.assertEquals(137695562924143561L, model.maxCoresAllowed()); - Assertions.assertEquals("qlgkfbtn", model.regionalQuotas().get(0).regionName()); - Assertions.assertEquals(6879764245530477433L, model.regionalQuotas().get(0).coresUsed()); - Assertions.assertEquals(6187820984312370265L, model.regionalQuotas().get(0).coresAvailable()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaInfoTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaInfoTests.java deleted file mode 100644 index bf723955219b..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/QuotaInfoTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.QuotaInfo; -import org.junit.jupiter.api.Assertions; - -public final class QuotaInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaInfo model = BinaryData.fromString("{\"coresUsed\":1712324120}").toObject(QuotaInfo.class); - Assertions.assertEquals(1712324120, model.coresUsed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaInfo model = new QuotaInfo().withCoresUsed(1712324120); - model = BinaryData.fromObject(model).toObject(QuotaInfo.class); - Assertions.assertEquals(1712324120, model.coresUsed()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionalQuotaCapabilityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionalQuotaCapabilityTests.java deleted file mode 100644 index 5b06153b81c8..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionalQuotaCapabilityTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.RegionalQuotaCapability; -import org.junit.jupiter.api.Assertions; - -public final class RegionalQuotaCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegionalQuotaCapability model = BinaryData - .fromString( - "{\"regionName\":\"df\",\"coresUsed\":537247289030713733,\"coresAvailable\":4579200553418378126}") - .toObject(RegionalQuotaCapability.class); - Assertions.assertEquals("df", model.regionName()); - Assertions.assertEquals(537247289030713733L, model.coresUsed()); - Assertions.assertEquals(4579200553418378126L, model.coresAvailable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegionalQuotaCapability model = new RegionalQuotaCapability().withRegionName("df") - .withCoresUsed(537247289030713733L) - .withCoresAvailable(4579200553418378126L); - model = BinaryData.fromObject(model).toObject(RegionalQuotaCapability.class); - Assertions.assertEquals("df", model.regionName()); - Assertions.assertEquals(537247289030713733L, model.coresUsed()); - Assertions.assertEquals(4579200553418378126L, model.coresAvailable()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionsCapabilityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionsCapabilityTests.java deleted file mode 100644 index c2d863fa36dc..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RegionsCapabilityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.RegionsCapability; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegionsCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegionsCapability model = BinaryData.fromString("{\"available\":[\"dmovsm\",\"l\",\"wabm\",\"oefki\"]}") - .toObject(RegionsCapability.class); - Assertions.assertEquals("dmovsm", model.available().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegionsCapability model = new RegionsCapability().withAvailable(Arrays.asList("dmovsm", "l", "wabm", "oefki")); - model = BinaryData.fromObject(model).toObject(RegionsCapability.class); - Assertions.assertEquals("dmovsm", model.available().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ResourceIdTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ResourceIdTests.java deleted file mode 100644 index c4772fd08219..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ResourceIdTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ResourceId; -import org.junit.jupiter.api.Assertions; - -public final class ResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceId model = BinaryData.fromString("{\"id\":\"idokgjlj\"}").toObject(ResourceId.class); - Assertions.assertEquals("idokgjlj", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceId model = new ResourceId().withId("idokgjlj"); - model = BinaryData.fromObject(model).toObject(ResourceId.class); - Assertions.assertEquals("idokgjlj", model.id()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionDetailInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionDetailInnerTests.java deleted file mode 100644 index dda8a1364b22..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionDetailInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuntimeScriptActionDetailInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuntimeScriptActionDetailInner model = BinaryData.fromString( - "{\"scriptExecutionId\":1138155605453758000,\"startTime\":\"pmjerbdkelvidiz\",\"endTime\":\"sdbccxjmonfdgnwn\",\"status\":\"puuw\",\"operation\":\"tvuqjctzenkeifzz\",\"executionSummary\":[{\"status\":\"as\",\"instanceCount\":897576014},{\"status\":\"hbxcu\",\"instanceCount\":995133757},{\"status\":\"gsrboldforobw\",\"instanceCount\":2116230034},{\"status\":\"zbfhfovvac\",\"instanceCount\":1350154839}],\"debugInformation\":\"uodxesza\",\"name\":\"belawumuaslzkwr\",\"uri\":\"woycqucwyha\",\"parameters\":\"omd\",\"roles\":[\"ywuhpsvfuur\",\"tlwexxwlalniexz\",\"rzpgep\"],\"applicationName\":\"yb\"}") - .toObject(RuntimeScriptActionDetailInner.class); - Assertions.assertEquals("belawumuaslzkwr", model.name()); - Assertions.assertEquals("woycqucwyha", model.uri()); - Assertions.assertEquals("omd", model.parameters()); - Assertions.assertEquals("ywuhpsvfuur", model.roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuntimeScriptActionDetailInner model = new RuntimeScriptActionDetailInner().withName("belawumuaslzkwr") - .withUri("woycqucwyha") - .withParameters("omd") - .withRoles(Arrays.asList("ywuhpsvfuur", "tlwexxwlalniexz", "rzpgep")); - model = BinaryData.fromObject(model).toObject(RuntimeScriptActionDetailInner.class); - Assertions.assertEquals("belawumuaslzkwr", model.name()); - Assertions.assertEquals("woycqucwyha", model.uri()); - Assertions.assertEquals("omd", model.parameters()); - Assertions.assertEquals("ywuhpsvfuur", model.roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionTests.java deleted file mode 100644 index cf804cdd9885..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/RuntimeScriptActionTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuntimeScriptActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuntimeScriptAction model = BinaryData.fromString( - "{\"name\":\"fqrvkdvjsllrmvvd\",\"uri\":\"watkpnpulexxb\",\"parameters\":\"wtruwiqzbqjvsovm\",\"roles\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"applicationName\":\"kcciwwzjuqkhr\"}") - .toObject(RuntimeScriptAction.class); - Assertions.assertEquals("fqrvkdvjsllrmvvd", model.name()); - Assertions.assertEquals("watkpnpulexxb", model.uri()); - Assertions.assertEquals("wtruwiqzbqjvsovm", model.parameters()); - Assertions.assertEquals("kacspkw", model.roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuntimeScriptAction model = new RuntimeScriptAction().withName("fqrvkdvjsllrmvvd") - .withUri("watkpnpulexxb") - .withParameters("wtruwiqzbqjvsovm") - .withRoles(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc")); - model = BinaryData.fromObject(model).toObject(RuntimeScriptAction.class); - Assertions.assertEquals("fqrvkdvjsllrmvvd", model.name()); - Assertions.assertEquals("watkpnpulexxb", model.uri()); - Assertions.assertEquals("wtruwiqzbqjvsovm", model.parameters()); - Assertions.assertEquals("kacspkw", model.roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionHistoryListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionHistoryListTests.java deleted file mode 100644 index ffa0ed0ef78a..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionHistoryListTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionHistoryList; - -public final class ScriptActionExecutionHistoryListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptActionExecutionHistoryList model = BinaryData.fromString( - "{\"value\":[{\"scriptExecutionId\":7238089424205548916,\"startTime\":\"nrkcxkj\",\"endTime\":\"nxm\",\"status\":\"uxswqrntvl\",\"operation\":\"jpsttexoq\",\"executionSummary\":[{\"status\":\"yyufmhruncuw\",\"instanceCount\":2077646980},{\"status\":\"kcdqzhlct\",\"instanceCount\":1266865634},{\"status\":\"qn\",\"instanceCount\":981773620},{\"status\":\"chrqb\",\"instanceCount\":1026325475}],\"debugInformation\":\"cgegydcwbo\",\"name\":\"jumvqqolihrraio\",\"uri\":\"aubrjtloq\",\"parameters\":\"uojrngiflr\",\"roles\":[\"asccbiui\",\"zdlyjdfqw\"],\"applicationName\":\"yoqufdvruz\"}],\"nextLink\":\"zojhpctfnmd\"}") - .toObject(ScriptActionExecutionHistoryList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptActionExecutionHistoryList model = new ScriptActionExecutionHistoryList(); - model = BinaryData.fromObject(model).toObject(ScriptActionExecutionHistoryList.class); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionSummaryTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionSummaryTests.java deleted file mode 100644 index 4596154ff3ed..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionExecutionSummaryTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionSummary; - -public final class ScriptActionExecutionSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptActionExecutionSummary model - = BinaryData.fromString("{\"status\":\"wpgdak\",\"instanceCount\":1202587998}") - .toObject(ScriptActionExecutionSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptActionExecutionSummary model = new ScriptActionExecutionSummary(); - model = BinaryData.fromObject(model).toObject(ScriptActionExecutionSummary.class); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionTests.java deleted file mode 100644 index 7a1a42a37332..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.ScriptAction; -import org.junit.jupiter.api.Assertions; - -public final class ScriptActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptAction model = BinaryData.fromString("{\"name\":\"rq\",\"uri\":\"b\",\"parameters\":\"oczvy\"}") - .toObject(ScriptAction.class); - Assertions.assertEquals("rq", model.name()); - Assertions.assertEquals("b", model.uri()); - Assertions.assertEquals("oczvy", model.parameters()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptAction model = new ScriptAction().withName("rq").withUri("b").withParameters("oczvy"); - model = BinaryData.fromObject(model).toObject(ScriptAction.class); - Assertions.assertEquals("rq", model.name()); - Assertions.assertEquals("b", model.uri()); - Assertions.assertEquals("oczvy", model.parameters()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteWithResponseMockTests.java deleted file mode 100644 index f93d4d6315d7..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScriptActionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.scriptActions().deleteWithResponse("ui", "vxva", "vcrk", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailWithResponseMockTests.java deleted file mode 100644 index 3272d770f68b..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsGetExecutionDetailWithResponseMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScriptActionsGetExecutionDetailWithResponseMockTests { - @Test - public void testGetExecutionDetailWithResponse() throws Exception { - String responseStr - = "{\"scriptExecutionId\":3671581328871244489,\"startTime\":\"atbwbqam\",\"endTime\":\"uliyslpkcv\",\"status\":\"f\",\"operation\":\"xxe\",\"executionSummary\":[{\"status\":\"bormcqmiciijqpkz\",\"instanceCount\":1276736582}],\"debugInformation\":\"xjmcsmyqwixvcpw\",\"name\":\"kwywzwofalic\",\"uri\":\"duoiqt\",\"parameters\":\"t\",\"roles\":[\"sknxrwzawnvsbcf\",\"zagxnvhycvdi\",\"wrzregzgyufu\"],\"applicationName\":\"wpwerye\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RuntimeScriptActionDetail response = manager.scriptActions() - .getExecutionDetailWithResponse("yzjdnrqjbt", "jeaoqaqbz", "yh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kwywzwofalic", response.name()); - Assertions.assertEquals("duoiqt", response.uri()); - Assertions.assertEquals("t", response.parameters()); - Assertions.assertEquals("sknxrwzawnvsbcf", response.roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterMockTests.java deleted file mode 100644 index 28ac489edfea..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListByClusterMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScriptActionsListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"scriptExecutionId\":2665247310105497195,\"startTime\":\"xaeaovurexdnds\",\"endTime\":\"weaderzm\",\"status\":\"t\",\"operation\":\"agttm\",\"executionSummary\":[{\"status\":\"goaqylkjztj\",\"instanceCount\":1339575917},{\"status\":\"jcg\",\"instanceCount\":556812746},{\"status\":\"pfinzcpdltkrlg\",\"instanceCount\":408763108}],\"debugInformation\":\"drvcqguef\",\"name\":\"hompheqdurelyu\",\"uri\":\"lf\",\"parameters\":\"u\",\"roles\":[\"ckyeclcdigpta\",\"brzmqxucycijoclx\"],\"applicationName\":\"tgjcy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.scriptActions().listByCluster("lbnb", "xvhcs", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hompheqdurelyu", response.iterator().next().name()); - Assertions.assertEquals("lf", response.iterator().next().uri()); - Assertions.assertEquals("u", response.iterator().next().parameters()); - Assertions.assertEquals("ckyeclcdigpta", response.iterator().next().roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListTests.java deleted file mode 100644 index e34378721246..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptActionsListTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; -import com.azure.resourcemanager.hdinsight.models.ScriptActionsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScriptActionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptActionsList model = BinaryData.fromString( - "{\"value\":[{\"scriptExecutionId\":1563332735084443990,\"startTime\":\"ft\",\"endTime\":\"qobr\",\"status\":\"nac\",\"operation\":\"ckknhxkizvy\",\"executionSummary\":[{\"status\":\"vuljraaeranokqg\",\"instanceCount\":578630229},{\"status\":\"qnvb\",\"instanceCount\":387687877}],\"debugInformation\":\"a\",\"name\":\"xulcdisdos\",\"uri\":\"jbjsvgjrwh\",\"parameters\":\"vyc\",\"roles\":[\"dclxgc\"],\"applicationName\":\"nfnw\"},{\"scriptExecutionId\":3132711740281855287,\"startTime\":\"pdvjdhttzaefedx\",\"endTime\":\"ch\",\"status\":\"hk\",\"operation\":\"rjdqnsdfzp\",\"executionSummary\":[{\"status\":\"kylkdghrj\",\"instanceCount\":852383444}],\"debugInformation\":\"lwxezwzhokvbwnh\",\"name\":\"tqlgehgppi\",\"uri\":\"ifhpf\",\"parameters\":\"ajvgcxtxjcsheafi\",\"roles\":[\"tugsresmkssjh\",\"iftxfkf\",\"egprhptil\",\"ucb\"],\"applicationName\":\"tgdqohmcwsldriz\"},{\"scriptExecutionId\":7692206600451693142,\"startTime\":\"ralllibphb\",\"endTime\":\"mizak\",\"status\":\"ankjpdnjzh\",\"operation\":\"oylhjlmuoyxprimr\",\"executionSummary\":[{\"status\":\"eecjmeis\",\"instanceCount\":1157129881},{\"status\":\"asylwx\",\"instanceCount\":1212726658}],\"debugInformation\":\"mweoohgu\",\"name\":\"fuzboyjathwtzolb\",\"uri\":\"emwmdxmebwjs\",\"parameters\":\"p\",\"roles\":[\"lxveabfqx\",\"mwmqtibx\"],\"applicationName\":\"jddtvqct\"},{\"scriptExecutionId\":3995165957523237174,\"startTime\":\"aeukm\",\"endTime\":\"ieekpndzaa\",\"status\":\"udqmeqwigpibudq\",\"operation\":\"xebeybpmz\",\"executionSummary\":[{\"status\":\"ff\",\"instanceCount\":1447322372},{\"status\":\"tmhheioqa\",\"instanceCount\":170135486},{\"status\":\"eufuqyrxpdlcgql\",\"instanceCount\":732264201}],\"debugInformation\":\"jqfrddgamquh\",\"name\":\"os\",\"uri\":\"sjuivfcdisyir\",\"parameters\":\"zhczexrxzbujrtrh\",\"roles\":[\"wrevkhgnlnzon\",\"lrpiqywnc\",\"jtszcof\",\"zehtdhgb\"],\"applicationName\":\"vreljea\"}],\"nextLink\":\"rvzmlovuana\"}") - .toObject(ScriptActionsList.class); - Assertions.assertEquals("xulcdisdos", model.value().get(0).name()); - Assertions.assertEquals("jbjsvgjrwh", model.value().get(0).uri()); - Assertions.assertEquals("vyc", model.value().get(0).parameters()); - Assertions.assertEquals("dclxgc", model.value().get(0).roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptActionsList model = new ScriptActionsList().withValue(Arrays.asList( - new RuntimeScriptActionDetailInner().withName("xulcdisdos") - .withUri("jbjsvgjrwh") - .withParameters("vyc") - .withRoles(Arrays.asList("dclxgc")), - new RuntimeScriptActionDetailInner().withName("tqlgehgppi") - .withUri("ifhpf") - .withParameters("ajvgcxtxjcsheafi") - .withRoles(Arrays.asList("tugsresmkssjh", "iftxfkf", "egprhptil", "ucb")), - new RuntimeScriptActionDetailInner().withName("fuzboyjathwtzolb") - .withUri("emwmdxmebwjs") - .withParameters("p") - .withRoles(Arrays.asList("lxveabfqx", "mwmqtibx")), - new RuntimeScriptActionDetailInner().withName("os") - .withUri("sjuivfcdisyir") - .withParameters("zhczexrxzbujrtrh") - .withRoles(Arrays.asList("wrevkhgnlnzon", "lrpiqywnc", "jtszcof", "zehtdhgb")))); - model = BinaryData.fromObject(model).toObject(ScriptActionsList.class); - Assertions.assertEquals("xulcdisdos", model.value().get(0).name()); - Assertions.assertEquals("jbjsvgjrwh", model.value().get(0).uri()); - Assertions.assertEquals("vyc", model.value().get(0).parameters()); - Assertions.assertEquals("dclxgc", model.value().get(0).roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesListByClusterMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesListByClusterMockTests.java deleted file mode 100644 index d4e946ca1eee..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesListByClusterMockTests.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.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScriptExecutionHistoriesListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - String responseStr - = "{\"value\":[{\"scriptExecutionId\":6880850551293493350,\"startTime\":\"xee\",\"endTime\":\"xiqhzlraymezxlsk\",\"status\":\"mxrfdsa\",\"operation\":\"ednwyyshtu\",\"executionSummary\":[{\"status\":\"vuafpwzyifr\",\"instanceCount\":2115372469},{\"status\":\"txeqi\",\"instanceCount\":1298920970},{\"status\":\"dyimsfay\",\"instanceCount\":771634222}],\"debugInformation\":\"avkjog\",\"name\":\"sl\",\"uri\":\"bnsmjkwynqxaek\",\"parameters\":\"ykvwjtqpkevmyltj\",\"roles\":[\"spxklu\",\"cclfgxannn\"],\"applicationName\":\"t\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.scriptExecutionHistories() - .listByCluster("tfvpndpmiljpn", "ynudqllzsa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sl", response.iterator().next().name()); - Assertions.assertEquals("bnsmjkwynqxaek", response.iterator().next().uri()); - Assertions.assertEquals("ykvwjtqpkevmyltj", response.iterator().next().parameters()); - Assertions.assertEquals("spxklu", response.iterator().next().roles().get(0)); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesPromoteWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesPromoteWithResponseMockTests.java deleted file mode 100644 index e4ad4571eaad..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ScriptExecutionHistoriesPromoteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScriptExecutionHistoriesPromoteWithResponseMockTests { - @Test - public void testPromoteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.scriptExecutionHistories() - .promoteWithResponse("posew", "igpxvkq", "aupxvpi", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ServiceSpecificationTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ServiceSpecificationTests.java deleted file mode 100644 index 3e403b3c2653..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Dimension; -import com.azure.resourcemanager.hdinsight.models.MetricSpecifications; -import com.azure.resourcemanager.hdinsight.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = BinaryData.fromString( - "{\"metricSpecifications\":[{\"name\":\"vxilcbt\",\"displayName\":\"hnze\",\"displayDescription\":\"xtjjfzqlqhycav\",\"unit\":\"ggxdb\",\"aggregationType\":\"smieknlra\",\"supportedAggregationTypes\":[\"awiuagyd\",\"qfby\",\"yr\",\"giagtcojo\"],\"supportedTimeGrainTypes\":[\"ogfnzjvusf\",\"ld\",\"ozuxylfsbtkadpys\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"tgkbugrjqctojc\",\"sourceMdmNamespace\":\"sofieypefojyqd\",\"metricFilterPattern\":\"u\",\"fillGapWithZero\":false,\"category\":\"lcwkhihihlhz\",\"resourceIdDimensionNameOverride\":\"qtz\",\"isInternal\":true,\"delegateMetricNameOverride\":\"nowc\",\"dimensions\":[{\"name\":\"mvec\",\"displayName\":\"txmwoteyow\",\"internalName\":\"uqovekqvgqouwif\",\"toBeExportedForShoebox\":false},{\"name\":\"wyivqikf\",\"displayName\":\"vhrfsphuagrt\",\"internalName\":\"kteusqczk\",\"toBeExportedForShoebox\":false},{\"name\":\"xubyjaffmmfblcqc\",\"displayName\":\"bgq\",\"internalName\":\"rtalmet\",\"toBeExportedForShoebox\":false},{\"name\":\"dslqxihhrmooizqs\",\"displayName\":\"pxiutc\",\"internalName\":\"pzhyr\",\"toBeExportedForShoebox\":true}]}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("vxilcbt", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("hnze", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("xtjjfzqlqhycav", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("ggxdb", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("smieknlra", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("awiuagyd", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("ogfnzjvusf", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("tgkbugrjqctojc", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("sofieypefojyqd", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("u", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("lcwkhihihlhz", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("qtz", model.metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("nowc", model.metricSpecifications().get(0).delegateMetricNameOverride()); - Assertions.assertEquals("mvec", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("txmwoteyow", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("uqovekqvgqouwif", - model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, - model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecifications().withName("vxilcbt") - .withDisplayName("hnze") - .withDisplayDescription("xtjjfzqlqhycav") - .withUnit("ggxdb") - .withAggregationType("smieknlra") - .withSupportedAggregationTypes(Arrays.asList("awiuagyd", "qfby", "yr", "giagtcojo")) - .withSupportedTimeGrainTypes(Arrays.asList("ogfnzjvusf", "ld", "ozuxylfsbtkadpys")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("tgkbugrjqctojc") - .withSourceMdmNamespace("sofieypefojyqd") - .withMetricFilterPattern("u") - .withFillGapWithZero(false) - .withCategory("lcwkhihihlhz") - .withResourceIdDimensionNameOverride("qtz") - .withIsInternal(true) - .withDelegateMetricNameOverride("nowc") - .withDimensions(Arrays.asList( - new Dimension().withName("mvec") - .withDisplayName("txmwoteyow") - .withInternalName("uqovekqvgqouwif") - .withToBeExportedForShoebox(false), - new Dimension().withName("wyivqikf") - .withDisplayName("vhrfsphuagrt") - .withInternalName("kteusqczk") - .withToBeExportedForShoebox(false), - new Dimension().withName("xubyjaffmmfblcqc") - .withDisplayName("bgq") - .withInternalName("rtalmet") - .withToBeExportedForShoebox(false), - new Dimension().withName("dslqxihhrmooizqs") - .withDisplayName("pxiutc") - .withInternalName("pzhyr") - .withToBeExportedForShoebox(true))))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("vxilcbt", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("hnze", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("xtjjfzqlqhycav", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("ggxdb", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("smieknlra", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("awiuagyd", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("ogfnzjvusf", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("tgkbugrjqctojc", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("sofieypefojyqd", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("u", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("lcwkhihihlhz", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("qtz", model.metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).isInternal()); - Assertions.assertEquals("nowc", model.metricSpecifications().get(0).delegateMetricNameOverride()); - Assertions.assertEquals("mvec", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("txmwoteyow", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("uqovekqvgqouwif", - model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, - model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/SshPublicKeyTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/SshPublicKeyTests.java deleted file mode 100644 index 457a35dbedc6..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/SshPublicKeyTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.SshPublicKey; -import org.junit.jupiter.api.Assertions; - -public final class SshPublicKeyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SshPublicKey model - = BinaryData.fromString("{\"certificateData\":\"imoryocfsfksym\"}").toObject(SshPublicKey.class); - Assertions.assertEquals("imoryocfsfksym", model.certificateData()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SshPublicKey model = new SshPublicKey().withCertificateData("imoryocfsfksym"); - model = BinaryData.fromObject(model).toObject(SshPublicKey.class); - Assertions.assertEquals("imoryocfsfksym", model.certificateData()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsageTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsageTests.java deleted file mode 100644 index 3ce031cc8765..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsageTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.Usage; -import org.junit.jupiter.api.Assertions; - -public final class UsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Usage model = BinaryData.fromString( - "{\"unit\":\"l\",\"currentValue\":4701202797943859637,\"limit\":171678662002400976,\"name\":{\"value\":\"twvogvbbe\",\"localizedValue\":\"cngqqmoakufgmjz\"}}") - .toObject(Usage.class); - Assertions.assertEquals("l", model.unit()); - Assertions.assertEquals(4701202797943859637L, model.currentValue()); - Assertions.assertEquals(171678662002400976L, model.limit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Usage model = new Usage().withUnit("l").withCurrentValue(4701202797943859637L).withLimit(171678662002400976L); - model = BinaryData.fromObject(model).toObject(Usage.class); - Assertions.assertEquals("l", model.unit()); - Assertions.assertEquals(4701202797943859637L, model.currentValue()); - Assertions.assertEquals(171678662002400976L, model.limit()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsagesListResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsagesListResultInnerTests.java deleted file mode 100644 index d407cf1995d3..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UsagesListResultInnerTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; -import com.azure.resourcemanager.hdinsight.models.Usage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UsagesListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsagesListResultInner model = BinaryData.fromString( - "{\"value\":[{\"unit\":\"dcpzfoqo\",\"currentValue\":4892524565143747736,\"limit\":6615741978857229687,\"name\":{\"value\":\"gszufoxciqopid\",\"localizedValue\":\"mciodhkhazxkhn\"}},{\"unit\":\"onlwntoeg\",\"currentValue\":8928756986200818231,\"limit\":8840780603115522856,\"name\":{\"value\":\"z\",\"localizedValue\":\"mrv\"}},{\"unit\":\"ztvbtqgsfr\",\"currentValue\":3999543626969444509,\"limit\":1008926283024648920,\"name\":{\"value\":\"lmnguxaw\",\"localizedValue\":\"ldsyuuximerqfob\"}},{\"unit\":\"znkbykutwpfhpagm\",\"currentValue\":5006093182566843640,\"limit\":5038627427973777976,\"name\":{\"value\":\"sd\",\"localizedValue\":\"kgtdlmkkze\"}}]}") - .toObject(UsagesListResultInner.class); - Assertions.assertEquals("dcpzfoqo", model.value().get(0).unit()); - Assertions.assertEquals(4892524565143747736L, model.value().get(0).currentValue()); - Assertions.assertEquals(6615741978857229687L, model.value().get(0).limit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsagesListResultInner model = new UsagesListResultInner().withValue(Arrays.asList( - new Usage().withUnit("dcpzfoqo").withCurrentValue(4892524565143747736L).withLimit(6615741978857229687L), - new Usage().withUnit("onlwntoeg").withCurrentValue(8928756986200818231L).withLimit(8840780603115522856L), - new Usage().withUnit("ztvbtqgsfr").withCurrentValue(3999543626969444509L).withLimit(1008926283024648920L), - new Usage().withUnit("znkbykutwpfhpagm") - .withCurrentValue(5006093182566843640L) - .withLimit(5038627427973777976L))); - model = BinaryData.fromObject(model).toObject(UsagesListResultInner.class); - Assertions.assertEquals("dcpzfoqo", model.value().get(0).unit()); - Assertions.assertEquals(4892524565143747736L, model.value().get(0).currentValue()); - Assertions.assertEquals(6615741978857229687L, model.value().get(0).limit()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UserAssignedIdentityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 3804d2c9fb82..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/UserAssignedIdentityTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.UserAssignedIdentity; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData - .fromString( - "{\"principalId\":\"vxqtayriwwroyqbe\",\"clientId\":\"mcqibycnojv\",\"tenantId\":\"mefqsgzvahapjyzh\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("mefqsgzvahapjyzh", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity().withTenantId("mefqsgzvahapjyzh"); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - Assertions.assertEquals("mefqsgzvahapjyzh", model.tenantId()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionSpecTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionSpecTests.java deleted file mode 100644 index 454e0740aecb..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionSpecTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.VersionSpec; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VersionSpecTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VersionSpec model = BinaryData.fromString( - "{\"friendlyName\":\"lvkgju\",\"displayName\":\"dknnqvsazn\",\"isDefault\":false,\"componentVersions\":{\"hmk\":\"udsgs\",\"rauwjuetaebu\":\"c\"}}") - .toObject(VersionSpec.class); - Assertions.assertEquals("lvkgju", model.friendlyName()); - Assertions.assertEquals("dknnqvsazn", model.displayName()); - Assertions.assertEquals(false, model.isDefault()); - Assertions.assertEquals("udsgs", model.componentVersions().get("hmk")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VersionSpec model = new VersionSpec().withFriendlyName("lvkgju") - .withDisplayName("dknnqvsazn") - .withIsDefault(false) - .withComponentVersions(mapOf("hmk", "udsgs", "rauwjuetaebu", "c")); - model = BinaryData.fromObject(model).toObject(VersionSpec.class); - Assertions.assertEquals("lvkgju", model.friendlyName()); - Assertions.assertEquals("dknnqvsazn", model.displayName()); - Assertions.assertEquals(false, model.isDefault()); - Assertions.assertEquals("udsgs", model.componentVersions().get("hmk")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionsCapabilityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionsCapabilityTests.java deleted file mode 100644 index 9ec5f481efca..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VersionsCapabilityTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.VersionsCapability; -import com.azure.resourcemanager.hdinsight.models.VersionSpec; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VersionsCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VersionsCapability model = BinaryData.fromString( - "{\"available\":[{\"friendlyName\":\"jaltolmnc\",\"displayName\":\"obqwcsdbnwdcfh\",\"isDefault\":true,\"componentVersions\":{\"vxb\":\"fuvglsbjjca\",\"udutnco\":\"t\",\"xqtvcofu\":\"mr\"}}]}") - .toObject(VersionsCapability.class); - Assertions.assertEquals("jaltolmnc", model.available().get(0).friendlyName()); - Assertions.assertEquals("obqwcsdbnwdcfh", model.available().get(0).displayName()); - Assertions.assertEquals(true, model.available().get(0).isDefault()); - Assertions.assertEquals("fuvglsbjjca", model.available().get(0).componentVersions().get("vxb")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VersionsCapability model - = new VersionsCapability().withAvailable(Arrays.asList(new VersionSpec().withFriendlyName("jaltolmnc") - .withDisplayName("obqwcsdbnwdcfh") - .withIsDefault(true) - .withComponentVersions(mapOf("vxb", "fuvglsbjjca", "udutnco", "t", "xqtvcofu", "mr")))); - model = BinaryData.fromObject(model).toObject(VersionsCapability.class); - Assertions.assertEquals("jaltolmnc", model.available().get(0).friendlyName()); - Assertions.assertEquals("obqwcsdbnwdcfh", model.available().get(0).displayName()); - Assertions.assertEquals(true, model.available().get(0).isDefault()); - Assertions.assertEquals("fuvglsbjjca", model.available().get(0).componentVersions().get("vxb")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsMockTests.java deleted file mode 100644 index 1664334841f7..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualMachinesRestartHostsMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hdinsight.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hdinsight.HDInsightManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VirtualMachinesRestartHostsMockTests { - @Test - public void testRestartHosts() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HDInsightManager manager = HDInsightManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.virtualMachines() - .restartHosts("rcyrucpcunnu", "dqumoenodnai", Arrays.asList("hqhsknd"), com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualNetworkProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualNetworkProfileTests.java deleted file mode 100644 index 9cf47abda2ee..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VirtualNetworkProfileTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.VirtualNetworkProfile; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkProfile model - = BinaryData.fromString("{\"id\":\"ys\",\"subnet\":\"i\"}").toObject(VirtualNetworkProfile.class); - Assertions.assertEquals("ys", model.id()); - Assertions.assertEquals("i", model.subnet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkProfile model = new VirtualNetworkProfile().withId("ys").withSubnet("i"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkProfile.class); - Assertions.assertEquals("ys", model.id()); - Assertions.assertEquals("i", model.subnet()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizeCompatibilityFilterV2Tests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizeCompatibilityFilterV2Tests.java deleted file mode 100644 index c65a10ced257..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizeCompatibilityFilterV2Tests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.FilterMode; -import com.azure.resourcemanager.hdinsight.models.OSType; -import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VmSizeCompatibilityFilterV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmSizeCompatibilityFilterV2 model = BinaryData.fromString( - "{\"filterMode\":\"Recommend\",\"regions\":[\"jlpijnkrx\",\"rddh\",\"ratiz\"],\"clusterFlavors\":[\"nasx\",\"ft\",\"zq\"],\"nodeTypes\":[\"f\",\"wesgogczh\",\"nnxk\"],\"clusterVersions\":[\"nyhmossxkkgthr\",\"gh\",\"jbdhqxvc\"],\"osType\":[\"Windows\",\"Windows\",\"Linux\",\"Windows\"],\"vmSizes\":[\"bshrnsvbuswd\",\"z\",\"ybycnunvj\",\"rtkfawnopq\"],\"espApplied\":\"kyzirtxdyux\",\"computeIsolationSupported\":\"jntpsewgioilqu\"}") - .toObject(VmSizeCompatibilityFilterV2.class); - Assertions.assertEquals(FilterMode.RECOMMEND, model.filterMode()); - Assertions.assertEquals("jlpijnkrx", model.regions().get(0)); - Assertions.assertEquals("nasx", model.clusterFlavors().get(0)); - Assertions.assertEquals("f", model.nodeTypes().get(0)); - Assertions.assertEquals("nyhmossxkkgthr", model.clusterVersions().get(0)); - Assertions.assertEquals(OSType.WINDOWS, model.osType().get(0)); - Assertions.assertEquals("bshrnsvbuswd", model.vmSizes().get(0)); - Assertions.assertEquals("kyzirtxdyux", model.espApplied()); - Assertions.assertEquals("jntpsewgioilqu", model.computeIsolationSupported()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmSizeCompatibilityFilterV2 model = new VmSizeCompatibilityFilterV2().withFilterMode(FilterMode.RECOMMEND) - .withRegions(Arrays.asList("jlpijnkrx", "rddh", "ratiz")) - .withClusterFlavors(Arrays.asList("nasx", "ft", "zq")) - .withNodeTypes(Arrays.asList("f", "wesgogczh", "nnxk")) - .withClusterVersions(Arrays.asList("nyhmossxkkgthr", "gh", "jbdhqxvc")) - .withOsType(Arrays.asList(OSType.WINDOWS, OSType.WINDOWS, OSType.LINUX, OSType.WINDOWS)) - .withVmSizes(Arrays.asList("bshrnsvbuswd", "z", "ybycnunvj", "rtkfawnopq")) - .withEspApplied("kyzirtxdyux") - .withComputeIsolationSupported("jntpsewgioilqu"); - model = BinaryData.fromObject(model).toObject(VmSizeCompatibilityFilterV2.class); - Assertions.assertEquals(FilterMode.RECOMMEND, model.filterMode()); - Assertions.assertEquals("jlpijnkrx", model.regions().get(0)); - Assertions.assertEquals("nasx", model.clusterFlavors().get(0)); - Assertions.assertEquals("f", model.nodeTypes().get(0)); - Assertions.assertEquals("nyhmossxkkgthr", model.clusterVersions().get(0)); - Assertions.assertEquals(OSType.WINDOWS, model.osType().get(0)); - Assertions.assertEquals("bshrnsvbuswd", model.vmSizes().get(0)); - Assertions.assertEquals("kyzirtxdyux", model.espApplied()); - Assertions.assertEquals("jntpsewgioilqu", model.computeIsolationSupported()); - } -} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizePropertyTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizePropertyTests.java deleted file mode 100644 index a3a4e63342bd..000000000000 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/test/java/com/azure/resourcemanager/hdinsight/generated/VmSizePropertyTests.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.hdinsight.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hdinsight.models.VmSizeProperty; -import org.junit.jupiter.api.Assertions; - -public final class VmSizePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmSizeProperty model = BinaryData.fromString( - "{\"name\":\"ydxtqm\",\"cores\":323647852,\"dataDiskStorageTier\":\"orgguf\",\"label\":\"aomtbghhavgrvkff\",\"maxDataDiskCount\":5595663447131926478,\"memoryInMb\":3841332379064621298,\"supportedByVirtualMachines\":true,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":6764739063385765952,\"webWorkerResourceDiskSizeInMb\":7551905176757776284}") - .toObject(VmSizeProperty.class); - Assertions.assertEquals("ydxtqm", model.name()); - Assertions.assertEquals(323647852, model.cores()); - Assertions.assertEquals("orgguf", model.dataDiskStorageTier()); - Assertions.assertEquals("aomtbghhavgrvkff", model.label()); - Assertions.assertEquals(5595663447131926478L, model.maxDataDiskCount()); - Assertions.assertEquals(3841332379064621298L, model.memoryInMb()); - Assertions.assertEquals(true, model.supportedByVirtualMachines()); - Assertions.assertEquals(true, model.supportedByWebWorkerRoles()); - Assertions.assertEquals(6764739063385765952L, model.virtualMachineResourceDiskSizeInMb()); - Assertions.assertEquals(7551905176757776284L, model.webWorkerResourceDiskSizeInMb()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmSizeProperty model = new VmSizeProperty().withName("ydxtqm") - .withCores(323647852) - .withDataDiskStorageTier("orgguf") - .withLabel("aomtbghhavgrvkff") - .withMaxDataDiskCount(5595663447131926478L) - .withMemoryInMb(3841332379064621298L) - .withSupportedByVirtualMachines(true) - .withSupportedByWebWorkerRoles(true) - .withVirtualMachineResourceDiskSizeInMb(6764739063385765952L) - .withWebWorkerResourceDiskSizeInMb(7551905176757776284L); - model = BinaryData.fromObject(model).toObject(VmSizeProperty.class); - Assertions.assertEquals("ydxtqm", model.name()); - Assertions.assertEquals(323647852, model.cores()); - Assertions.assertEquals("orgguf", model.dataDiskStorageTier()); - Assertions.assertEquals("aomtbghhavgrvkff", model.label()); - Assertions.assertEquals(5595663447131926478L, model.maxDataDiskCount()); - Assertions.assertEquals(3841332379064621298L, model.memoryInMb()); - Assertions.assertEquals(true, model.supportedByVirtualMachines()); - Assertions.assertEquals(true, model.supportedByWebWorkerRoles()); - Assertions.assertEquals(6764739063385765952L, model.virtualMachineResourceDiskSizeInMb()); - Assertions.assertEquals(7551905176757776284L, model.webWorkerResourceDiskSizeInMb()); - } -}