diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/CHANGELOG.md b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/CHANGELOG.md index a1aae67e5a690..968c9000d81dd 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/CHANGELOG.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/CHANGELOG.md @@ -1,14 +1,754 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2024-08-22) -### Features Added +- Azure Resource Manager HDInsightContainers client library for Java. This package contains Microsoft Azure SDK for HDInsightContainers Management SDK. HDInsight Containers Management Client. Package tag package-preview-2024-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ClusterHotfixUpgradeProperties` was modified + +* `targetBuildNumber()` was removed +* `targetClusterVersion()` was removed +* `componentName()` was removed +* `targetOssVersion()` was removed + +#### `models.ClusterAvailableUpgradeHotfixUpgradeProperties` was modified + +* `componentName()` was removed +* `description()` was removed +* `sourceOssVersion()` was removed +* `extendedProperties()` was removed +* `targetOssVersion()` was removed +* `sourceClusterVersion()` was removed +* `targetBuildNumber()` was removed +* `createdTime()` was removed +* `sourceBuildNumber()` was removed +* `severity()` was removed +* `targetClusterVersion()` was removed + +#### `models.KafkaProfile` was modified + +* `clusterIdentity()` was removed + +### Features Added + +* `models.ClusterPatchVersionUpgradeRollbackHistoryProperties` was added + +* `models.PyPiLibraryProperties` was added + +* `models.ClusterPoolUpgradeHistoryListResult` was added + +* `models.ClusterAvailableUpgradePatchVersionUpgradeProperties` was added + +* `models.ClusterLibraryManagementOperation` was added + +* `models.ClusterPoolUpgradeHistoryType` was added + +* `models.ClusterAvailableInPlaceUpgradeProperties` was added + +* `models.ManagedIdentityType` was added + +* `models.ClusterPoolUpgradeHistories` was added + +* `models.ClusterPoolNodeOsUpgradeHistoryProperties` was added + +* `models.ClusterUpgradeHistoryType` was added + +* `models.ClusterUpgradeHistory` was added + +* `models.Category` was added + +* `models.Status` was added + +* `models.ClusterLibraries` was added + +* `models.ClusterUpgradeHistorySeverityType` was added + +* `models.ClusterAksPatchUpgradeHistoryProperties` was added + +* `models.ClusterLibraryManagementOperationProperties` was added + +* `models.MavenLibraryProperties` was added + +* `models.ClusterUpgradeHistoryListResult` was added + +* `models.ClusterUpgradeRollback` was added + +* `models.ClusterHotfixUpgradeHistoryProperties` was added + +* `models.ClusterInPlaceUpgradeHistoryProperties` was added + +* `models.ClusterLibraryList` was added + +* `models.ClusterPatchVersionUpgradeProperties` was added + +* `models.Type` was added + +* `models.ClusterPoolUpgradeHistoryUpgradeResultType` was added + +* `models.ClusterUpgradeHistories` was added + +* `models.ClusterUpgradeRollbackProperties` was added + +* `models.ClusterPoolUpgradeHistory` was added + +* `models.ManagedIdentityProfile` was added + +* `models.ClusterInPlaceUpgradeProperties` was added + +* `models.IpTag` was added + +* `models.ClusterLibrary` was added + +* `models.ClusterPatchVersionUpgradeHistoryProperties` was added + +* `models.ClusterPoolUpgradeHistoryProperties` was added + +* `models.ClusterLibraryProperties` was added + +* `models.ClusterPoolAksPatchUpgradeHistoryProperties` was added + +* `models.LibraryManagementAction` was added + +* `models.ClusterUpgradeHistoryUpgradeResultType` was added + +* `models.ClusterUpgradeHistoryProperties` was added + +* `models.ManagedIdentitySpec` was added + +* `models.ClusterHotfixUpgradeRollbackHistoryProperties` was added + +#### `models.ClusterServiceConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterUpgradeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `upgradeType()` was added + +#### `models.RangerAdminSpecDatabase` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterInstanceViewStatus` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScriptActionProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceConfigResultProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RangerUsersyncSpec` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPatchProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolResourcePropertiesAksClusterProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `aksVersion()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolNodeOsImageUpdateProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `upgradeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoCoordinator` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolResourcePropertiesComputeProfile` was modified + +* `count()` was added +* `withAvailabilityZones(java.util.List)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterAccessProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SecretReference` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Cluster` was modified + +* `upgradeManualRollback(models.ClusterUpgradeRollback)` was added +* `upgradeManualRollback(models.ClusterUpgradeRollback,com.azure.core.util.Context)` was added + +#### `models.ServiceConfigListResultProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FlinkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoUserPlugin` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FlinkCatalogOptions` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterProfile` was modified + +* `managedIdentityProfile()` was added +* `withManagedIdentityProfile(models.ManagedIdentityProfile)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterAvailableUpgradeAksPatchUpgradeProperties` was modified + +* `upgradeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SparkUserPlugins` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CatalogOptions` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SparkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterResizeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterRangerPluginProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterInstanceViewsResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceConfigListResultValueEntity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterHotfixUpgradeProperties` was modified + +* `withTargetOssVersion(java.lang.String)` was added +* `upgradeType()` was added +* `withTargetBuildNumber(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withComponentName(java.lang.String)` was added +* `withTargetClusterVersion(java.lang.String)` was added + +#### `models.ComputeProfile` was modified + +* `availabilityZones()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withAvailabilityZones(java.util.List)` was added + +#### `models.ClusterLogAnalyticsApplicationLogs` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConnectivityProfileWeb` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterAvailableUpgradeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `upgradeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolVersionsListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoUserPlugins` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `HDInsightContainersManager` was modified + +* `clusterLibraries()` was added +* `clusterPoolUpgradeHistories()` was added +* `clusterUpgradeHistories()` was added + +#### `models.ClusterPoolResourcePropertiesNetworkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.LoadBasedConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterAvailableUpgradeHotfixUpgradeProperties` was modified + +* `withTargetBuildNumber(java.lang.String)` was added +* `withSourceClusterVersion(java.lang.String)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withCreatedTime(java.time.OffsetDateTime)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withComponentName(java.lang.String)` was added +* `upgradeType()` was added +* `withExtendedProperties(java.lang.String)` was added +* `withSourceOssVersion(java.lang.String)` was added +* `withTargetClusterVersion(java.lang.String)` was added +* `withDescription(java.lang.String)` was added +* `withSourceBuildNumber(java.lang.String)` was added +* `withSeverity(models.Severity)` was added +* `withTargetOssVersion(java.lang.String)` was added + +#### `models.ClusterServiceConfigsProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SecretsProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SparkUserPlugin` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WebConnectivityEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoDebugConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterVersionsListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterAksPatchVersionUpgradeProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `upgradeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScheduleBasedConfig` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoWorker` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolAvailableUpgradeList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolVersionProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SshConnectivityEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TagsObject` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TrinoTelemetryConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KafkaProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolComputeProfile` was modified + +* `withAvailabilityZones(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `availabilityZones()` was added + +#### `models.ClusterResizeData` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `id()` was added +* `type()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `name()` was added + +#### `models.DiskStorageProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AksClusterProfileAksClusterAgentPoolIdentityProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AutoscaleProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolResourcePropertiesLogAnalyticsProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KafkaConnectivityEndpoints` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RangerAuditSpec` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshProfile` was modified + +* `withVmSize(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `vmSize()` was added + +#### `models.ClusterVersionProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AksClusterProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NameAvailabilityParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrinoUserTelemetry` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolResourcePropertiesClusterPoolProfile` was modified + +* `withPublicIpTag(models.IpTag)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolUpgrade` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterJobList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolAvailableUpgradeNodeOsUpgradeProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `upgradeType()` was added + +#### `models.ClusterPoolAksPatchVersionUpgradeProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `upgradeType()` was added + +#### `models.ClusterComponentsItem` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FlinkJobProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConnectivityProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withPublicIpTag(models.IpTag)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `publicIpTag()` was added + +#### `models.FlinkJobProperties` was modified + +* `jobType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComparisonRule` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TrinoProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RangerProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterAvailableUpgradeList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScalingRule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RangerAdminSpec` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServiceConfigListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterLogAnalyticsProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPoolNetworkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterInstanceViewResultProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterUpgrade` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AuthorizationProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FlinkStorageProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Schedule` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NodeProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterInstanceViewPropertiesStatus` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterResourceProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SparkMetastoreSpec` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.IdentityProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterInstanceViewProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterJobProperties` was modified + +* `jobType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolLogAnalyticsProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Clusters` was modified + +* `upgradeManualRollback(java.lang.String,java.lang.String,java.lang.String,models.ClusterUpgradeRollback,com.azure.core.util.Context)` was added +* `upgradeManualRollback(java.lang.String,java.lang.String,java.lang.String,models.ClusterUpgradeRollback)` was added + +#### `models.UpdatableClusterProfile` was modified + +* `secretsProfile()` was added +* `withTrinoProfile(models.TrinoProfile)` was added +* `withSecretsProfile(models.SecretsProfile)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `trinoProfile()` was added + +#### `models.OperationListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolAvailableUpgradeProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `upgradeType()` was added + +#### `models.ClusterPrometheusProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FlinkHiveCatalogOption` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolResourceProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HiveCatalogOption` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterConfigFile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeResourceDefinition` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServiceStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterPoolAvailableUpgradeAksPatchUpgradeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `upgradeType()` was added + +#### `models.ClusterPoolUpgradeProperties` was modified -### Other Changes +* `upgradeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.0.0-beta.2 (2024-04-03) diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/README.md b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/README.md index 8ac9e242a0584..da157e7c2bb00 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/README.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HDInsightContainers client library for Java. -This package contains Microsoft Azure SDK for HDInsightContainers Management SDK. HDInsight Containers Management Client. Package tag package-preview-2023-11. 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 HDInsightContainers Management SDK. HDInsight Containers Management Client. Package tag package-preview-2024-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hdinsight-containers - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/SAMPLE.md b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/SAMPLE.md index 7193bd2c4441e..fb4e97399eb4b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/SAMPLE.md +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/SAMPLE.md @@ -18,10 +18,19 @@ - [List](#clusterjobs_list) - [RunJob](#clusterjobs_runjob) +## ClusterLibraries + +- [List](#clusterlibraries_list) +- [ManageLibraries](#clusterlibraries_managelibraries) + ## ClusterPoolAvailableUpgrades - [List](#clusterpoolavailableupgrades_list) +## ClusterPoolUpgradeHistories + +- [List](#clusterpoolupgradehistories_list) + ## ClusterPools - [CreateOrUpdate](#clusterpools_createorupdate) @@ -32,6 +41,10 @@ - [UpdateTags](#clusterpools_updatetags) - [Upgrade](#clusterpools_upgrade) +## ClusterUpgradeHistories + +- [List](#clusterupgradehistories_list) + ## Clusters - [Create](#clusters_create) @@ -44,6 +57,7 @@ - [Resize](#clusters_resize) - [Update](#clusters_update) - [Upgrade](#clusters_upgrade) +- [UpgradeManualRollback](#clusters_upgrademanualrollback) ## Locations @@ -61,7 +75,7 @@ public final class AvailableClusterPoolVersionsListByLocationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListAvailableClusterPoolVersions.json */ /** @@ -85,7 +99,7 @@ public final class AvailableClusterPoolVersionsListByLocationSamples { public final class AvailableClusterVersionsListByLocationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListAvailableClusterVersions.json */ /** @@ -109,7 +123,7 @@ public final class AvailableClusterVersionsListByLocationSamples { public final class ClusterAvailableUpgradesListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterAvailableUpgrades.json */ /** @@ -119,8 +133,8 @@ public final class ClusterAvailableUpgradesListSamples { */ public static void getClusterAvailableUpgrade(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterAvailableUpgrades().list("hiloResourcegroup", "clusterpool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusterAvailableUpgrades() + .list("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -134,7 +148,7 @@ public final class ClusterAvailableUpgradesListSamples { public final class ClusterJobsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterJobs.json */ /** @@ -144,8 +158,8 @@ public final class ClusterJobsListSamples { */ public static void listClusterJobs(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterJobs().list("hiloResourcegroup", "clusterPool1", "cluster1", null, - com.azure.core.util.Context.NONE); + manager.clusterJobs() + .list("hiloResourcegroup", "clusterPool1", "cluster1", null, com.azure.core.util.Context.NONE); } } ``` @@ -165,7 +179,7 @@ import java.util.Map; public final class ClusterJobsRunJobSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * RunClusterJob.json */ /** @@ -181,7 +195,8 @@ public final class ClusterJobsRunJobSamples { .withProperties(new FlinkJobProperties().withJobName("flink-job-name") .withJobJarDirectory("abfs://flinkjob@hilosa.dfs.core.windows.net/jars") .withJarName("flink-sleep-job-0.0.1-SNAPSHOT.jar") - .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob").withAction(Action.START) + .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob") + .withAction(Action.START) .withFlinkConfiguration(mapOf("parallelism", "1", "savepoint.directory", "abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"))), com.azure.core.util.Context.NONE); @@ -201,6 +216,119 @@ public final class ClusterJobsRunJobSamples { } ``` +### ClusterLibraries_List + +```java +import com.azure.resourcemanager.hdinsight.containers.models.Category; + +/** + * Samples for ClusterLibraries List. + */ +public final class ClusterLibrariesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListPredefinedClusterLibraries.json + */ + /** + * Sample code: ListPredefinedClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void listPredefinedClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .list("hiloResourceGroup", "clusterPool", "cluster", Category.PREDEFINED, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListUserCustomClusterLibraries.json + */ + /** + * Sample code: ListUserCustomClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void listUserCustomClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .list("hiloResourceGroup", "clusterPool", "cluster", Category.CUSTOM, com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterLibraries_ManageLibraries + +```java +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperationProperties; +import com.azure.resourcemanager.hdinsight.containers.models.LibraryManagementAction; +import com.azure.resourcemanager.hdinsight.containers.models.MavenLibraryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.PyPiLibraryProperties; +import java.util.Arrays; + +/** + * Samples for ClusterLibraries ManageLibraries. + */ +public final class ClusterLibrariesManageLibrariesSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * UninstallExistingClusterLibraries.json + */ + /** + * Sample code: UninstallExistingClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void uninstallExistingClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .manageLibraries("hiloResourceGroup", "clusterPool", "cluster", + new ClusterLibraryManagementOperation().withProperties(new ClusterLibraryManagementOperationProperties() + .withAction(LibraryManagementAction.UNINSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner().withProperties(new PyPiLibraryProperties().withName("tensorflow")), + new ClusterLibraryInner() + .withProperties(new MavenLibraryProperties().withGroupId("org.apache.flink") + .withName("flink-connector-hudi"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * InstallNewClusterLibraries.json + */ + /** + * Sample code: InstallNewClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void + installNewClusterLibraries(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .manageLibraries("hiloResourceGroup", "clusterPool", "cluster", + new ClusterLibraryManagementOperation().withProperties( + new ClusterLibraryManagementOperationProperties().withAction(LibraryManagementAction.INSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner() + .withProperties(new PyPiLibraryProperties().withRemarks("PyPi packages.") + .withName("requests") + .withVersion("2.31.0")), + new ClusterLibraryInner() + .withProperties(new MavenLibraryProperties().withRemarks("Maven packages.") + .withGroupId("org.apache.flink") + .withName("flink-connector-kafka") + .withVersion("3.0.2-1.18"))))), + com.azure.core.util.Context.NONE); + } +} +``` + ### ClusterPoolAvailableUpgrades_List ```java @@ -210,7 +338,7 @@ public final class ClusterJobsRunJobSamples { public final class ClusterPoolAvailableUpgradesListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPoolAvailableUpgrades.json */ /** @@ -220,8 +348,33 @@ public final class ClusterPoolAvailableUpgradesListSamples { */ public static void getClusterPoolAvailableUpgrade( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPoolAvailableUpgrades().list("hiloResourcegroup", "clusterpool1", - com.azure.core.util.Context.NONE); + manager.clusterPoolAvailableUpgrades() + .list("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterPoolUpgradeHistories_List + +```java +/** + * Samples for ClusterPoolUpgradeHistories List. + */ +public final class ClusterPoolUpgradeHistoriesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListClusterPoolUpgradeHistory.json + */ + /** + * Sample code: ClusterPoolUpgradeHistoriesListResult. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void clusterPoolUpgradeHistoriesListResult( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterPoolUpgradeHistories() + .list("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); } } ``` @@ -234,6 +387,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResource import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; +import java.util.Arrays; /** * Samples for ClusterPools CreateOrUpdate. @@ -241,7 +395,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; public final class ClusterPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPoolWithPrivateAks.json */ /** @@ -251,12 +405,15 @@ public final class ClusterPoolsCreateOrUpdateSamples { */ public static void clusterPoolPutWithPrivateAks( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2")) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId( "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1") .withEnablePrivateApiServer(true))) @@ -265,7 +422,7 @@ public final class ClusterPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPoolWithUDRAks.json */ /** @@ -275,12 +432,15 @@ public final class ClusterPoolsCreateOrUpdateSamples { */ public static void clusterPoolPutWithUDRAks(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2")) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId( "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1") .withOutboundType(OutboundType.USER_DEFINED_ROUTING))) @@ -289,7 +449,7 @@ public final class ClusterPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPool.json */ /** @@ -299,12 +459,15 @@ public final class ClusterPoolsCreateOrUpdateSamples { */ public static void clusterPoolPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3")))) .create(); } } @@ -319,7 +482,7 @@ public final class ClusterPoolsCreateOrUpdateSamples { public final class ClusterPoolsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * DeleteClusterPool.json */ /** @@ -343,7 +506,7 @@ public final class ClusterPoolsDeleteSamples { public final class ClusterPoolsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetClusterPool.json */ /** @@ -353,8 +516,8 @@ public final class ClusterPoolsGetByResourceGroupSamples { */ public static void clusterPoolGet(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", - com.azure.core.util.Context.NONE); + manager.clusterPools() + .getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); } } ``` @@ -368,7 +531,7 @@ public final class ClusterPoolsGetByResourceGroupSamples { public final class ClusterPoolsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPoolsSubscription.json */ /** @@ -392,7 +555,7 @@ public final class ClusterPoolsListSamples { public final class ClusterPoolsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPools.json */ /** @@ -420,7 +583,7 @@ import java.util.Map; public final class ClusterPoolsUpdateTagsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchClusterPool.json */ /** @@ -463,7 +626,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgrade; public final class ClusterPoolsUpgradeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeNodeOsForClusterPool.json */ /** @@ -473,14 +636,15 @@ public final class ClusterPoolsUpgradeSamples { */ public static void clusterPoolsUpgradeNodeOs(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().upgrade("hiloResourcegroup", "clusterpool1", - new ClusterPoolUpgrade().withProperties(new ClusterPoolNodeOsImageUpdateProperties()), - com.azure.core.util.Context.NONE); + manager.clusterPools() + .upgrade("hiloResourcegroup", "clusterpool1", + new ClusterPoolUpgrade().withProperties(new ClusterPoolNodeOsImageUpdateProperties()), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeAKSPatchVersionForClusterPool.json */ /** @@ -490,10 +654,37 @@ public final class ClusterPoolsUpgradeSamples { */ public static void clusterPoolsUpgradeAKSPatchVersion( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().upgrade("hiloResourcegroup", "clusterpool1", - new ClusterPoolUpgrade().withProperties(new ClusterPoolAksPatchVersionUpgradeProperties() - .withUpgradeClusterPool(true).withUpgradeAllClusterNodes(false)), - com.azure.core.util.Context.NONE); + manager.clusterPools() + .upgrade("hiloResourcegroup", "clusterpool1", + new ClusterPoolUpgrade() + .withProperties(new ClusterPoolAksPatchVersionUpgradeProperties().withUpgradeClusterPool(true) + .withUpgradeAllClusterNodes(false)), + com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterUpgradeHistories_List + +```java +/** + * Samples for ClusterUpgradeHistories List. + */ +public final class ClusterUpgradeHistoriesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListClusterUpgradeHistory.json + */ + /** + * Sample code: ClusterUpgradeHistoriesListResult. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void clusterUpgradeHistoriesListResult( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterUpgradeHistories() + .list("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -513,8 +704,10 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterServiceConfi import com.azure.resourcemanager.hdinsight.containers.models.ComparisonOperator; import com.azure.resourcemanager.hdinsight.containers.models.ComparisonRule; import com.azure.resourcemanager.hdinsight.containers.models.ComputeProfile; -import com.azure.resourcemanager.hdinsight.containers.models.IdentityProfile; import com.azure.resourcemanager.hdinsight.containers.models.LoadBasedConfig; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityProfile; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentitySpec; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityType; import com.azure.resourcemanager.hdinsight.containers.models.NodeProfile; import com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpec; import com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpecDatabase; @@ -540,7 +733,7 @@ import java.util.Map; public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateSparkCluster.json */ /** @@ -550,22 +743,28 @@ public final class ClustersCreateSamples { */ public static void hDInsightSparkClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("spark") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) .withServiceConfigsProfiles(Arrays.asList( - new ClusterServiceConfigsProfile().withServiceName("spark-service").withConfigs( - Arrays.asList(new ClusterServiceConfig() - .withComponent("spark-config") + new ClusterServiceConfigsProfile().withServiceName("spark-service") + .withConfigs(Arrays.asList(new ClusterServiceConfig().withComponent("spark-config") .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("spark-defaults.conf") .withValues(mapOf("spark.eventLog.enabled", "true")))))), new ClusterServiceConfigsProfile().withServiceName("yarn-service") @@ -578,13 +777,14 @@ public final class ClustersCreateSamples { "storage.name", "teststorage", "storage.protocol", "wasb")), new ClusterConfigFile().withFileName("yarn-site.xml") .withValues(mapOf("yarn.webapp.ui2.enable", "false")))))))) - .withSshProfile(new SshProfile().withCount(2)).withSparkProfile(new SparkProfile()))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_D3_v2")) + .withSparkProfile(new SparkProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateSparkClusterWithInternalIngress.json */ /** @@ -594,22 +794,28 @@ public final class ClustersCreateSamples { */ public static void hDInsightSparkClusterPutWithInternalIngress( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("spark") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) .withServiceConfigsProfiles(Arrays.asList( - new ClusterServiceConfigsProfile().withServiceName("spark-service").withConfigs( - Arrays.asList(new ClusterServiceConfig() - .withComponent("spark-config") + new ClusterServiceConfigsProfile().withServiceName("spark-service") + .withConfigs(Arrays.asList(new ClusterServiceConfig().withComponent("spark-config") .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("spark-defaults.conf") .withValues(mapOf("spark.eventLog.enabled", "true")))))), new ClusterServiceConfigsProfile().withServiceName("yarn-service") @@ -623,13 +829,14 @@ public final class ClustersCreateSamples { new ClusterConfigFile().withFileName("yarn-site.xml") .withValues(mapOf("yarn.webapp.ui2.enable", "false")))))))) .withClusterAccessProfile(new ClusterAccessProfile().withEnableInternalIngress(true)) - .withSshProfile(new SshProfile().withCount(2)).withSparkProfile(new SparkProfile()))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_D3_v2")) + .withSparkProfile(new SparkProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateAutoscaleCluster.json */ /** @@ -639,48 +846,62 @@ public final class ClustersCreateSamples { */ public static void hDInsightClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("Trino") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("Head").withVmSize("Standard_E8as_v5").withCount(2), - new NodeProfile().withType("Worker").withVmSize("Standard_E8as_v5").withCount(3)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("1.0.6").withOssVersion("0.410.0") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("Head").withVmSize("Standard_E8as_v5").withCount(2), + new NodeProfile().withType("Worker").withVmSize("Standard_E8as_v5").withCount(3))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("1.0.6") + .withOssVersion("0.410.0") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) - .withSshProfile(new SshProfile().withCount(2)) - .withAutoscaleProfile( - new AutoscaleProfile().withEnabled(true).withGracefulDecommissionTimeout(3600) - .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) - .withScheduleBasedConfig(new ScheduleBasedConfig() - .withTimeZone("Cen. Australia Standard Time").withDefaultCount(10) - .withSchedules(Arrays.asList( - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(20) - .withDays(Arrays.asList(ScheduleDay.MONDAY)), - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(25) - .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) - .withLoadBasedConfig(new LoadBasedConfig().withMinNodes(10).withMaxNodes(20) - .withPollInterval(60).withCooldownPeriod(300) - .withScalingRules(Arrays.asList( - new ScalingRule().withActionType(ScaleActionType.SCALEUP).withEvaluationCount(3) - .withScalingMetric("cpu") - .withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.GREATER_THAN).withThreshold(90f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(3) - .withScalingMetric("cpu") - .withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.LESS_THAN).withThreshold(20f)))))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_E8as_v5")) + .withAutoscaleProfile(new AutoscaleProfile().withEnabled(true) + .withGracefulDecommissionTimeout(3600) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig(new ScheduleBasedConfig().withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(10) + .withSchedules(Arrays.asList( + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(20) + .withDays(Arrays.asList(ScheduleDay.MONDAY)), + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(25) + .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) + .withLoadBasedConfig(new LoadBasedConfig().withMinNodes(10) + .withMaxNodes(20) + .withPollInterval(60) + .withCooldownPeriod(300) + .withScalingRules(Arrays.asList(new ScalingRule().withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN) + .withThreshold(90f)), + new ScalingRule().withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(20f)))))) .withTrinoProfile(new TrinoProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateRangerCluster.json */ /** @@ -690,22 +911,32 @@ public final class ClustersCreateSamples { */ public static void hDInsightRangerClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("ranger") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("head").withVmSize("Standard_D3_v2").withCount(2)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("head").withVmSize("Standard_D3_v2").withCount(2))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) - .withRangerProfile(new RangerProfile().withRangerAdmin(new RangerAdminSpec() - .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) - .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") - .withName("testdb").withPasswordSecretRef("fakeTokenPlaceholder").withUsername("admin"))) + .withRangerProfile(new RangerProfile() + .withRangerAdmin(new RangerAdminSpec() + .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) + .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") + .withName("testdb") + .withPasswordSecretRef("fakeTokenPlaceholder") + .withUsername("admin"))) .withRangerAudit(new RangerAuditSpec() .withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) @@ -739,7 +970,7 @@ public final class ClustersCreateSamples { public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * DeleteCluster.json */ /** @@ -763,7 +994,7 @@ public final class ClustersDeleteSamples { public final class ClustersGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetCluster.json */ /** @@ -773,8 +1004,8 @@ public final class ClustersGetSamples { */ public static void hDInsightClusterGet(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusters() + .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -788,7 +1019,7 @@ public final class ClustersGetSamples { public final class ClustersGetInstanceViewSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetClusterInstanceView.json */ /** @@ -798,8 +1029,8 @@ public final class ClustersGetInstanceViewSamples { */ public static void hDInsightClusterGetInstanceView( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().getInstanceViewWithResponse("rg1", "clusterPool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusters() + .getInstanceViewWithResponse("rg1", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -813,7 +1044,7 @@ public final class ClustersGetInstanceViewSamples { public final class ClustersListByClusterPoolNameSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClustersByClusterPoolName.json */ /** @@ -837,7 +1068,7 @@ public final class ClustersListByClusterPoolNameSamples { public final class ClustersListInstanceViewsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterInstanceViews.json */ /** @@ -861,7 +1092,7 @@ public final class ClustersListInstanceViewsSamples { public final class ClustersListServiceConfigsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterServiceConfigs.json */ /** @@ -888,7 +1119,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeProper public final class ClustersResizeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ResizeCluster.json */ /** @@ -898,10 +1129,11 @@ public final class ClustersResizeSamples { */ public static void hDInsightClusterResize(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().resize( - "hiloResourcegroup", "clusterpool1", "cluster1", new ClusterResizeData().withLocation("West US 2") - .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(5)), - com.azure.core.util.Context.NONE); + manager.clusters() + .resize("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterResizeData().withLocation("West US 2") + .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(5)), + com.azure.core.util.Context.NONE); } } ``` @@ -940,7 +1172,7 @@ import java.util.Map; public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchRangerCluster.json */ /** @@ -953,25 +1185,28 @@ public final class ClustersUpdateSamples { Cluster resource = manager.clusters() .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withProperties(new ClusterPatchProperties() - .withClusterProfile(new UpdatableClusterProfile().withRangerProfile(new RangerProfile() - .withRangerAdmin( - new RangerAdminSpec().withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) + resource.update() + .withProperties(new ClusterPatchProperties() + .withClusterProfile(new UpdatableClusterProfile().withRangerProfile(new RangerProfile() + .withRangerAdmin(new RangerAdminSpec() + .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") - .withName("testdb").withPasswordSecretRef("fakeTokenPlaceholder").withUsername("admin"))) - .withRangerAudit( - new RangerAuditSpec().withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) - .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) - .withGroups( - Arrays.asList("0a53828f-36c9-44c3-be3d-99a7fce977ad", "13be6971-79db-4f33-9d41-b25589ca25ac")) - .withMode(RangerUsersyncMode.AUTOMATIC) - .withUsers(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")))))) + .withName("testdb") + .withPasswordSecretRef("fakeTokenPlaceholder") + .withUsername("admin"))) + .withRangerAudit( + new RangerAuditSpec().withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) + .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) + .withGroups(Arrays.asList("0a53828f-36c9-44c3-be3d-99a7fce977ad", + "13be6971-79db-4f33-9d41-b25589ca25ac")) + .withMode(RangerUsersyncMode.AUTOMATIC) + .withUsers(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")))))) .apply(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchCluster.json */ /** @@ -997,48 +1232,55 @@ public final class ClustersUpdateSamples { Arrays .asList( new ClusterServiceConfig().withComponent("TestComp1") - .withFiles(Arrays.asList( - new ClusterConfigFile().withFileName("TestFile1") - .withValues(mapOf("Test.config.1", "1", - "Test.config.2", "2")), - new ClusterConfigFile().withFileName("TestFile2") - .withValues(mapOf("Test.config.3", "3", - "Test.config.4", "4")))), + .withFiles( + Arrays.asList( + new ClusterConfigFile().withFileName("TestFile1") + .withValues(mapOf("Test.config.1", "1", + "Test.config.2", "2")), + new ClusterConfigFile().withFileName("TestFile2") + .withValues(mapOf("Test.config.3", "3", + "Test.config.4", "4")))), new ClusterServiceConfig().withComponent("TestComp2") - .withFiles(Arrays.asList( - new ClusterConfigFile() - .withFileName("TestFile3") - .withContent("TestContent").withPath("TestPath"), - new ClusterConfigFile() - .withFileName("TestFile4") - .withValues(mapOf("Test.config.7", "7", - "Test.config.8", "8")))))), + .withFiles(Arrays + .asList( + new ClusterConfigFile().withFileName("TestFile3") + .withContent("TestContent") + .withPath("TestPath"), + new ClusterConfigFile() + .withFileName("TestFile4") + .withValues(mapOf("Test.config.7", "7", + "Test.config.8", "8")))))), new ClusterServiceConfigsProfile().withServiceName("TestService2") - .withConfigs(Arrays - .asList(new ClusterServiceConfig().withComponent("TestComp3").withFiles( - Arrays.asList(new ClusterConfigFile().withFileName("TestFile5") - .withValues(mapOf("Test.config.9", "9")))))))) - .withSshProfile( - new SshProfile().withCount(2)) + .withConfigs( + Arrays + .asList(new ClusterServiceConfig().withComponent("TestComp3") + .withFiles(Arrays + .asList(new ClusterConfigFile().withFileName("TestFile5") + .withValues(mapOf("Test.config.9", "9")))))))) + .withSshProfile(new SshProfile().withCount(2)) .withAutoscaleProfile( - new AutoscaleProfile().withEnabled(true).withGracefulDecommissionTimeout(-1) - .withAutoscaleType(AutoscaleType.SCHEDULE_BASED).withScheduleBasedConfig( - new ScheduleBasedConfig().withTimeZone("Cen. Australia Standard Time") - .withDefaultCount( - 3) - .withSchedules(Arrays.asList( - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(3) - .withDays(Arrays - .asList(ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(3) - .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) + new AutoscaleProfile().withEnabled(true) + .withGracefulDecommissionTimeout(-1) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig(new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(3) + .withSchedules(Arrays.asList( + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays + .asList(ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("Testuser1", "Testuser2"))) - .withLogAnalyticsProfile( - new ClusterLogAnalyticsProfile().withEnabled(true) - .withApplicationLogs(new ClusterLogAnalyticsApplicationLogs() - .withStdOutEnabled(true).withStdErrorEnabled(true)) - .withMetricsEnabled(true)))) + .withLogAnalyticsProfile(new ClusterLogAnalyticsProfile().withEnabled(true) + .withApplicationLogs(new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(true) + .withStdErrorEnabled(true)) + .withMetricsEnabled(true)))) .apply(); } @@ -1069,7 +1311,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; public final class ClustersUpgradeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeAKSPatchVersionForCluster.json */ /** @@ -1079,14 +1321,15 @@ public final class ClustersUpgradeSamples { */ public static void clustersUpgradeAKSPatchVersion( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().upgrade("hiloResourcegroup", "clusterpool1", "cluster1", - new ClusterUpgrade().withProperties(new ClusterAksPatchVersionUpgradeProperties()), - com.azure.core.util.Context.NONE); + manager.clusters() + .upgrade("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgrade().withProperties(new ClusterAksPatchVersionUpgradeProperties()), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeHotfixForCluster.json */ /** @@ -1096,10 +1339,44 @@ public final class ClustersUpgradeSamples { */ public static void clustersUpgradeHotfix(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().upgrade("hiloResourcegroup", "clusterpool1", "cluster1", - new ClusterUpgrade().withProperties(new ClusterHotfixUpgradeProperties().withTargetOssVersion("1.16.0") - .withTargetClusterVersion("1.0.6").withTargetBuildNumber("3").withComponentName("historyserver")), - com.azure.core.util.Context.NONE); + manager.clusters() + .upgrade("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgrade().withProperties(new ClusterHotfixUpgradeProperties().withTargetOssVersion("1.16.0") + .withTargetClusterVersion("1.0.6") + .withTargetBuildNumber("3") + .withComponentName("historyserver")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_UpgradeManualRollback + +```java +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollbackProperties; + +/** + * Samples for Clusters UpgradeManualRollback. + */ +public final class ClustersUpgradeManualRollbackSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ClusterUpgradeRollback.json + */ + /** + * Sample code: ClusterUpgradeRollback. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void + clusterUpgradeRollback(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusters() + .upgradeManualRollback("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgradeRollback().withProperties(new ClusterUpgradeRollbackProperties().withUpgradeHistory( + "/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/clusters/cluster1/upgradeHistories/01_11_2024_02_35_03_AM-HotfixUpgrade")), + com.azure.core.util.Context.NONE); } } ``` @@ -1115,7 +1392,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.NameAvailabilityPar public final class LocationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * LocationsNameAvailability.json */ /** @@ -1126,8 +1403,9 @@ public final class LocationsCheckNameAvailabilitySamples { public static void locationsNameAvailability(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { manager.locations() - .checkNameAvailabilityWithResponse("southeastasia", new NameAvailabilityParameters() - .withName("contosemember1").withType("Microsoft.HDInsight/clusterPools/clusters"), + .checkNameAvailabilityWithResponse("southeastasia", + new NameAvailabilityParameters().withName("contosemember1") + .withType("Microsoft.HDInsight/clusterPools/clusters"), com.azure.core.util.Context.NONE); } } @@ -1142,7 +1420,7 @@ public final class LocationsCheckNameAvailabilitySamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetOperations.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml index 296289d4fe742..5a8ee80b2e339 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for HDInsightContainers Management - This package contains Microsoft Azure SDK for HDInsightContainers Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Containers Management Client. Package tag package-preview-2023-11. + This package contains Microsoft Azure SDK for HDInsightContainers Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Containers Management Client. Package tag package-preview-2024-05. https://github.com/Azure/azure-sdk-for-java @@ -48,6 +48,11 @@ true + + com.azure + azure-json + 1.2.0 + com.azure azure-core @@ -82,6 +87,12 @@ 5.9.3 test + + org.slf4j + slf4j-simple + 1.7.36 + test + org.mockito mockito-core @@ -100,11 +111,5 @@ 1.14.12 test - - org.slf4j - slf4j-simple - 1.7.36 - test - diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/HDInsightContainersManager.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/HDInsightContainersManager.java index ed613de528708..838aa644c5cdd 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/HDInsightContainersManager.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/HDInsightContainersManager.java @@ -11,8 +11,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -28,9 +28,12 @@ import com.azure.resourcemanager.hdinsight.containers.implementation.AvailableClusterVersionsImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterAvailableUpgradesImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterJobsImpl; +import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterLibrariesImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolAvailableUpgradesImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolsImpl; +import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolUpgradeHistoriesImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.ClustersImpl; +import com.azure.resourcemanager.hdinsight.containers.implementation.ClusterUpgradeHistoriesImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.HDInsightContainersManagementClientBuilder; import com.azure.resourcemanager.hdinsight.containers.implementation.LocationsImpl; import com.azure.resourcemanager.hdinsight.containers.implementation.OperationsImpl; @@ -38,9 +41,12 @@ import com.azure.resourcemanager.hdinsight.containers.models.AvailableClusterVersions; import com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgrades; import com.azure.resourcemanager.hdinsight.containers.models.ClusterJobs; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraries; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgrades; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPools; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistories; import com.azure.resourcemanager.hdinsight.containers.models.Clusters; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistories; import com.azure.resourcemanager.hdinsight.containers.models.Locations; import com.azure.resourcemanager.hdinsight.containers.models.Operations; import java.time.Duration; @@ -59,10 +65,14 @@ public final class HDInsightContainersManager { private ClusterPoolAvailableUpgrades clusterPoolAvailableUpgrades; + private ClusterPoolUpgradeHistories clusterPoolUpgradeHistories; + private Clusters clusters; private ClusterAvailableUpgrades clusterAvailableUpgrades; + private ClusterUpgradeHistories clusterUpgradeHistories; + private ClusterJobs clusterJobs; private Locations locations; @@ -73,14 +83,18 @@ public final class HDInsightContainersManager { private AvailableClusterVersions availableClusterVersions; + private ClusterLibraries clusterLibraries; + private final HDInsightContainersManagementClient clientObject; private HDInsightContainersManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new HDInsightContainersManagementClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval).buildClient(); + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** @@ -231,12 +245,19 @@ public HDInsightContainersManager authenticate(TokenCredential credential, Azure Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.hdinsight.containers") - .append("/").append("1.0.0-beta.2"); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.hdinsight.containers") + .append("/") + .append("1.0.0-beta.3"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -255,18 +276,21 @@ public HDInsightContainersManager authenticate(TokenCredential credential, Azure policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new HDInsightContainersManager(httpPipeline, profile, defaultPollInterval); } } @@ -296,6 +320,19 @@ public ClusterPoolAvailableUpgrades clusterPoolAvailableUpgrades() { return clusterPoolAvailableUpgrades; } + /** + * Gets the resource collection API of ClusterPoolUpgradeHistories. + * + * @return Resource collection API of ClusterPoolUpgradeHistories. + */ + public ClusterPoolUpgradeHistories clusterPoolUpgradeHistories() { + if (this.clusterPoolUpgradeHistories == null) { + this.clusterPoolUpgradeHistories + = new ClusterPoolUpgradeHistoriesImpl(clientObject.getClusterPoolUpgradeHistories(), this); + } + return clusterPoolUpgradeHistories; + } + /** * Gets the resource collection API of Clusters. It manages Cluster. * @@ -321,6 +358,19 @@ public ClusterAvailableUpgrades clusterAvailableUpgrades() { return clusterAvailableUpgrades; } + /** + * Gets the resource collection API of ClusterUpgradeHistories. + * + * @return Resource collection API of ClusterUpgradeHistories. + */ + public ClusterUpgradeHistories clusterUpgradeHistories() { + if (this.clusterUpgradeHistories == null) { + this.clusterUpgradeHistories + = new ClusterUpgradeHistoriesImpl(clientObject.getClusterUpgradeHistories(), this); + } + return clusterUpgradeHistories; + } + /** * Gets the resource collection API of ClusterJobs. * @@ -383,6 +433,18 @@ public AvailableClusterVersions availableClusterVersions() { return availableClusterVersions; } + /** + * Gets the resource collection API of ClusterLibraries. + * + * @return Resource collection API of ClusterLibraries. + */ + public ClusterLibraries clusterLibraries() { + if (this.clusterLibraries == null) { + this.clusterLibraries = new ClusterLibrariesImpl(clientObject.getClusterLibraries(), this); + } + return clusterLibraries; + } + /** * Gets wrapped service client HDInsightContainersManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterLibrariesClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterLibrariesClient.java new file mode 100644 index 0000000000000..2f8bb95b769d2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterLibrariesClient.java @@ -0,0 +1,119 @@ +// 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.containers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.Category; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; + +/** + * An instance of this class provides access to all the operations defined in ClusterLibrariesClient. + */ +public interface ClusterLibrariesClient { + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category); + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category, Context context); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginManageLibraries(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterLibraryManagementOperation operation); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginManageLibraries(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterLibraryManagementOperation operation, Context context); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterPoolUpgradeHistoriesClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterPoolUpgradeHistoriesClient.java new file mode 100644 index 0000000000000..daf1ada193c6d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterPoolUpgradeHistoriesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; + +/** + * An instance of this class provides access to all the operations defined in ClusterPoolUpgradeHistoriesClient. + */ +public interface ClusterPoolUpgradeHistoriesClient { + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName); + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, + Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterUpgradeHistoriesClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterUpgradeHistoriesClient.java new file mode 100644 index 0000000000000..2617808046195 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClusterUpgradeHistoriesClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; + +/** + * An instance of this class provides access to all the operations defined in ClusterUpgradeHistoriesClient. + */ +public interface ClusterUpgradeHistoriesClient { + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, + String clusterName); + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClustersClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClustersClient.java index 36f90598a2f8e..0cdcc92c6cdbb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClustersClient.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/ClustersClient.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPatch; import com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; /** * An instance of this class provides access to all the operations defined in ClustersClient. @@ -116,6 +117,73 @@ ClusterInner upgrade(String resourceGroupName, String clusterPoolName, String cl ClusterInner upgrade(String resourceGroupName, String clusterPoolName, String clusterName, ClusterUpgrade clusterUpgradeRequest, Context context); + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpgradeManualRollback(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest); + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpgradeManualRollback(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest, + Context context); + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest); + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context); + /** * Resize an existing Cluster. * diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/HDInsightContainersManagementClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/HDInsightContainersManagementClient.java index 091ad26b7807b..751a70d276d88 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/HDInsightContainersManagementClient.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/HDInsightContainersManagementClient.java @@ -60,6 +60,13 @@ public interface HDInsightContainersManagementClient { */ ClusterPoolAvailableUpgradesClient getClusterPoolAvailableUpgrades(); + /** + * Gets the ClusterPoolUpgradeHistoriesClient object to access its operations. + * + * @return the ClusterPoolUpgradeHistoriesClient object. + */ + ClusterPoolUpgradeHistoriesClient getClusterPoolUpgradeHistories(); + /** * Gets the ClustersClient object to access its operations. * @@ -74,6 +81,13 @@ public interface HDInsightContainersManagementClient { */ ClusterAvailableUpgradesClient getClusterAvailableUpgrades(); + /** + * Gets the ClusterUpgradeHistoriesClient object to access its operations. + * + * @return the ClusterUpgradeHistoriesClient object. + */ + ClusterUpgradeHistoriesClient getClusterUpgradeHistories(); + /** * Gets the ClusterJobsClient object to access its operations. * @@ -108,4 +122,11 @@ public interface HDInsightContainersManagementClient { * @return the AvailableClusterVersionsClient object. */ AvailableClusterVersionsClient getAvailableClusterVersions(); + + /** + * Gets the ClusterLibrariesClient object to access its operations. + * + * @return the ClusterLibrariesClient object. + */ + ClusterLibrariesClient getClusterLibraries(); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterAvailableUpgradeInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterAvailableUpgradeInner.java index 0a2d6aaa8b99c..1ffc775adb1e6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterAvailableUpgradeInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterAvailableUpgradeInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster available upgrade. @@ -18,15 +21,28 @@ public final class ClusterAvailableUpgradeInner extends ProxyResource { /* * Gets or sets the properties. Define cluster upgrade specific properties. */ - @JsonProperty(value = "properties") private ClusterAvailableUpgradeProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterAvailableUpgradeInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,50 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterAvailableUpgradeInner. + */ + public static ClusterAvailableUpgradeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeInner deserializedClusterAvailableUpgradeInner = new ClusterAvailableUpgradeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterAvailableUpgradeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterAvailableUpgradeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterAvailableUpgradeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterAvailableUpgradeInner.properties + = ClusterAvailableUpgradeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterAvailableUpgradeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInner.java index c1f891fa4c784..7292d9e2eb2d7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -19,15 +22,28 @@ public final class ClusterInner extends Resource { /* * Gets or sets the properties. Define cluster specific properties. */ - @JsonProperty(value = "properties") private ClusterResourceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -91,4 +137,56 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInner. + */ + public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInner deserializedClusterInner = new ClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedClusterInner.properties = ClusterResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInstanceViewResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInstanceViewResultInner.java index 35568c8830898..fd87f7ddcd508 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInstanceViewResultInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterInstanceViewResultInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewResultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster Instance View. */ @Fluent -public final class ClusterInstanceViewResultInner { +public final class ClusterInstanceViewResultInner implements JsonSerializable { /* * Name of the instance view. */ - @JsonProperty(value = "name", required = true) private String name; /* * Properties of the instance view. */ - @JsonProperty(value = "properties", required = true) private ClusterInstanceViewResultProperties properties; /** @@ -79,16 +81,60 @@ public ClusterInstanceViewResultInner withProperties(ClusterInstanceViewResultPr */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ClusterInstanceViewResultInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ClusterInstanceViewResultInner")); } if (properties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property properties in model ClusterInstanceViewResultInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ClusterInstanceViewResultInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInstanceViewResultInner. + */ + public static ClusterInstanceViewResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewResultInner deserializedClusterInstanceViewResultInner + = new ClusterInstanceViewResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClusterInstanceViewResultInner.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterInstanceViewResultInner.properties + = ClusterInstanceViewResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewResultInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterJobInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterJobInner.java index 3946842fd6ac6..241650c87ebb3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterJobInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterJobInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterJobProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster job. @@ -19,15 +22,28 @@ public final class ClusterJobInner extends ProxyResource { /* * Properties of cluster job. */ - @JsonProperty(value = "properties", required = true) private ClusterJobProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterJobInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -70,12 +116,57 @@ public SystemData systemData() { */ public void validate() { if (properties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ClusterJobInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ClusterJobInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterJobInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterJobInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterJobInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterJobInner. + */ + public static ClusterJobInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterJobInner deserializedClusterJobInner = new ClusterJobInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterJobInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterJobInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterJobInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterJobInner.properties = ClusterJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterJobInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterJobInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterLibraryInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterLibraryInner.java new file mode 100644 index 0000000000000..5e974cf7dc7af --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterLibraryInner.java @@ -0,0 +1,172 @@ +// 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.containers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import java.io.IOException; + +/** + * Libraries in the cluster. + */ +@Fluent +public final class ClusterLibraryInner extends ProxyResource { + /* + * Properties of a library in the cluster. + */ + private ClusterLibraryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ClusterLibraryInner class. + */ + public ClusterLibraryInner() { + } + + /** + * Get the properties property: Properties of a library in the cluster. + * + * @return the properties value. + */ + public ClusterLibraryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a library in the cluster. + * + * @param properties the properties value to set. + * @return the ClusterLibraryInner object itself. + */ + public ClusterLibraryInner withProperties(ClusterLibraryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ClusterLibraryInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterLibraryInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLibraryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLibraryInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterLibraryInner. + */ + public static ClusterLibraryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLibraryInner deserializedClusterLibraryInner = new ClusterLibraryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterLibraryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterLibraryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterLibraryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterLibraryInner.properties = ClusterLibraryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterLibraryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLibraryInner; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolAvailableUpgradeInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolAvailableUpgradeInner.java index 99115c8ebcfe8..799614adf89f3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolAvailableUpgradeInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolAvailableUpgradeInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster pool available upgrade. @@ -18,15 +21,28 @@ public final class ClusterPoolAvailableUpgradeInner extends ProxyResource { /* * Gets or sets the properties. Define cluster pool upgrade specific properties. */ - @JsonProperty(value = "properties") private ClusterPoolAvailableUpgradeProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterPoolAvailableUpgradeInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,51 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAvailableUpgradeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAvailableUpgradeInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolAvailableUpgradeInner. + */ + public static ClusterPoolAvailableUpgradeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAvailableUpgradeInner deserializedClusterPoolAvailableUpgradeInner + = new ClusterPoolAvailableUpgradeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeInner.properties + = ClusterPoolAvailableUpgradeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAvailableUpgradeInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolInner.java index 034f7b5187189..ee1080e153942 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -19,15 +22,28 @@ public final class ClusterPoolInner extends Resource { /* * Gets or sets the properties. Define cluster pool specific properties. */ - @JsonProperty(value = "properties") private ClusterPoolResourceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterPoolInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -91,4 +137,56 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolInner. + */ + public static ClusterPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolInner deserializedClusterPoolInner = new ClusterPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterPoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterPoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterPoolInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedClusterPoolInner.properties = ClusterPoolResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolUpgradeHistoryInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolUpgradeHistoryInner.java new file mode 100644 index 0000000000000..72761269ac310 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolUpgradeHistoryInner.java @@ -0,0 +1,175 @@ +// 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.containers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryProperties; +import java.io.IOException; + +/** + * Cluster pool upgrade history. + */ +@Fluent +public final class ClusterPoolUpgradeHistoryInner extends ProxyResource { + /* + * Properties of cluster pool upgrade history. + */ + private ClusterPoolUpgradeHistoryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ClusterPoolUpgradeHistoryInner class. + */ + public ClusterPoolUpgradeHistoryInner() { + } + + /** + * Get the properties property: Properties of cluster pool upgrade history. + * + * @return the properties value. + */ + public ClusterPoolUpgradeHistoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of cluster pool upgrade history. + * + * @param properties the properties value to set. + * @return the ClusterPoolUpgradeHistoryInner object itself. + */ + public ClusterPoolUpgradeHistoryInner withProperties(ClusterPoolUpgradeHistoryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ClusterPoolUpgradeHistoryInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolUpgradeHistoryInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolUpgradeHistoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolUpgradeHistoryInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolUpgradeHistoryInner. + */ + public static ClusterPoolUpgradeHistoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolUpgradeHistoryInner deserializedClusterPoolUpgradeHistoryInner + = new ClusterPoolUpgradeHistoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryInner.properties + = ClusterPoolUpgradeHistoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolUpgradeHistoryInner; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolVersionInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolVersionInner.java index 1127d403b139c..f907a9bf97278 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolVersionInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterPoolVersionInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Available cluster pool version. @@ -18,15 +21,28 @@ public final class ClusterPoolVersionInner extends ProxyResource { /* * Cluster pool version properties. */ - @JsonProperty(value = "properties") private ClusterPoolVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterPoolVersionInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolVersionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolVersionInner. + */ + public static ClusterPoolVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolVersionInner deserializedClusterPoolVersionInner = new ClusterPoolVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterPoolVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterPoolVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterPoolVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterPoolVersionInner.properties = ClusterPoolVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterPoolVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolVersionInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterUpgradeHistoryInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterUpgradeHistoryInner.java new file mode 100644 index 0000000000000..41ebd3a022747 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterUpgradeHistoryInner.java @@ -0,0 +1,174 @@ +// 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.containers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryProperties; +import java.io.IOException; + +/** + * Cluster upgrade history. + */ +@Fluent +public final class ClusterUpgradeHistoryInner extends ProxyResource { + /* + * Properties of cluster upgrade history. + */ + private ClusterUpgradeHistoryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ClusterUpgradeHistoryInner class. + */ + public ClusterUpgradeHistoryInner() { + } + + /** + * Get the properties property: Properties of cluster upgrade history. + * + * @return the properties value. + */ + public ClusterUpgradeHistoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of cluster upgrade history. + * + * @param properties the properties value to set. + * @return the ClusterUpgradeHistoryInner object itself. + */ + public ClusterUpgradeHistoryInner withProperties(ClusterUpgradeHistoryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ClusterUpgradeHistoryInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeHistoryInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeHistoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeHistoryInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgradeHistoryInner. + */ + public static ClusterUpgradeHistoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeHistoryInner deserializedClusterUpgradeHistoryInner = new ClusterUpgradeHistoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterUpgradeHistoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterUpgradeHistoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterUpgradeHistoryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterUpgradeHistoryInner.properties + = ClusterUpgradeHistoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterUpgradeHistoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeHistoryInner; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterVersionInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterVersionInner.java index 0926b256b977a..4b015d370c511 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterVersionInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ClusterVersionInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ClusterVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Available cluster version. @@ -18,15 +21,28 @@ public final class ClusterVersionInner extends ProxyResource { /* * Cluster version properties. */ - @JsonProperty(value = "properties") private ClusterVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterVersionInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterVersionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterVersionInner. + */ + public static ClusterVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterVersionInner deserializedClusterVersionInner = new ClusterVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterVersionInner.properties = ClusterVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterVersionInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/NameAvailabilityResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/NameAvailabilityResultInner.java index 4c72dfe084109..3ea3123bf1887 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/NameAvailabilityResultInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/NameAvailabilityResultInner.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Result of check name availability. */ @Fluent -public final class NameAvailabilityResultInner { +public final class NameAvailabilityResultInner implements JsonSerializable { /* * Indicator of availability of the Microsoft.HDInsight resource name. */ - @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; /* * The reason of unavailability. */ - @JsonProperty(value = "reason") private String reason; /* * The error message of unavailability. */ - @JsonProperty(value = "message") private String message; /** @@ -103,4 +104,46 @@ public NameAvailabilityResultInner withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameAvailabilityResultInner 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 NameAvailabilityResultInner. + */ + public static NameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameAvailabilityResultInner deserializedNameAvailabilityResultInner = new NameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedNameAvailabilityResultInner.nameAvailable = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedNameAvailabilityResultInner.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameAvailabilityResultInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/OperationInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/OperationInner.java index 9ae10698caea8..d4b8c188dc5be 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/OperationInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/OperationInner.java @@ -5,10 +5,14 @@ package com.azure.resourcemanager.hdinsight.containers.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ActionType; import com.azure.resourcemanager.hdinsight.containers.models.OperationDisplay; import com.azure.resourcemanager.hdinsight.containers.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation @@ -16,38 +20,33 @@ * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for * ARM/control-plane operations. */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default * value is "user,system" */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; /** @@ -126,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ServiceConfigResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ServiceConfigResultInner.java index 3d539ccfe2704..e92e2e4a9d85e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ServiceConfigResultInner.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/fluent/models/ServiceConfigResultInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.hdinsight.containers.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigResultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster instance service config. */ @Fluent -public final class ServiceConfigResultInner { +public final class ServiceConfigResultInner implements JsonSerializable { /* * Cluster instance service config properties. */ - @JsonProperty(value = "properties") private ServiceConfigResultProperties properties; /** @@ -55,4 +58,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConfigResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConfigResultInner 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 ServiceConfigResultInner. + */ + public static ServiceConfigResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConfigResultInner deserializedServiceConfigResultInner = new ServiceConfigResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedServiceConfigResultInner.properties = ServiceConfigResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConfigResultInner; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterPoolVersionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterPoolVersionsClientImpl.java index f8b2ca1bd8055..235301d12ad2f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterPoolVersionsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterPoolVersionsClientImpl.java @@ -56,8 +56,8 @@ public final class AvailableClusterPoolVersionsClientImpl implements AvailableCl } /** - * The interface defining all the services for HDInsightContainersManagementClientAvailableClusterPoolVersions to - * be used by the proxy service to perform REST calls. + * The interface defining all the services for HDInsightContainersManagementClientAvailableClusterPoolVersions to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "HDInsightContainersM") @@ -208,9 +208,7 @@ public PagedIterable listByLocation(String location, Co /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -237,9 +235,7 @@ private Mono> listByLocationNextSinglePag /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterVersionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterVersionsClientImpl.java index 08f804bd43652..ddf9d02791e83 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterVersionsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/AvailableClusterVersionsClientImpl.java @@ -207,9 +207,7 @@ public PagedIterable listByLocation(String location, Contex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -236,9 +234,7 @@ private Mono> listByLocationNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterAvailableUpgradesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterAvailableUpgradesClientImpl.java index 4c700857f0f29..3bd8ed35be902 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterAvailableUpgradesClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterAvailableUpgradesClientImpl.java @@ -243,9 +243,7 @@ public PagedIterable list(String resourceGroupName /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -271,9 +269,7 @@ private Mono> listNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterImpl.java index 0f5e4a13e125c..2b5c228c56103 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterResourceProperties; import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; import java.util.Collections; import java.util.Map; @@ -90,14 +91,16 @@ public ClusterImpl withExistingClusterpool(String resourceGroupName, String clus } public Cluster create() { - this.innerObject = serviceManager.serviceClient().getClusters().create(resourceGroupName, clusterPoolName, - clusterName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .create(resourceGroupName, clusterPoolName, clusterName, this.innerModel(), Context.NONE); return this; } public Cluster create(Context context) { - this.innerObject = serviceManager.serviceClient().getClusters().create(resourceGroupName, clusterPoolName, - clusterName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .create(resourceGroupName, clusterPoolName, clusterName, this.innerModel(), context); return this; } @@ -113,14 +116,16 @@ public ClusterImpl update() { } public Cluster apply() { - this.innerObject = serviceManager.serviceClient().getClusters().update(resourceGroupName, clusterPoolName, - clusterName, updateClusterPatchRequest, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .update(resourceGroupName, clusterPoolName, clusterName, updateClusterPatchRequest, Context.NONE); return this; } public Cluster apply(Context context) { - this.innerObject = serviceManager.serviceClient().getClusters().update(resourceGroupName, clusterPoolName, - clusterName, updateClusterPatchRequest, context); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .update(resourceGroupName, clusterPoolName, clusterName, updateClusterPatchRequest, context); return this; } @@ -134,25 +139,40 @@ public Cluster apply(Context context) { } public Cluster refresh() { - this.innerObject = serviceManager.serviceClient().getClusters() - .getWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE) + .getValue(); return this; } public Cluster refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getClusters() - .getWithResponse(resourceGroupName, clusterPoolName, clusterName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, clusterPoolName, clusterName, context) + .getValue(); return this; } public Cluster upgrade(ClusterUpgrade clusterUpgradeRequest) { - return serviceManager.clusters().upgrade(resourceGroupName, clusterPoolName, clusterName, - clusterUpgradeRequest); + return serviceManager.clusters() + .upgrade(resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest); } public Cluster upgrade(ClusterUpgrade clusterUpgradeRequest, Context context) { - return serviceManager.clusters().upgrade(resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, - context); + return serviceManager.clusters() + .upgrade(resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, context); + } + + public Cluster upgradeManualRollback(ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + return serviceManager.clusters() + .upgradeManualRollback(resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest); + } + + public Cluster upgradeManualRollback(ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context) { + return serviceManager.clusters() + .upgradeManualRollback(resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest, + context); } public Cluster resize(ClusterResizeData clusterResizeRequest) { @@ -160,8 +180,8 @@ public Cluster resize(ClusterResizeData clusterResizeRequest) { } public Cluster resize(ClusterResizeData clusterResizeRequest, Context context) { - return serviceManager.clusters().resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, - context); + return serviceManager.clusters() + .resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context); } public ClusterImpl withRegion(Region location) { diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterJobsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterJobsClientImpl.java index fb98f0c273380..be524105d1e8d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterJobsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterJobsClientImpl.java @@ -540,9 +540,7 @@ public PagedIterable list(String resourceGroupName, String clus /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -567,9 +565,7 @@ private Mono> listNextSinglePageAsync(String next /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesClientImpl.java new file mode 100644 index 0000000000000..d5a3dd18a938e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesClientImpl.java @@ -0,0 +1,584 @@ +// 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.containers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterLibrariesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.Category; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryList; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ClusterLibrariesClient. + */ +public final class ClusterLibrariesClientImpl implements ClusterLibrariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClusterLibrariesService service; + + /** + * The service client containing this operation class. + */ + private final HDInsightContainersManagementClientImpl client; + + /** + * Initializes an instance of ClusterLibrariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterLibrariesClientImpl(HDInsightContainersManagementClientImpl client) { + this.service + = RestProxy.create(ClusterLibrariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightContainersManagementClientClusterLibraries to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightContainersM") + public interface ClusterLibrariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/libraries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, @PathParam("clusterName") String clusterName, + @QueryParam("$category") Category category, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/manageLibraries") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> manageLibraries(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterLibraryManagementOperation operation, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName, String clusterName, Category category) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (category == null) { + return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterPoolName, clusterName, category, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName, String clusterName, Category category, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (category == null) { + return Mono.error(new IllegalArgumentException("Parameter category 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, + this.client.getApiVersion(), clusterPoolName, clusterName, category, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, + String clusterName, Category category) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, category), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, + String clusterName, Category category, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, category, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName, category)); + } + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName, category, context)); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> manageLibrariesWithResponseAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterLibraryManagementOperation operation) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (operation == null) { + return Mono.error(new IllegalArgumentException("Parameter operation is required and cannot be null.")); + } else { + operation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.manageLibraries(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterPoolName, clusterName, operation, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> manageLibrariesWithResponseAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterLibraryManagementOperation operation, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (operation == null) { + return Mono.error(new IllegalArgumentException("Parameter operation is required and cannot be null.")); + } else { + operation.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.manageLibraries(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), clusterPoolName, clusterName, operation, accept, context); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginManageLibrariesAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterLibraryManagementOperation operation) { + Mono>> mono + = manageLibrariesWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, operation); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginManageLibrariesAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterLibraryManagementOperation operation, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = manageLibrariesWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, operation, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginManageLibraries(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterLibraryManagementOperation operation) { + return this.beginManageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation) + .getSyncPoller(); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginManageLibraries(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterLibraryManagementOperation operation, Context context) { + return this.beginManageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation, context) + .getSyncPoller(); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manageLibrariesAsync(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation) { + return beginManageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management 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 manageLibrariesAsync(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation, Context context) { + return beginManageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation) { + manageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation).block(); + } + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation, Context context) { + manageLibrariesAsync(resourceGroupName, clusterPoolName, clusterName, operation, context).block(); + } + + /** + * 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 collection of libraries in the cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of libraries in the cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesImpl.java new file mode 100644 index 0000000000000..222a4af2ff692 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibrariesImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterLibrariesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.Category; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraries; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibrary; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; + +public final class ClusterLibrariesImpl implements ClusterLibraries { + private static final ClientLogger LOGGER = new ClientLogger(ClusterLibrariesImpl.class); + + private final ClusterLibrariesClient innerClient; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + public ClusterLibrariesImpl(ClusterLibrariesClient innerClient, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName, category); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterLibraryImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName, category, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterLibraryImpl(inner1, this.manager())); + } + + public void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation) { + this.serviceClient().manageLibraries(resourceGroupName, clusterPoolName, clusterName, operation); + } + + public void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation, Context context) { + this.serviceClient().manageLibraries(resourceGroupName, clusterPoolName, clusterName, operation, context); + } + + private ClusterLibrariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibraryImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibraryImpl.java new file mode 100644 index 0000000000000..3dd0e1b92b49f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterLibraryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibrary; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; + +public final class ClusterLibraryImpl implements ClusterLibrary { + private ClusterLibraryInner innerObject; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + ClusterLibraryImpl(ClusterLibraryInner innerObject, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ClusterLibraryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ClusterLibraryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolAvailableUpgradesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolAvailableUpgradesClientImpl.java index 19df8bc9e9ce7..913f9216790fa 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolAvailableUpgradesClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolAvailableUpgradesClientImpl.java @@ -56,8 +56,8 @@ public final class ClusterPoolAvailableUpgradesClientImpl implements ClusterPool } /** - * The interface defining all the services for HDInsightContainersManagementClientClusterPoolAvailableUpgrades to - * be used by the proxy service to perform REST calls. + * The interface defining all the services for HDInsightContainersManagementClientClusterPoolAvailableUpgrades to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "HDInsightContainersM") @@ -229,9 +229,7 @@ public PagedIterable list(String resourceGroup /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -257,9 +255,7 @@ private Mono> listNextSinglePage /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolImpl.java index 4037b312c388e..cd69adf8c319a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolImpl.java @@ -85,14 +85,16 @@ public ClusterPoolImpl withExistingResourceGroup(String resourceGroupName) { } public ClusterPool create() { - this.innerObject = serviceManager.serviceClient().getClusterPools().createOrUpdate(resourceGroupName, - clusterPoolName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .createOrUpdate(resourceGroupName, clusterPoolName, this.innerModel(), Context.NONE); return this; } public ClusterPool create(Context context) { - this.innerObject = serviceManager.serviceClient().getClusterPools().createOrUpdate(resourceGroupName, - clusterPoolName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .createOrUpdate(resourceGroupName, clusterPoolName, this.innerModel(), context); return this; } @@ -109,14 +111,16 @@ public ClusterPoolImpl update() { } public ClusterPool apply() { - this.innerObject = serviceManager.serviceClient().getClusterPools().updateTags(resourceGroupName, - clusterPoolName, updateClusterPoolTags, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .updateTags(resourceGroupName, clusterPoolName, updateClusterPoolTags, Context.NONE); return this; } public ClusterPool apply(Context context) { - this.innerObject = serviceManager.serviceClient().getClusterPools().updateTags(resourceGroupName, - clusterPoolName, updateClusterPoolTags, context); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .updateTags(resourceGroupName, clusterPoolName, updateClusterPoolTags, context); return this; } @@ -129,14 +133,18 @@ public ClusterPool apply(Context context) { } public ClusterPool refresh() { - this.innerObject = serviceManager.serviceClient().getClusterPools() - .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, Context.NONE) + .getValue(); return this; } public ClusterPool refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getClusterPools() - .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getClusterPools() + .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, context) + .getValue(); return this; } @@ -145,8 +153,8 @@ public ClusterPool upgrade(ClusterPoolUpgrade clusterPoolUpgradeRequest) { } public ClusterPool upgrade(ClusterPoolUpgrade clusterPoolUpgradeRequest, Context context) { - return serviceManager.clusterPools().upgrade(resourceGroupName, clusterPoolName, clusterPoolUpgradeRequest, - context); + return serviceManager.clusterPools() + .upgrade(resourceGroupName, clusterPoolName, clusterPoolUpgradeRequest, context); } public ClusterPoolImpl withRegion(Region location) { diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesClientImpl.java new file mode 100644 index 0000000000000..d09bc5b3c91d2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesClientImpl.java @@ -0,0 +1,282 @@ +// 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.containers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolUpgradeHistoriesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ClusterPoolUpgradeHistoriesClient. + */ +public final class ClusterPoolUpgradeHistoriesClientImpl implements ClusterPoolUpgradeHistoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClusterPoolUpgradeHistoriesService service; + + /** + * The service client containing this operation class. + */ + private final HDInsightContainersManagementClientImpl client; + + /** + * Initializes an instance of ClusterPoolUpgradeHistoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterPoolUpgradeHistoriesClientImpl(HDInsightContainersManagementClientImpl client) { + this.service = RestProxy.create(ClusterPoolUpgradeHistoriesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightContainersManagementClientClusterPoolUpgradeHistories to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightContainersM") + public interface ClusterPoolUpgradeHistoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgradeHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, @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); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterPoolName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName 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, + this.client.getApiVersion(), clusterPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesImpl.java new file mode 100644 index 0000000000000..340da3bbdfe33 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoriesImpl.java @@ -0,0 +1,48 @@ +// 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.containers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolUpgradeHistoriesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistories; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistory; + +public final class ClusterPoolUpgradeHistoriesImpl implements ClusterPoolUpgradeHistories { + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolUpgradeHistoriesImpl.class); + + private final ClusterPoolUpgradeHistoriesClient innerClient; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + public ClusterPoolUpgradeHistoriesImpl(ClusterPoolUpgradeHistoriesClient innerClient, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterPoolUpgradeHistoryImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterPoolUpgradeHistoryImpl(inner1, this.manager())); + } + + private ClusterPoolUpgradeHistoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoryImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoryImpl.java new file mode 100644 index 0000000000000..f180c9f09d60f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolUpgradeHistoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistory; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryProperties; + +public final class ClusterPoolUpgradeHistoryImpl implements ClusterPoolUpgradeHistory { + private ClusterPoolUpgradeHistoryInner innerObject; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + ClusterPoolUpgradeHistoryImpl(ClusterPoolUpgradeHistoryInner innerObject, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ClusterPoolUpgradeHistoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ClusterPoolUpgradeHistoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsClientImpl.java index a3a52bce6ef61..0c7a34d67ce05 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsClientImpl.java @@ -1428,9 +1428,7 @@ public ClusterPoolInner upgrade(String resourceGroupName, String clusterPoolName /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1458,9 +1456,7 @@ private Mono> listBySubscriptionNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1488,9 +1484,7 @@ private Mono> listBySubscriptionNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1518,9 +1512,7 @@ private Mono> listByResourceGroupNextSinglePageA /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsImpl.java index e093e25fc4792..6612ffcf9e1d9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterPoolsImpl.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolsClient; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolInner; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; -import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgrade; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPools; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgrade; public final class ClusterPoolsImpl implements ClusterPools { private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolsImpl.class); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesClientImpl.java new file mode 100644 index 0000000000000..3dc355d227dfe --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesClientImpl.java @@ -0,0 +1,295 @@ +// 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.containers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterUpgradeHistoriesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ClusterUpgradeHistoriesClient. + */ +public final class ClusterUpgradeHistoriesClientImpl implements ClusterUpgradeHistoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClusterUpgradeHistoriesService service; + + /** + * The service client containing this operation class. + */ + private final HDInsightContainersManagementClientImpl client; + + /** + * Initializes an instance of ClusterUpgradeHistoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterUpgradeHistoriesClientImpl(HDInsightContainersManagementClientImpl client) { + this.service = RestProxy.create(ClusterUpgradeHistoriesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightContainersManagementClientClusterUpgradeHistories to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightContainersM") + public interface ClusterUpgradeHistoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgradeHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, @PathParam("clusterName") String clusterName, + @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); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName 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"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterPoolName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 represents a list of cluster upgrade history along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterPoolName, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName 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, + this.client.getApiVersion(), clusterPoolName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, + String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 represents a list of cluster upgrade history as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, + String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, + String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName)); + } + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, + String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesImpl.java new file mode 100644 index 0000000000000..d1b35fa8c61fb --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoriesImpl.java @@ -0,0 +1,49 @@ +// 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.containers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterUpgradeHistoriesClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistories; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistory; + +public final class ClusterUpgradeHistoriesImpl implements ClusterUpgradeHistories { + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeHistoriesImpl.class); + + private final ClusterUpgradeHistoriesClient innerClient; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + public ClusterUpgradeHistoriesImpl(ClusterUpgradeHistoriesClient innerClient, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, + String clusterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterUpgradeHistoryImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, + String clusterName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterUpgradeHistoryImpl(inner1, this.manager())); + } + + private ClusterUpgradeHistoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoryImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoryImpl.java new file mode 100644 index 0000000000000..a6ad23a6aaa71 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClusterUpgradeHistoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistory; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryProperties; + +public final class ClusterUpgradeHistoryImpl implements ClusterUpgradeHistory { + private ClusterUpgradeHistoryInner innerObject; + + private final com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager; + + ClusterUpgradeHistoryImpl(ClusterUpgradeHistoryInner innerObject, + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ClusterUpgradeHistoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ClusterUpgradeHistoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersClientImpl.java index d7c4015425f0c..2f79d33a7c6f2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersClientImpl.java @@ -42,6 +42,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPatch; import com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; import com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -99,6 +100,17 @@ Mono>> upgrade(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterUpgrade clusterUpgradeRequest, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/rollback") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeManualRollback(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterUpgradeRollback clusterRollbackUpgradeRequest, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/resize") @ExpectedResponses({ 200, 202 }) @@ -607,6 +619,270 @@ public ClusterInner upgrade(String resourceGroupName, String clusterPoolName, St return upgradeAsync(resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, context).block(); } + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeManualRollbackWithResponseAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterRollbackUpgradeRequest == null) { + return Mono.error(new IllegalArgumentException( + "Parameter clusterRollbackUpgradeRequest is required and cannot be null.")); + } else { + clusterRollbackUpgradeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.upgradeManualRollback(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), clusterPoolName, clusterName, + clusterRollbackUpgradeRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a 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 cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeManualRollbackWithResponseAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterRollbackUpgradeRequest == null) { + return Mono.error(new IllegalArgumentException( + "Parameter clusterRollbackUpgradeRequest is required and cannot be null.")); + } else { + clusterRollbackUpgradeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.upgradeManualRollback(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), clusterPoolName, clusterName, clusterRollbackUpgradeRequest, accept, + context); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpgradeManualRollbackAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + Mono>> mono = upgradeManualRollbackWithResponseAsync(resourceGroupName, + clusterPoolName, clusterName, clusterRollbackUpgradeRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpgradeManualRollbackAsync(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = upgradeManualRollbackWithResponseAsync(resourceGroupName, + clusterPoolName, clusterName, clusterRollbackUpgradeRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterInner.class, ClusterInner.class, context); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpgradeManualRollback(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + return this + .beginUpgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest) + .getSyncPoller(); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a 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 SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpgradeManualRollback(String resourceGroupName, + String clusterPoolName, String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest, + Context context) { + return this + .beginUpgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest, context) + .getSyncPoller(); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeManualRollbackAsync(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + return beginUpgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a 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 cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeManualRollbackAsync(String resourceGroupName, String clusterPoolName, + String clusterName, ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context) { + return beginUpgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + return upgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest).block(); + } + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context) { + return upgradeManualRollbackAsync(resourceGroupName, clusterPoolName, clusterName, + clusterRollbackUpgradeRequest, context).block(); + } + /** * Resize an existing Cluster. * @@ -2181,9 +2457,7 @@ public ClusterInstanceViewResultInner getInstanceView(String resourceGroupName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2211,9 +2485,7 @@ private Mono> listByClusterPoolNameNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2241,9 +2513,7 @@ private Mono> listByClusterPoolNameNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2271,9 +2541,7 @@ private Mono> listServiceConfigsNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2301,9 +2569,7 @@ private Mono> listServiceConfigsNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2330,9 +2596,7 @@ private Mono> listInstanceViewsNex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersImpl.java index 4cd62c1d7e18f..bd28970854535 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ClustersImpl.java @@ -16,8 +16,9 @@ import com.azure.resourcemanager.hdinsight.containers.models.Cluster; import com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewResult; import com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeData; -import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; import com.azure.resourcemanager.hdinsight.containers.models.Clusters; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; import com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigResult; public final class ClustersImpl implements Clusters { @@ -59,8 +60,31 @@ public Cluster upgrade(String resourceGroupName, String clusterPoolName, String public Cluster upgrade(String resourceGroupName, String clusterPoolName, String clusterName, ClusterUpgrade clusterUpgradeRequest, Context context) { - ClusterInner inner = this.serviceClient().upgrade(resourceGroupName, clusterPoolName, clusterName, - clusterUpgradeRequest, context); + ClusterInner inner = this.serviceClient() + .upgrade(resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, context); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest) { + ClusterInner inner = this.serviceClient() + .upgradeManualRollback(resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context) { + ClusterInner inner = this.serviceClient() + .upgradeManualRollback(resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest, + context); if (inner != null) { return new ClusterImpl(inner, this.manager()); } else { @@ -81,8 +105,8 @@ public Cluster resize(String resourceGroupName, String clusterPoolName, String c public Cluster resize(String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest, Context context) { - ClusterInner inner = this.serviceClient().resize(resourceGroupName, clusterPoolName, clusterName, - clusterResizeRequest, context); + ClusterInner inner = this.serviceClient() + .resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context); if (inner != null) { return new ClusterImpl(inner, this.manager()); } else { diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientBuilder.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientBuilder.java index 36c934c0ea257..d65726c533dc7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientBuilder.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientBuilder.java @@ -123,11 +123,13 @@ public HDInsightContainersManagementClientBuilder serializerAdapter(SerializerAd public HDInsightContainersManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = (pipeline != null) ? pipeline + HttpPipeline localPipeline = (pipeline != null) + ? pipeline : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); Duration localDefaultPollInterval = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); HDInsightContainersManagementClientImpl client = new HDInsightContainersManagementClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientImpl.java index 46e2cce5ca846..541d950cff66b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/HDInsightContainersManagementClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hdinsight.containers.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ 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.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -26,9 +27,12 @@ import com.azure.resourcemanager.hdinsight.containers.fluent.AvailableClusterVersionsClient; import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterAvailableUpgradesClient; import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterJobsClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterLibrariesClient; import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolAvailableUpgradesClient; import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolsClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterPoolUpgradeHistoriesClient; import com.azure.resourcemanager.hdinsight.containers.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsight.containers.fluent.ClusterUpgradeHistoriesClient; import com.azure.resourcemanager.hdinsight.containers.fluent.HDInsightContainersManagementClient; import com.azure.resourcemanager.hdinsight.containers.fluent.LocationsClient; import com.azure.resourcemanager.hdinsight.containers.fluent.OperationsClient; @@ -158,6 +162,20 @@ public ClusterPoolAvailableUpgradesClient getClusterPoolAvailableUpgrades() { return this.clusterPoolAvailableUpgrades; } + /** + * The ClusterPoolUpgradeHistoriesClient object to access its operations. + */ + private final ClusterPoolUpgradeHistoriesClient clusterPoolUpgradeHistories; + + /** + * Gets the ClusterPoolUpgradeHistoriesClient object to access its operations. + * + * @return the ClusterPoolUpgradeHistoriesClient object. + */ + public ClusterPoolUpgradeHistoriesClient getClusterPoolUpgradeHistories() { + return this.clusterPoolUpgradeHistories; + } + /** * The ClustersClient object to access its operations. */ @@ -186,6 +204,20 @@ public ClusterAvailableUpgradesClient getClusterAvailableUpgrades() { return this.clusterAvailableUpgrades; } + /** + * The ClusterUpgradeHistoriesClient object to access its operations. + */ + private final ClusterUpgradeHistoriesClient clusterUpgradeHistories; + + /** + * Gets the ClusterUpgradeHistoriesClient object to access its operations. + * + * @return the ClusterUpgradeHistoriesClient object. + */ + public ClusterUpgradeHistoriesClient getClusterUpgradeHistories() { + return this.clusterUpgradeHistories; + } + /** * The ClusterJobsClient object to access its operations. */ @@ -256,6 +288,20 @@ public AvailableClusterVersionsClient getAvailableClusterVersions() { return this.availableClusterVersions; } + /** + * The ClusterLibrariesClient object to access its operations. + */ + private final ClusterLibrariesClient clusterLibraries; + + /** + * Gets the ClusterLibrariesClient object to access its operations. + * + * @return the ClusterLibrariesClient object. + */ + public ClusterLibrariesClient getClusterLibraries() { + return this.clusterLibraries; + } + /** * Initializes an instance of HDInsightContainersManagementClient client. * @@ -273,16 +319,19 @@ public AvailableClusterVersionsClient getAvailableClusterVersions() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-11-01-preview"; + this.apiVersion = "2024-05-01-preview"; this.clusterPools = new ClusterPoolsClientImpl(this); this.clusterPoolAvailableUpgrades = new ClusterPoolAvailableUpgradesClientImpl(this); + this.clusterPoolUpgradeHistories = new ClusterPoolUpgradeHistoriesClientImpl(this); this.clusters = new ClustersClientImpl(this); this.clusterAvailableUpgrades = new ClusterAvailableUpgradesClientImpl(this); + this.clusterUpgradeHistories = new ClusterUpgradeHistoriesClientImpl(this); this.clusterJobs = new ClusterJobsClientImpl(this); this.locations = new LocationsClientImpl(this); this.operations = new OperationsClientImpl(this); this.availableClusterPoolVersions = new AvailableClusterPoolVersionsClientImpl(this); this.availableClusterVersions = new AvailableClusterVersionsClientImpl(this); + this.clusterLibraries = new ClusterLibrariesClientImpl(this); } /** @@ -345,8 +394,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, - SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -387,7 +436,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/OperationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/OperationsClientImpl.java index 2bbdae9a5cde1..affea8fbc362d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/OperationsClientImpl.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/OperationsClientImpl.java @@ -56,8 +56,8 @@ public final class OperationsClientImpl implements OperationsClient { } /** - * The interface defining all the services for HDInsightContainersManagementClientOperations to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for HDInsightContainersManagementClientOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "HDInsightContainersM") @@ -183,9 +183,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -211,9 +209,7 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ResourceManagerUtils.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ResourceManagerUtils.java index d82914d0b7f41..3ff5f0b188ad3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ResourceManagerUtils.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Action.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Action.java index 550eef95bf6cd..895757f71fa6b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Action.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Action.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -83,7 +82,6 @@ public Action() { * @param name a name to look for. * @return the corresponding Action. */ - @JsonCreator public static Action fromString(String name) { return fromString(name, Action.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ActionType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ActionType.java index a580638e04500..d703f81723164 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ActionType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ActionType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ActionType() { * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfile.java index cf1c29acbab2f..82d7311650e3d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfile.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of the cluster pool underlying AKS cluster. */ @Fluent -public class AksClusterProfile { +public class AksClusterProfile implements JsonSerializable { /* * ARM Resource ID of the AKS cluster */ - @JsonProperty(value = "aksClusterResourceId") private String aksClusterResourceId; /* * Identity properties of the AKS cluster agentpool MSI */ - @JsonProperty(value = "aksClusterAgentPoolIdentityProfile") private AksClusterProfileAksClusterAgentPoolIdentityProfile aksClusterAgentPoolIdentityProfile; /* * AKS control plane and default node pool version of this ClusterPool */ - @JsonProperty(value = "aksVersion", access = JsonProperty.Access.WRITE_ONLY) private String aksVersion; /** @@ -86,6 +87,17 @@ public String aksVersion() { return this.aksVersion; } + /** + * Set the aksVersion property: AKS control plane and default node pool version of this ClusterPool. + * + * @param aksVersion the aksVersion value to set. + * @return the AksClusterProfile object itself. + */ + AksClusterProfile withAksVersion(String aksVersion) { + this.aksVersion = aksVersion; + return this; + } + /** * Validates the instance. * @@ -96,4 +108,46 @@ public void validate() { aksClusterAgentPoolIdentityProfile().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aksClusterResourceId", this.aksClusterResourceId); + jsonWriter.writeJsonField("aksClusterAgentPoolIdentityProfile", this.aksClusterAgentPoolIdentityProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksClusterProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksClusterProfile 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 AksClusterProfile. + */ + public static AksClusterProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksClusterProfile deserializedAksClusterProfile = new AksClusterProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aksClusterResourceId".equals(fieldName)) { + deserializedAksClusterProfile.aksClusterResourceId = reader.getString(); + } else if ("aksClusterAgentPoolIdentityProfile".equals(fieldName)) { + deserializedAksClusterProfile.aksClusterAgentPoolIdentityProfile + = AksClusterProfileAksClusterAgentPoolIdentityProfile.fromJson(reader); + } else if ("aksVersion".equals(fieldName)) { + deserializedAksClusterProfile.aksVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksClusterProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java index bb9742fc107cc..43006dc41153a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Identity properties of the AKS cluster agentpool MSI. @@ -53,4 +57,50 @@ public AksClusterProfileAksClusterAgentPoolIdentityProfile withMsiObjectId(Strin public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("msiResourceId", msiResourceId()); + jsonWriter.writeStringField("msiClientId", msiClientId()); + jsonWriter.writeStringField("msiObjectId", msiObjectId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksClusterProfileAksClusterAgentPoolIdentityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksClusterProfileAksClusterAgentPoolIdentityProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AksClusterProfileAksClusterAgentPoolIdentityProfile. + */ + public static AksClusterProfileAksClusterAgentPoolIdentityProfile fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AksClusterProfileAksClusterAgentPoolIdentityProfile deserializedAksClusterProfileAksClusterAgentPoolIdentityProfile + = new AksClusterProfileAksClusterAgentPoolIdentityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("msiResourceId".equals(fieldName)) { + deserializedAksClusterProfileAksClusterAgentPoolIdentityProfile + .withMsiResourceId(reader.getString()); + } else if ("msiClientId".equals(fieldName)) { + deserializedAksClusterProfileAksClusterAgentPoolIdentityProfile.withMsiClientId(reader.getString()); + } else if ("msiObjectId".equals(fieldName)) { + deserializedAksClusterProfileAksClusterAgentPoolIdentityProfile.withMsiObjectId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAksClusterProfileAksClusterAgentPoolIdentityProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AuthorizationProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AuthorizationProfile.java index 616c74406f217..5fbfb2f0c9fa2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AuthorizationProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AuthorizationProfile.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. */ @Fluent -public final class AuthorizationProfile { +public final class AuthorizationProfile implements JsonSerializable { /* * AAD user Ids authorized for data plane access. */ - @JsonProperty(value = "userIds") private List userIds; /* * AAD group Ids authorized for data plane access. */ - @JsonProperty(value = "groupIds") private List groupIds; /** @@ -78,4 +80,45 @@ public AuthorizationProfile withGroupIds(List groupIds) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("userIds", this.userIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("groupIds", this.groupIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthorizationProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthorizationProfile 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 AuthorizationProfile. + */ + public static AuthorizationProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthorizationProfile deserializedAuthorizationProfile = new AuthorizationProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userIds".equals(fieldName)) { + List userIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAuthorizationProfile.userIds = userIds; + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAuthorizationProfile.groupIds = groupIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAuthorizationProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleProfile.java index 9298321ca2139..b0c9e707571e2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleProfile.java @@ -5,44 +5,43 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. */ @Fluent -public final class AutoscaleProfile { +public final class AutoscaleProfile implements JsonSerializable { /* * This indicates whether auto scale is enabled on HDInsight on AKS cluster. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * This property is for graceful decommission timeout; It has a default setting of 3600 seconds before forced - * shutdown takes place. This is the maximal time to wait for running containers and applications to complete - * before transition a DECOMMISSIONING node into DECOMMISSIONED. The default value is 3600 seconds. Negative value - * (like -1) is handled as infinite timeout. + * shutdown takes place. This is the maximal time to wait for running containers and applications to complete before + * transition a DECOMMISSIONING node into DECOMMISSIONED. The default value is 3600 seconds. Negative value (like + * -1) is handled as infinite timeout. */ - @JsonProperty(value = "gracefulDecommissionTimeout") private Integer gracefulDecommissionTimeout; /* * User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based. */ - @JsonProperty(value = "autoscaleType") private AutoscaleType autoscaleType; /* * Profiles of schedule based Autoscale. */ - @JsonProperty(value = "scheduleBasedConfig") private ScheduleBasedConfig scheduleBasedConfig; /* * Profiles of load based Autoscale. */ - @JsonProperty(value = "loadBasedConfig") private LoadBasedConfig loadBasedConfig; /** @@ -74,8 +73,8 @@ public AutoscaleProfile withEnabled(boolean enabled) { /** * Get the gracefulDecommissionTimeout property: This property is for graceful decommission timeout; It has a * default setting of 3600 seconds before forced shutdown takes place. This is the maximal time to wait for running - * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The - * default value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. + * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The default + * value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. * * @return the gracefulDecommissionTimeout value. */ @@ -86,8 +85,8 @@ public Integer gracefulDecommissionTimeout() { /** * Set the gracefulDecommissionTimeout property: This property is for graceful decommission timeout; It has a * default setting of 3600 seconds before forced shutdown takes place. This is the maximal time to wait for running - * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The - * default value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. + * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The default + * value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. * * @param gracefulDecommissionTimeout the gracefulDecommissionTimeout value to set. * @return the AutoscaleProfile object itself. @@ -172,4 +171,53 @@ public void validate() { loadBasedConfig().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("gracefulDecommissionTimeout", this.gracefulDecommissionTimeout); + jsonWriter.writeStringField("autoscaleType", this.autoscaleType == null ? null : this.autoscaleType.toString()); + jsonWriter.writeJsonField("scheduleBasedConfig", this.scheduleBasedConfig); + jsonWriter.writeJsonField("loadBasedConfig", this.loadBasedConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoscaleProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoscaleProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutoscaleProfile. + */ + public static AutoscaleProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoscaleProfile deserializedAutoscaleProfile = new AutoscaleProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAutoscaleProfile.enabled = reader.getBoolean(); + } else if ("gracefulDecommissionTimeout".equals(fieldName)) { + deserializedAutoscaleProfile.gracefulDecommissionTimeout = reader.getNullable(JsonReader::getInt); + } else if ("autoscaleType".equals(fieldName)) { + deserializedAutoscaleProfile.autoscaleType = AutoscaleType.fromString(reader.getString()); + } else if ("scheduleBasedConfig".equals(fieldName)) { + deserializedAutoscaleProfile.scheduleBasedConfig = ScheduleBasedConfig.fromJson(reader); + } else if ("loadBasedConfig".equals(fieldName)) { + deserializedAutoscaleProfile.loadBasedConfig = LoadBasedConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoscaleProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleType.java index fd52e266d057b..17ccfa92d2f5c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/AutoscaleType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AutoscaleType() { * @param name a name to look for. * @return the corresponding AutoscaleType. */ - @JsonCreator public static AutoscaleType fromString(String name) { return fromString(name, AutoscaleType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CatalogOptions.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CatalogOptions.java index 23d9492e98adf..4019567839e18 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CatalogOptions.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CatalogOptions.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Trino cluster catalog options. */ @Fluent -public final class CatalogOptions { +public final class CatalogOptions implements JsonSerializable { /* * hive catalog options. */ - @JsonProperty(value = "hive") private List hive; /** @@ -55,4 +58,41 @@ public void validate() { hive().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("hive", this.hive, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CatalogOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CatalogOptions 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 CatalogOptions. + */ + public static CatalogOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CatalogOptions deserializedCatalogOptions = new CatalogOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hive".equals(fieldName)) { + List hive = reader.readArray(reader1 -> HiveCatalogOption.fromJson(reader1)); + deserializedCatalogOptions.hive = hive; + } else { + reader.skipChildren(); + } + } + + return deserializedCatalogOptions; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Category.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Category.java new file mode 100644 index 0000000000000..72f790d682d17 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Category.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for Category. + */ +public final class Category extends ExpandableStringEnum { + /** + * Static value custom for Category. + */ + public static final Category CUSTOM = fromString("custom"); + + /** + * Static value predefined for Category. + */ + public static final Category PREDEFINED = fromString("predefined"); + + /** + * Creates a new instance of Category value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Category() { + } + + /** + * Creates or finds a Category from its string representation. + * + * @param name a name to look for. + * @return the corresponding Category. + */ + public static Category fromString(String name) { + return fromString(name, Category.class); + } + + /** + * Gets known Category values. + * + * @return known Category values. + */ + public static Collection values() { + return values(Category.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Cluster.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Cluster.java index 2352b966c4efe..72046dcad0608 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Cluster.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Cluster.java @@ -287,6 +287,29 @@ interface WithProperties { */ Cluster upgrade(ClusterUpgrade clusterUpgradeRequest, Context context); + /** + * Manual rollback upgrade for a cluster. + * + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + Cluster upgradeManualRollback(ClusterUpgradeRollback clusterRollbackUpgradeRequest); + + /** + * Manual rollback upgrade for a cluster. + * + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + Cluster upgradeManualRollback(ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context); + /** * Resize an existing Cluster. * diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAccessProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAccessProfile.java index bd89f1b68d272..f29b07dc41bdc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAccessProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAccessProfile.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster access profile. */ @Fluent -public final class ClusterAccessProfile { +public final class ClusterAccessProfile implements JsonSerializable { /* * Whether to create cluster using private IP instead of public IP. This property must be set at create time. */ - @JsonProperty(value = "enableInternalIngress", required = true) private boolean enableInternalIngress; /* * Private link service resource ID. Only when enableInternalIngress is true, this property will be returned. */ - @JsonProperty(value = "privateLinkServiceId", access = JsonProperty.Access.WRITE_ONLY) private String privateLinkServiceId; /** @@ -53,8 +55,8 @@ public ClusterAccessProfile withEnableInternalIngress(boolean enableInternalIngr } /** - * Get the privateLinkServiceId property: Private link service resource ID. Only when enableInternalIngress is - * true, this property will be returned. + * Get the privateLinkServiceId property: Private link service resource ID. Only when enableInternalIngress is true, + * this property will be returned. * * @return the privateLinkServiceId value. */ @@ -69,4 +71,43 @@ public String privateLinkServiceId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableInternalIngress", this.enableInternalIngress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAccessProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAccessProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterAccessProfile. + */ + public static ClusterAccessProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAccessProfile deserializedClusterAccessProfile = new ClusterAccessProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableInternalIngress".equals(fieldName)) { + deserializedClusterAccessProfile.enableInternalIngress = reader.getBoolean(); + } else if ("privateLinkServiceId".equals(fieldName)) { + deserializedClusterAccessProfile.privateLinkServiceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAccessProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..acb18d9ef7b6e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchUpgradeHistoryProperties.java @@ -0,0 +1,169 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster aks patch upgrade history properties. + */ +@Fluent +public final class ClusterAksPatchUpgradeHistoryProperties extends ClusterUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType = ClusterUpgradeHistoryType.AKSPATCH_UPGRADE; + + /* + * Version before update. + */ + private String originalVersion; + + /* + * Version going to update. + */ + private String newVersion; + + /** + * Creates an instance of ClusterAksPatchUpgradeHistoryProperties class. + */ + public ClusterAksPatchUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the originalVersion property: Version before update. + * + * @return the originalVersion value. + */ + public String originalVersion() { + return this.originalVersion; + } + + /** + * Set the originalVersion property: Version before update. + * + * @param originalVersion the originalVersion value to set. + * @return the ClusterAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterAksPatchUpgradeHistoryProperties withOriginalVersion(String originalVersion) { + this.originalVersion = originalVersion; + return this; + } + + /** + * Get the newVersion property: Version going to update. + * + * @return the newVersion value. + */ + public String newVersion() { + return this.newVersion; + } + + /** + * Set the newVersion property: Version going to update. + * + * @param newVersion the newVersion value to set. + * @return the ClusterAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterAksPatchUpgradeHistoryProperties withNewVersion(String newVersion) { + this.newVersion = newVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAksPatchUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAksPatchUpgradeHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("originalVersion", this.originalVersion); + jsonWriter.writeStringField("newVersion", this.newVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAksPatchUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAksPatchUpgradeHistoryProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterAksPatchUpgradeHistoryProperties. + */ + public static ClusterAksPatchUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAksPatchUpgradeHistoryProperties deserializedClusterAksPatchUpgradeHistoryProperties + = new ClusterAksPatchUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterAksPatchUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterAksPatchUpgradeHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterAksPatchUpgradeHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else if ("originalVersion".equals(fieldName)) { + deserializedClusterAksPatchUpgradeHistoryProperties.originalVersion = reader.getString(); + } else if ("newVersion".equals(fieldName)) { + deserializedClusterAksPatchUpgradeHistoryProperties.newVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAksPatchUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchVersionUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchVersionUpgradeProperties.java index eb0236cb1be52..6683708201c48 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchVersionUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAksPatchVersionUpgradeProperties.java @@ -5,22 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster's AKS patch version. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("AKSPatchUpgrade") @Immutable public final class ClusterAksPatchVersionUpgradeProperties extends ClusterUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeType upgradeType = ClusterUpgradeType.AKSPATCH_UPGRADE; + /** * Creates an instance of ClusterAksPatchVersionUpgradeProperties class. */ public ClusterAksPatchVersionUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -30,4 +45,42 @@ public ClusterAksPatchVersionUpgradeProperties() { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAksPatchVersionUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAksPatchVersionUpgradeProperties 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 ClusterAksPatchVersionUpgradeProperties. + */ + public static ClusterAksPatchVersionUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAksPatchVersionUpgradeProperties deserializedClusterAksPatchVersionUpgradeProperties + = new ClusterAksPatchVersionUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterAksPatchVersionUpgradeProperties.upgradeType + = ClusterUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAksPatchVersionUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableInPlaceUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableInPlaceUpgradeProperties.java new file mode 100644 index 0000000000000..e813203320208 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableInPlaceUpgradeProperties.java @@ -0,0 +1,429 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Cluster available in-place upgrade. + */ +@Fluent +public class ClusterAvailableInPlaceUpgradeProperties extends ClusterAvailableUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterAvailableUpgradeType upgradeType + = ClusterAvailableUpgradeType.fromString("ClusterAvailableInPlaceUpgradeProperties"); + + /* + * Hotfix version upgrade description. + */ + private String description; + + /* + * Source OSS version of current cluster component. + */ + private String sourceOssVersion; + + /* + * Source cluster version of current cluster component. + */ + private String sourceClusterVersion; + + /* + * Source build number of current cluster component. + */ + private String sourceBuildNumber; + + /* + * Target OSS version of component to be upgraded. + */ + private String targetOssVersion; + + /* + * Target cluster version of component to be upgraded. + */ + private String targetClusterVersion; + + /* + * Target build number of component to be upgraded. + */ + private String targetBuildNumber; + + /* + * Name of component to be upgraded. + */ + private String componentName; + + /* + * Severity of this upgrade. + */ + private Severity severity; + + /* + * Extended properties of current available upgrade version + */ + private String extendedProperties; + + /* + * Created time of current available upgrade version + */ + private OffsetDateTime createdTime; + + /** + * Creates an instance of ClusterAvailableInPlaceUpgradeProperties class. + */ + public ClusterAvailableInPlaceUpgradeProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + + /** + * Get the description property: Hotfix version upgrade description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Hotfix version upgrade description. + * + * @param description the description value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceOssVersion property: Source OSS version of current cluster component. + * + * @return the sourceOssVersion value. + */ + public String sourceOssVersion() { + return this.sourceOssVersion; + } + + /** + * Set the sourceOssVersion property: Source OSS version of current cluster component. + * + * @param sourceOssVersion the sourceOssVersion value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withSourceOssVersion(String sourceOssVersion) { + this.sourceOssVersion = sourceOssVersion; + return this; + } + + /** + * Get the sourceClusterVersion property: Source cluster version of current cluster component. + * + * @return the sourceClusterVersion value. + */ + public String sourceClusterVersion() { + return this.sourceClusterVersion; + } + + /** + * Set the sourceClusterVersion property: Source cluster version of current cluster component. + * + * @param sourceClusterVersion the sourceClusterVersion value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withSourceClusterVersion(String sourceClusterVersion) { + this.sourceClusterVersion = sourceClusterVersion; + return this; + } + + /** + * Get the sourceBuildNumber property: Source build number of current cluster component. + * + * @return the sourceBuildNumber value. + */ + public String sourceBuildNumber() { + return this.sourceBuildNumber; + } + + /** + * Set the sourceBuildNumber property: Source build number of current cluster component. + * + * @param sourceBuildNumber the sourceBuildNumber value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withSourceBuildNumber(String sourceBuildNumber) { + this.sourceBuildNumber = sourceBuildNumber; + return this; + } + + /** + * Get the targetOssVersion property: Target OSS version of component to be upgraded. + * + * @return the targetOssVersion value. + */ + public String targetOssVersion() { + return this.targetOssVersion; + } + + /** + * Set the targetOssVersion property: Target OSS version of component to be upgraded. + * + * @param targetOssVersion the targetOssVersion value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withTargetOssVersion(String targetOssVersion) { + this.targetOssVersion = targetOssVersion; + return this; + } + + /** + * Get the targetClusterVersion property: Target cluster version of component to be upgraded. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set the targetClusterVersion property: Target cluster version of component to be upgraded. + * + * @param targetClusterVersion the targetClusterVersion value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get the targetBuildNumber property: Target build number of component to be upgraded. + * + * @return the targetBuildNumber value. + */ + public String targetBuildNumber() { + return this.targetBuildNumber; + } + + /** + * Set the targetBuildNumber property: Target build number of component to be upgraded. + * + * @param targetBuildNumber the targetBuildNumber value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { + this.targetBuildNumber = targetBuildNumber; + return this; + } + + /** + * Get the componentName property: Name of component to be upgraded. + * + * @return the componentName value. + */ + public String componentName() { + return this.componentName; + } + + /** + * Set the componentName property: Name of component to be upgraded. + * + * @param componentName the componentName value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withComponentName(String componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the severity property: Severity of this upgrade. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of this upgrade. + * + * @param severity the severity value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the extendedProperties property: Extended properties of current available upgrade version. + * + * @return the extendedProperties value. + */ + public String extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Extended properties of current available upgrade version. + * + * @param extendedProperties the extendedProperties value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withExtendedProperties(String extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the createdTime property: Created time of current available upgrade version. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Set the createdTime property: Created time of current available upgrade version. + * + * @param createdTime the createdTime value to set. + * @return the ClusterAvailableInPlaceUpgradeProperties object itself. + */ + public ClusterAvailableInPlaceUpgradeProperties withCreatedTime(OffsetDateTime createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("sourceOssVersion", this.sourceOssVersion); + jsonWriter.writeStringField("sourceClusterVersion", this.sourceClusterVersion); + jsonWriter.writeStringField("sourceBuildNumber", this.sourceBuildNumber); + jsonWriter.writeStringField("targetOssVersion", this.targetOssVersion); + jsonWriter.writeStringField("targetClusterVersion", this.targetClusterVersion); + jsonWriter.writeStringField("targetBuildNumber", this.targetBuildNumber); + jsonWriter.writeStringField("componentName", this.componentName); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("extendedProperties", this.extendedProperties); + jsonWriter.writeStringField("createdTime", + this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableInPlaceUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableInPlaceUpgradeProperties 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 ClusterAvailableInPlaceUpgradeProperties. + */ + public static ClusterAvailableInPlaceUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterAvailableUpgradeHotfixUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterAvailableUpgradePatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterAvailableInPlaceUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableInPlaceUpgradeProperties deserializedClusterAvailableInPlaceUpgradeProperties + = new ClusterAvailableInPlaceUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.upgradeType + = ClusterAvailableUpgradeType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.description = reader.getString(); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.sourceOssVersion = reader.getString(); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.sourceClusterVersion = reader.getString(); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.sourceBuildNumber = reader.getString(); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.targetOssVersion = reader.getString(); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.targetClusterVersion = reader.getString(); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.targetBuildNumber = reader.getString(); + } else if ("componentName".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.componentName = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.severity + = Severity.fromString(reader.getString()); + } else if ("extendedProperties".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.extendedProperties = reader.getString(); + } else if ("createdTime".equals(fieldName)) { + deserializedClusterAvailableInPlaceUpgradeProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableInPlaceUpgradeProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeAksPatchUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeAksPatchUpgradeProperties.java index 0357db6013cf7..56c25d74df499 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeAksPatchUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeAksPatchUpgradeProperties.java @@ -5,33 +5,34 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster available AKS patch version upgrade. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("AKSPatchUpgrade") @Fluent public final class ClusterAvailableUpgradeAksPatchUpgradeProperties extends ClusterAvailableUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterAvailableUpgradeType upgradeType = ClusterAvailableUpgradeType.AKSPATCH_UPGRADE; + /* * Current node pool version. */ - @JsonProperty(value = "currentVersion") private String currentVersion; /* * Current AKS version's status: whether it is deprecated or supported */ - @JsonProperty(value = "currentVersionStatus") private CurrentClusterAksVersionStatus currentVersionStatus; /* * Latest available version, which should be equal to AKS control plane version if it's not deprecated. */ - @JsonProperty(value = "latestVersion") private String latestVersion; /** @@ -40,6 +41,16 @@ public final class ClusterAvailableUpgradeAksPatchUpgradeProperties extends Clus public ClusterAvailableUpgradeAksPatchUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Get the currentVersion property: Current node pool version. * @@ -112,4 +123,53 @@ public ClusterAvailableUpgradeAksPatchUpgradeProperties withLatestVersion(String public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("currentVersion", this.currentVersion); + jsonWriter.writeStringField("currentVersionStatus", + this.currentVersionStatus == null ? null : this.currentVersionStatus.toString()); + jsonWriter.writeStringField("latestVersion", this.latestVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeAksPatchUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeAksPatchUpgradeProperties 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 ClusterAvailableUpgradeAksPatchUpgradeProperties. + */ + public static ClusterAvailableUpgradeAksPatchUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeAksPatchUpgradeProperties deserializedClusterAvailableUpgradeAksPatchUpgradeProperties + = new ClusterAvailableUpgradeAksPatchUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterAvailableUpgradeAksPatchUpgradeProperties.upgradeType + = ClusterAvailableUpgradeType.fromString(reader.getString()); + } else if ("currentVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeAksPatchUpgradeProperties.currentVersion = reader.getString(); + } else if ("currentVersionStatus".equals(fieldName)) { + deserializedClusterAvailableUpgradeAksPatchUpgradeProperties.currentVersionStatus + = CurrentClusterAksVersionStatus.fromString(reader.getString()); + } else if ("latestVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeAksPatchUpgradeProperties.latestVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeAksPatchUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeHotfixUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeHotfixUpgradeProperties.java index 2e88b74167969..4dc1edca4de34 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeHotfixUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeHotfixUpgradeProperties.java @@ -5,83 +5,23 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Cluster available hotfix version upgrade. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("HotfixUpgrade") @Fluent -public final class ClusterAvailableUpgradeHotfixUpgradeProperties extends ClusterAvailableUpgradeProperties { +public final class ClusterAvailableUpgradeHotfixUpgradeProperties extends ClusterAvailableInPlaceUpgradeProperties { /* - * Hotfix version upgrade description. + * Type of upgrade. */ - @JsonProperty(value = "description") - private String description; - - /* - * Source OSS version of current cluster component. - */ - @JsonProperty(value = "sourceOssVersion") - private String sourceOssVersion; - - /* - * Source cluster version of current cluster component. - */ - @JsonProperty(value = "sourceClusterVersion") - private String sourceClusterVersion; - - /* - * Source build number of current cluster component. - */ - @JsonProperty(value = "sourceBuildNumber") - private String sourceBuildNumber; - - /* - * Target OSS version of component to be upgraded. - */ - @JsonProperty(value = "targetOssVersion") - private String targetOssVersion; - - /* - * Target cluster version of component to be upgraded. - */ - @JsonProperty(value = "targetClusterVersion") - private String targetClusterVersion; - - /* - * Target build number of component to be upgraded. - */ - @JsonProperty(value = "targetBuildNumber") - private String targetBuildNumber; - - /* - * Name of component to be upgraded. - */ - @JsonProperty(value = "componentName") - private String componentName; - - /* - * Severity of this upgrade. - */ - @JsonProperty(value = "severity") - private Severity severity; - - /* - * Extended properties of current available upgrade version - */ - @JsonProperty(value = "extendedProperties") - private String extendedProperties; - - /* - * Created time of current available upgrade version - */ - @JsonProperty(value = "createdTime") - private OffsetDateTime createdTime; + private ClusterAvailableUpgradeType upgradeType = ClusterAvailableUpgradeType.HOTFIX_UPGRADE; /** * Creates an instance of ClusterAvailableUpgradeHotfixUpgradeProperties class. @@ -90,222 +30,111 @@ public ClusterAvailableUpgradeHotfixUpgradeProperties() { } /** - * Get the description property: Hotfix version upgrade description. + * Get the upgradeType property: Type of upgrade. * - * @return the description value. + * @return the upgradeType value. */ - public String description() { - return this.description; + @Override + public ClusterAvailableUpgradeType upgradeType() { + return this.upgradeType; } /** - * Set the description property: Hotfix version upgrade description. - * - * @param description the description value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withDescription(String description) { - this.description = description; + super.withDescription(description); return this; } /** - * Get the sourceOssVersion property: Source OSS version of current cluster component. - * - * @return the sourceOssVersion value. - */ - public String sourceOssVersion() { - return this.sourceOssVersion; - } - - /** - * Set the sourceOssVersion property: Source OSS version of current cluster component. - * - * @param sourceOssVersion the sourceOssVersion value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withSourceOssVersion(String sourceOssVersion) { - this.sourceOssVersion = sourceOssVersion; + super.withSourceOssVersion(sourceOssVersion); return this; } /** - * Get the sourceClusterVersion property: Source cluster version of current cluster component. - * - * @return the sourceClusterVersion value. - */ - public String sourceClusterVersion() { - return this.sourceClusterVersion; - } - - /** - * Set the sourceClusterVersion property: Source cluster version of current cluster component. - * - * @param sourceClusterVersion the sourceClusterVersion value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withSourceClusterVersion(String sourceClusterVersion) { - this.sourceClusterVersion = sourceClusterVersion; + super.withSourceClusterVersion(sourceClusterVersion); return this; } /** - * Get the sourceBuildNumber property: Source build number of current cluster component. - * - * @return the sourceBuildNumber value. - */ - public String sourceBuildNumber() { - return this.sourceBuildNumber; - } - - /** - * Set the sourceBuildNumber property: Source build number of current cluster component. - * - * @param sourceBuildNumber the sourceBuildNumber value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withSourceBuildNumber(String sourceBuildNumber) { - this.sourceBuildNumber = sourceBuildNumber; + super.withSourceBuildNumber(sourceBuildNumber); return this; } /** - * Get the targetOssVersion property: Target OSS version of component to be upgraded. - * - * @return the targetOssVersion value. - */ - public String targetOssVersion() { - return this.targetOssVersion; - } - - /** - * Set the targetOssVersion property: Target OSS version of component to be upgraded. - * - * @param targetOssVersion the targetOssVersion value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withTargetOssVersion(String targetOssVersion) { - this.targetOssVersion = targetOssVersion; + super.withTargetOssVersion(targetOssVersion); return this; } /** - * Get the targetClusterVersion property: Target cluster version of component to be upgraded. - * - * @return the targetClusterVersion value. - */ - public String targetClusterVersion() { - return this.targetClusterVersion; - } - - /** - * Set the targetClusterVersion property: Target cluster version of component to be upgraded. - * - * @param targetClusterVersion the targetClusterVersion value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { - this.targetClusterVersion = targetClusterVersion; + super.withTargetClusterVersion(targetClusterVersion); return this; } /** - * Get the targetBuildNumber property: Target build number of component to be upgraded. - * - * @return the targetBuildNumber value. - */ - public String targetBuildNumber() { - return this.targetBuildNumber; - } - - /** - * Set the targetBuildNumber property: Target build number of component to be upgraded. - * - * @param targetBuildNumber the targetBuildNumber value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { - this.targetBuildNumber = targetBuildNumber; + super.withTargetBuildNumber(targetBuildNumber); return this; } /** - * Get the componentName property: Name of component to be upgraded. - * - * @return the componentName value. - */ - public String componentName() { - return this.componentName; - } - - /** - * Set the componentName property: Name of component to be upgraded. - * - * @param componentName the componentName value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withComponentName(String componentName) { - this.componentName = componentName; + super.withComponentName(componentName); return this; } /** - * Get the severity property: Severity of this upgrade. - * - * @return the severity value. - */ - public Severity severity() { - return this.severity; - } - - /** - * Set the severity property: Severity of this upgrade. - * - * @param severity the severity value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withSeverity(Severity severity) { - this.severity = severity; + super.withSeverity(severity); return this; } /** - * Get the extendedProperties property: Extended properties of current available upgrade version. - * - * @return the extendedProperties value. - */ - public String extendedProperties() { - return this.extendedProperties; - } - - /** - * Set the extendedProperties property: Extended properties of current available upgrade version. - * - * @param extendedProperties the extendedProperties value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withExtendedProperties(String extendedProperties) { - this.extendedProperties = extendedProperties; + super.withExtendedProperties(extendedProperties); return this; } /** - * Get the createdTime property: Created time of current available upgrade version. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Set the createdTime property: Created time of current available upgrade version. - * - * @param createdTime the createdTime value to set. - * @return the ClusterAvailableUpgradeHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterAvailableUpgradeHotfixUpgradeProperties withCreatedTime(OffsetDateTime createdTime) { - this.createdTime = createdTime; + super.withCreatedTime(createdTime); return this; } @@ -318,4 +147,83 @@ public ClusterAvailableUpgradeHotfixUpgradeProperties withCreatedTime(OffsetDate public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("extendedProperties", extendedProperties()); + jsonWriter.writeStringField("createdTime", + createdTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdTime())); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeHotfixUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeHotfixUpgradeProperties 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 ClusterAvailableUpgradeHotfixUpgradeProperties. + */ + public static ClusterAvailableUpgradeHotfixUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeHotfixUpgradeProperties deserializedClusterAvailableUpgradeHotfixUpgradeProperties + = new ClusterAvailableUpgradeHotfixUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.withDescription(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.withSourceOssVersion(reader.getString()); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withSourceClusterVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withSourceBuildNumber(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.withTargetOssVersion(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withTargetClusterVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withSeverity(Severity.fromString(reader.getString())); + } else if ("extendedProperties".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties + .withExtendedProperties(reader.getString()); + } else if ("createdTime".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.withCreatedTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterAvailableUpgradeHotfixUpgradeProperties.upgradeType + = ClusterAvailableUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeHotfixUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeList.java index 08d4f84b48da0..01afc8fa9e1fb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeList.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeList.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterAvailableUpgradeInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of cluster available upgrade. */ @Fluent -public final class ClusterAvailableUpgradeList { +public final class ClusterAvailableUpgradeList implements JsonSerializable { /* * Collection of Cluster available upgrade. */ - @JsonProperty(value = "value", required = true) private List value; /* * The URL of next result page. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public ClusterAvailableUpgradeList withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ClusterAvailableUpgradeList")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ClusterAvailableUpgradeList")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterAvailableUpgradeList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterAvailableUpgradeList. + */ + public static ClusterAvailableUpgradeList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeList deserializedClusterAvailableUpgradeList = new ClusterAvailableUpgradeList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterAvailableUpgradeInner.fromJson(reader1)); + deserializedClusterAvailableUpgradeList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterAvailableUpgradeList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeList; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradePatchVersionUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradePatchVersionUpgradeProperties.java new file mode 100644 index 0000000000000..5e6a94b9e2a6b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradePatchVersionUpgradeProperties.java @@ -0,0 +1,235 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Cluster available patch version upgrade. + */ +@Fluent +public final class ClusterAvailableUpgradePatchVersionUpgradeProperties + extends ClusterAvailableInPlaceUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterAvailableUpgradeType upgradeType = ClusterAvailableUpgradeType.PATCH_VERSION_UPGRADE; + + /** + * Creates an instance of ClusterAvailableUpgradePatchVersionUpgradeProperties class. + */ + public ClusterAvailableUpgradePatchVersionUpgradeProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withSourceOssVersion(String sourceOssVersion) { + super.withSourceOssVersion(sourceOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withSourceClusterVersion(String sourceClusterVersion) { + super.withSourceClusterVersion(sourceClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withSourceBuildNumber(String sourceBuildNumber) { + super.withSourceBuildNumber(sourceBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withSeverity(Severity severity) { + super.withSeverity(severity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withExtendedProperties(String extendedProperties) { + super.withExtendedProperties(extendedProperties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterAvailableUpgradePatchVersionUpgradeProperties withCreatedTime(OffsetDateTime createdTime) { + super.withCreatedTime(createdTime); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("extendedProperties", extendedProperties()); + jsonWriter.writeStringField("createdTime", + createdTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdTime())); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradePatchVersionUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradePatchVersionUpgradeProperties 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 ClusterAvailableUpgradePatchVersionUpgradeProperties. + */ + public static ClusterAvailableUpgradePatchVersionUpgradeProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradePatchVersionUpgradeProperties deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + = new ClusterAvailableUpgradePatchVersionUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withDescription(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withSourceOssVersion(reader.getString()); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withSourceClusterVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withSourceBuildNumber(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withTargetOssVersion(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withTargetClusterVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withSeverity(Severity.fromString(reader.getString())); + } else if ("extendedProperties".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties + .withExtendedProperties(reader.getString()); + } else if ("createdTime".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties.withCreatedTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterAvailableUpgradePatchVersionUpgradeProperties.upgradeType + = ClusterAvailableUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradePatchVersionUpgradeProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeProperties.java index d126e7b8e73e6..4b0031dcb5044 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeProperties.java @@ -5,30 +5,38 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster available upgrade properties. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "upgradeType", - defaultImpl = ClusterAvailableUpgradeProperties.class) -@JsonTypeName("ClusterAvailableUpgradeProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKSPatchUpgrade", value = ClusterAvailableUpgradeAksPatchUpgradeProperties.class), - @JsonSubTypes.Type(name = "HotfixUpgrade", value = ClusterAvailableUpgradeHotfixUpgradeProperties.class) }) @Immutable -public class ClusterAvailableUpgradeProperties { +public class ClusterAvailableUpgradeProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterAvailableUpgradeType upgradeType + = ClusterAvailableUpgradeType.fromString("ClusterAvailableUpgradeProperties"); + /** * Creates an instance of ClusterAvailableUpgradeProperties class. */ public ClusterAvailableUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -36,4 +44,73 @@ public ClusterAvailableUpgradeProperties() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeProperties 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 ClusterAvailableUpgradeProperties. + */ + public static ClusterAvailableUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterAvailableUpgradeAksPatchUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("ClusterAvailableInPlaceUpgradeProperties".equals(discriminatorValue)) { + return ClusterAvailableInPlaceUpgradeProperties.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterAvailableUpgradeHotfixUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterAvailableUpgradePatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterAvailableUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeProperties deserializedClusterAvailableUpgradeProperties + = new ClusterAvailableUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterAvailableUpgradeProperties.upgradeType + = ClusterAvailableUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeType.java index cbaa69f834482..d60deaf81ae70 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterAvailableUpgradeType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -22,6 +21,11 @@ public final class ClusterAvailableUpgradeType extends ExpandableStringEnum { /* * The name property. */ - @JsonProperty(value = "name") private String name; /* * The version property. */ - @JsonProperty(value = "version") private String version; /** @@ -77,4 +79,43 @@ public ClusterComponentsItem withVersion(String version) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterComponentsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterComponentsItem 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 ClusterComponentsItem. + */ + public static ClusterComponentsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterComponentsItem deserializedClusterComponentsItem = new ClusterComponentsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClusterComponentsItem.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedClusterComponentsItem.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterComponentsItem; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterConfigFile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterConfigFile.java index d0d6004a72700..bd2e69c00bc17 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterConfigFile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterConfigFile.java @@ -6,46 +6,43 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Cluster configuration files. */ @Fluent -public final class ClusterConfigFile { +public final class ClusterConfigFile implements JsonSerializable { /* * Configuration file name. */ - @JsonProperty(value = "fileName", required = true) private String fileName; /* * Free form content of the entire configuration file. */ - @JsonProperty(value = "content") private String content; /* * This property indicates if the content is encoded and is case-insensitive. Please set the value to base64 if the * content is base64 encoded. Set it to none or skip it if the content is plain text. */ - @JsonProperty(value = "encoding") private ContentEncoding encoding; /* * Path of the config file if content is specified. */ - @JsonProperty(value = "path") private String path; /* * List of key value pairs * where key represents a valid service configuration name and value represents the value of the config. */ - @JsonProperty(value = "values") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map values; /** @@ -165,10 +162,60 @@ public ClusterConfigFile withValues(Map values) { */ public void validate() { if (fileName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property fileName in model ClusterConfigFile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property fileName in model ClusterConfigFile")); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterConfigFile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("encoding", this.encoding == null ? null : this.encoding.toString()); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeMapField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterConfigFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterConfigFile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterConfigFile. + */ + public static ClusterConfigFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterConfigFile deserializedClusterConfigFile = new ClusterConfigFile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + deserializedClusterConfigFile.fileName = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedClusterConfigFile.content = reader.getString(); + } else if ("encoding".equals(fieldName)) { + deserializedClusterConfigFile.encoding = ContentEncoding.fromString(reader.getString()); + } else if ("path".equals(fieldName)) { + deserializedClusterConfigFile.path = reader.getString(); + } else if ("values".equals(fieldName)) { + Map values = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterConfigFile.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterConfigFile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..bedf2e9f0fff2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeHistoryProperties.java @@ -0,0 +1,210 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster hotfix upgrade history properties. + */ +@Fluent +public final class ClusterHotfixUpgradeHistoryProperties extends ClusterInPlaceUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType = ClusterUpgradeHistoryType.HOTFIX_UPGRADE; + + /** + * Creates an instance of ClusterHotfixUpgradeHistoryProperties class. + */ + public ClusterHotfixUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withSourceClusterVersion(String sourceClusterVersion) { + super.withSourceClusterVersion(sourceClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withSourceOssVersion(String sourceOssVersion) { + super.withSourceOssVersion(sourceOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withSourceBuildNumber(String sourceBuildNumber) { + super.withSourceBuildNumber(sourceBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withSeverity(ClusterUpgradeHistorySeverityType severity) { + super.withSeverity(severity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterHotfixUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterHotfixUpgradeHistoryProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterHotfixUpgradeHistoryProperties. + */ + public static ClusterHotfixUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterHotfixUpgradeHistoryProperties deserializedClusterHotfixUpgradeHistoryProperties + = new ClusterHotfixUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withSourceClusterVersion(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withSourceOssVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withSourceBuildNumber(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withTargetClusterVersion(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withTargetOssVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties + .withSeverity(ClusterUpgradeHistorySeverityType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterHotfixUpgradeHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterHotfixUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeProperties.java index 6dcf376e63ffb..bf40ad5b66f13 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeProperties.java @@ -5,40 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster's hotfix. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("HotfixUpgrade") @Fluent -public final class ClusterHotfixUpgradeProperties extends ClusterUpgradeProperties { +public final class ClusterHotfixUpgradeProperties extends ClusterInPlaceUpgradeProperties { /* - * Target OSS version of component to be upgraded. + * Type of upgrade. */ - @JsonProperty(value = "targetOssVersion") - private String targetOssVersion; - - /* - * Target cluster version of component to be upgraded. - */ - @JsonProperty(value = "targetClusterVersion") - private String targetClusterVersion; - - /* - * Target build number of component to be upgraded. - */ - @JsonProperty(value = "targetBuildNumber") - private String targetBuildNumber; - - /* - * Name of component to be upgraded. - */ - @JsonProperty(value = "componentName") - private String componentName; + private ClusterUpgradeType upgradeType = ClusterUpgradeType.HOTFIX_UPGRADE; /** * Creates an instance of ClusterHotfixUpgradeProperties class. @@ -47,92 +27,108 @@ public ClusterHotfixUpgradeProperties() { } /** - * Get the targetOssVersion property: Target OSS version of component to be upgraded. + * Get the upgradeType property: Type of upgrade. * - * @return the targetOssVersion value. + * @return the upgradeType value. */ - public String targetOssVersion() { - return this.targetOssVersion; + @Override + public ClusterUpgradeType upgradeType() { + return this.upgradeType; } /** - * Set the targetOssVersion property: Target OSS version of component to be upgraded. - * - * @param targetOssVersion the targetOssVersion value to set. - * @return the ClusterHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterHotfixUpgradeProperties withTargetOssVersion(String targetOssVersion) { - this.targetOssVersion = targetOssVersion; + super.withTargetOssVersion(targetOssVersion); return this; } /** - * Get the targetClusterVersion property: Target cluster version of component to be upgraded. - * - * @return the targetClusterVersion value. - */ - public String targetClusterVersion() { - return this.targetClusterVersion; - } - - /** - * Set the targetClusterVersion property: Target cluster version of component to be upgraded. - * - * @param targetClusterVersion the targetClusterVersion value to set. - * @return the ClusterHotfixUpgradeProperties object itself. + * {@inheritDoc} */ + @Override public ClusterHotfixUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { - this.targetClusterVersion = targetClusterVersion; + super.withTargetClusterVersion(targetClusterVersion); return this; } /** - * Get the targetBuildNumber property: Target build number of component to be upgraded. - * - * @return the targetBuildNumber value. + * {@inheritDoc} */ - public String targetBuildNumber() { - return this.targetBuildNumber; + @Override + public ClusterHotfixUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; } /** - * Set the targetBuildNumber property: Target build number of component to be upgraded. - * - * @param targetBuildNumber the targetBuildNumber value to set. - * @return the ClusterHotfixUpgradeProperties object itself. + * {@inheritDoc} */ - public ClusterHotfixUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { - this.targetBuildNumber = targetBuildNumber; + @Override + public ClusterHotfixUpgradeProperties withComponentName(String componentName) { + super.withComponentName(componentName); return this; } /** - * Get the componentName property: Name of component to be upgraded. + * Validates the instance. * - * @return the componentName value. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - public String componentName() { - return this.componentName; + @Override + public void validate() { + super.validate(); } /** - * Set the componentName property: Name of component to be upgraded. - * - * @param componentName the componentName value to set. - * @return the ClusterHotfixUpgradeProperties object itself. + * {@inheritDoc} */ - public ClusterHotfixUpgradeProperties withComponentName(String componentName) { - this.componentName = componentName; - return this; + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); } /** - * Validates the instance. + * Reads an instance of ClusterHotfixUpgradeProperties from the JsonReader. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterHotfixUpgradeProperties 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 ClusterHotfixUpgradeProperties. */ - @Override - public void validate() { - super.validate(); + public static ClusterHotfixUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterHotfixUpgradeProperties deserializedClusterHotfixUpgradeProperties + = new ClusterHotfixUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetOssVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeProperties.withTargetOssVersion(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeProperties.withTargetClusterVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterHotfixUpgradeProperties.withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterHotfixUpgradeProperties.withComponentName(reader.getString()); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterHotfixUpgradeProperties.upgradeType + = ClusterUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterHotfixUpgradeProperties; + }); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeRollbackHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeRollbackHistoryProperties.java new file mode 100644 index 0000000000000..4fb5702805e7a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterHotfixUpgradeRollbackHistoryProperties.java @@ -0,0 +1,212 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster hotfix upgrade rollback history properties. + */ +@Fluent +public final class ClusterHotfixUpgradeRollbackHistoryProperties extends ClusterInPlaceUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType = ClusterUpgradeHistoryType.HOTFIX_UPGRADE_ROLLBACK; + + /** + * Creates an instance of ClusterHotfixUpgradeRollbackHistoryProperties class. + */ + public ClusterHotfixUpgradeRollbackHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withSourceClusterVersion(String sourceClusterVersion) { + super.withSourceClusterVersion(sourceClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withSourceOssVersion(String sourceOssVersion) { + super.withSourceOssVersion(sourceOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withSourceBuildNumber(String sourceBuildNumber) { + super.withSourceBuildNumber(sourceBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withSeverity(ClusterUpgradeHistorySeverityType severity) { + super.withSeverity(severity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterHotfixUpgradeRollbackHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterHotfixUpgradeRollbackHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterHotfixUpgradeRollbackHistoryProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterHotfixUpgradeRollbackHistoryProperties. + */ + public static ClusterHotfixUpgradeRollbackHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterHotfixUpgradeRollbackHistoryProperties deserializedClusterHotfixUpgradeRollbackHistoryProperties + = new ClusterHotfixUpgradeRollbackHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties + .withSourceClusterVersion(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withSourceOssVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withSourceBuildNumber(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties + .withTargetClusterVersion(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withTargetOssVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties + .withSeverity(ClusterUpgradeHistorySeverityType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterHotfixUpgradeRollbackHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterHotfixUpgradeRollbackHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..84b8a8e65c985 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeHistoryProperties.java @@ -0,0 +1,370 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster in-place upgrade history properties. + */ +@Fluent +public class ClusterInPlaceUpgradeHistoryProperties extends ClusterUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType + = ClusterUpgradeHistoryType.fromString("ClusterInPlaceUpgradeHistoryProperties"); + + /* + * Version with three part. + */ + private String sourceClusterVersion; + + /* + * Version with three part. + */ + private String sourceOssVersion; + + /* + * Source build number. + */ + private String sourceBuildNumber; + + /* + * Version with three part. + */ + private String targetClusterVersion; + + /* + * Version with three part. + */ + private String targetOssVersion; + + /* + * Target build number. + */ + private String targetBuildNumber; + + /* + * Component name to upgrade. + */ + private String componentName; + + /* + * Severity of this upgrade. + */ + private ClusterUpgradeHistorySeverityType severity; + + /** + * Creates an instance of ClusterInPlaceUpgradeHistoryProperties class. + */ + public ClusterInPlaceUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the sourceClusterVersion property: Version with three part. + * + * @return the sourceClusterVersion value. + */ + public String sourceClusterVersion() { + return this.sourceClusterVersion; + } + + /** + * Set the sourceClusterVersion property: Version with three part. + * + * @param sourceClusterVersion the sourceClusterVersion value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withSourceClusterVersion(String sourceClusterVersion) { + this.sourceClusterVersion = sourceClusterVersion; + return this; + } + + /** + * Get the sourceOssVersion property: Version with three part. + * + * @return the sourceOssVersion value. + */ + public String sourceOssVersion() { + return this.sourceOssVersion; + } + + /** + * Set the sourceOssVersion property: Version with three part. + * + * @param sourceOssVersion the sourceOssVersion value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withSourceOssVersion(String sourceOssVersion) { + this.sourceOssVersion = sourceOssVersion; + return this; + } + + /** + * Get the sourceBuildNumber property: Source build number. + * + * @return the sourceBuildNumber value. + */ + public String sourceBuildNumber() { + return this.sourceBuildNumber; + } + + /** + * Set the sourceBuildNumber property: Source build number. + * + * @param sourceBuildNumber the sourceBuildNumber value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withSourceBuildNumber(String sourceBuildNumber) { + this.sourceBuildNumber = sourceBuildNumber; + return this; + } + + /** + * Get the targetClusterVersion property: Version with three part. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set the targetClusterVersion property: Version with three part. + * + * @param targetClusterVersion the targetClusterVersion value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get the targetOssVersion property: Version with three part. + * + * @return the targetOssVersion value. + */ + public String targetOssVersion() { + return this.targetOssVersion; + } + + /** + * Set the targetOssVersion property: Version with three part. + * + * @param targetOssVersion the targetOssVersion value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withTargetOssVersion(String targetOssVersion) { + this.targetOssVersion = targetOssVersion; + return this; + } + + /** + * Get the targetBuildNumber property: Target build number. + * + * @return the targetBuildNumber value. + */ + public String targetBuildNumber() { + return this.targetBuildNumber; + } + + /** + * Set the targetBuildNumber property: Target build number. + * + * @param targetBuildNumber the targetBuildNumber value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withTargetBuildNumber(String targetBuildNumber) { + this.targetBuildNumber = targetBuildNumber; + return this; + } + + /** + * Get the componentName property: Component name to upgrade. + * + * @return the componentName value. + */ + public String componentName() { + return this.componentName; + } + + /** + * Set the componentName property: Component name to upgrade. + * + * @param componentName the componentName value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withComponentName(String componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the severity property: Severity of this upgrade. + * + * @return the severity value. + */ + public ClusterUpgradeHistorySeverityType severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of this upgrade. + * + * @param severity the severity value to set. + * @return the ClusterInPlaceUpgradeHistoryProperties object itself. + */ + public ClusterInPlaceUpgradeHistoryProperties withSeverity(ClusterUpgradeHistorySeverityType severity) { + this.severity = severity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterInPlaceUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterInPlaceUpgradeHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("sourceClusterVersion", this.sourceClusterVersion); + jsonWriter.writeStringField("sourceOssVersion", this.sourceOssVersion); + jsonWriter.writeStringField("sourceBuildNumber", this.sourceBuildNumber); + jsonWriter.writeStringField("targetClusterVersion", this.targetClusterVersion); + jsonWriter.writeStringField("targetOssVersion", this.targetOssVersion); + jsonWriter.writeStringField("targetBuildNumber", this.targetBuildNumber); + jsonWriter.writeStringField("componentName", this.componentName); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInPlaceUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInPlaceUpgradeHistoryProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInPlaceUpgradeHistoryProperties. + */ + public static ClusterInPlaceUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterHotfixUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else if ("HotfixUpgradeRollback".equals(discriminatorValue)) { + return ClusterHotfixUpgradeRollbackHistoryProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgradeRollback".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeRollbackHistoryProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterInPlaceUpgradeHistoryProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInPlaceUpgradeHistoryProperties deserializedClusterInPlaceUpgradeHistoryProperties + = new ClusterInPlaceUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.sourceClusterVersion = reader.getString(); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.sourceOssVersion = reader.getString(); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.sourceBuildNumber = reader.getString(); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.targetClusterVersion = reader.getString(); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.targetOssVersion = reader.getString(); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.targetBuildNumber = reader.getString(); + } else if ("componentName".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.componentName = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedClusterInPlaceUpgradeHistoryProperties.severity + = ClusterUpgradeHistorySeverityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInPlaceUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeProperties.java new file mode 100644 index 0000000000000..b6bcd707bae2e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInPlaceUpgradeProperties.java @@ -0,0 +1,225 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of in-place upgrading cluster. + */ +@Fluent +public class ClusterInPlaceUpgradeProperties extends ClusterUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeType upgradeType = ClusterUpgradeType.fromString("ClusterInPlaceUpgradeProperties"); + + /* + * Target OSS version of component to be upgraded. + */ + private String targetOssVersion; + + /* + * Target cluster version of component to be upgraded. + */ + private String targetClusterVersion; + + /* + * Target build number of component to be upgraded. + */ + private String targetBuildNumber; + + /* + * Name of component to be upgraded. + */ + private String componentName; + + /** + * Creates an instance of ClusterInPlaceUpgradeProperties class. + */ + public ClusterInPlaceUpgradeProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeType upgradeType() { + return this.upgradeType; + } + + /** + * Get the targetOssVersion property: Target OSS version of component to be upgraded. + * + * @return the targetOssVersion value. + */ + public String targetOssVersion() { + return this.targetOssVersion; + } + + /** + * Set the targetOssVersion property: Target OSS version of component to be upgraded. + * + * @param targetOssVersion the targetOssVersion value to set. + * @return the ClusterInPlaceUpgradeProperties object itself. + */ + public ClusterInPlaceUpgradeProperties withTargetOssVersion(String targetOssVersion) { + this.targetOssVersion = targetOssVersion; + return this; + } + + /** + * Get the targetClusterVersion property: Target cluster version of component to be upgraded. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set the targetClusterVersion property: Target cluster version of component to be upgraded. + * + * @param targetClusterVersion the targetClusterVersion value to set. + * @return the ClusterInPlaceUpgradeProperties object itself. + */ + public ClusterInPlaceUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get the targetBuildNumber property: Target build number of component to be upgraded. + * + * @return the targetBuildNumber value. + */ + public String targetBuildNumber() { + return this.targetBuildNumber; + } + + /** + * Set the targetBuildNumber property: Target build number of component to be upgraded. + * + * @param targetBuildNumber the targetBuildNumber value to set. + * @return the ClusterInPlaceUpgradeProperties object itself. + */ + public ClusterInPlaceUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { + this.targetBuildNumber = targetBuildNumber; + return this; + } + + /** + * Get the componentName property: Name of component to be upgraded. + * + * @return the componentName value. + */ + public String componentName() { + return this.componentName; + } + + /** + * Set the componentName property: Name of component to be upgraded. + * + * @param componentName the componentName value to set. + * @return the ClusterInPlaceUpgradeProperties object itself. + */ + public ClusterInPlaceUpgradeProperties withComponentName(String componentName) { + this.componentName = componentName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("targetOssVersion", this.targetOssVersion); + jsonWriter.writeStringField("targetClusterVersion", this.targetClusterVersion); + jsonWriter.writeStringField("targetBuildNumber", this.targetBuildNumber); + jsonWriter.writeStringField("componentName", this.componentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInPlaceUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInPlaceUpgradeProperties 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 ClusterInPlaceUpgradeProperties. + */ + public static ClusterInPlaceUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterHotfixUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterInPlaceUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInPlaceUpgradeProperties deserializedClusterInPlaceUpgradeProperties + = new ClusterInPlaceUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterInPlaceUpgradeProperties.upgradeType + = ClusterUpgradeType.fromString(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeProperties.targetOssVersion = reader.getString(); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterInPlaceUpgradeProperties.targetClusterVersion = reader.getString(); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterInPlaceUpgradeProperties.targetBuildNumber = reader.getString(); + } else if ("componentName".equals(fieldName)) { + deserializedClusterInPlaceUpgradeProperties.componentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInPlaceUpgradeProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewProperties.java index 1186c891edbd7..d26021084905e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewProperties.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster Instance View Properties. */ @Fluent -public class ClusterInstanceViewProperties { +public class ClusterInstanceViewProperties implements JsonSerializable { /* * Status of the instance view. */ - @JsonProperty(value = "status", required = true) private ClusterInstanceViewPropertiesStatus status; /* * List of statuses of relevant services that make up the HDInsight on AKS cluster to surface to the customer. */ - @JsonProperty(value = "serviceStatuses", required = true) private List serviceStatuses; /** @@ -53,8 +55,8 @@ public ClusterInstanceViewProperties withStatus(ClusterInstanceViewPropertiesSta } /** - * Get the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on AKS - * cluster to surface to the customer. + * Get the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on AKS cluster + * to surface to the customer. * * @return the serviceStatuses value. */ @@ -63,8 +65,8 @@ public List serviceStatuses() { } /** - * Set the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on AKS - * cluster to surface to the customer. + * Set the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on AKS cluster + * to surface to the customer. * * @param serviceStatuses the serviceStatuses value to set. * @return the ClusterInstanceViewProperties object itself. @@ -81,18 +83,64 @@ public ClusterInstanceViewProperties withServiceStatuses(List ser */ public void validate() { if (status() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property status in model ClusterInstanceViewProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model ClusterInstanceViewProperties")); } else { status().validate(); } if (serviceStatuses() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serviceStatuses in model ClusterInstanceViewProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serviceStatuses in model ClusterInstanceViewProperties")); } else { serviceStatuses().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeArrayField("serviceStatuses", this.serviceStatuses, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInstanceViewProperties. + */ + public static ClusterInstanceViewProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewProperties deserializedClusterInstanceViewProperties + = new ClusterInstanceViewProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedClusterInstanceViewProperties.status + = ClusterInstanceViewPropertiesStatus.fromJson(reader); + } else if ("serviceStatuses".equals(fieldName)) { + List serviceStatuses = reader.readArray(reader1 -> ServiceStatus.fromJson(reader1)); + deserializedClusterInstanceViewProperties.serviceStatuses = serviceStatuses; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewPropertiesStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewPropertiesStatus.java index d428f22dde121..14a8134d533be 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewPropertiesStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewPropertiesStatus.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Status of the instance view. @@ -53,4 +57,48 @@ public ClusterInstanceViewPropertiesStatus withMessage(String message) { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ready", ready()); + jsonWriter.writeStringField("reason", reason()); + jsonWriter.writeStringField("message", message()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewPropertiesStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewPropertiesStatus if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInstanceViewPropertiesStatus. + */ + public static ClusterInstanceViewPropertiesStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewPropertiesStatus deserializedClusterInstanceViewPropertiesStatus + = new ClusterInstanceViewPropertiesStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ready".equals(fieldName)) { + deserializedClusterInstanceViewPropertiesStatus.withReady(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedClusterInstanceViewPropertiesStatus.withReason(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedClusterInstanceViewPropertiesStatus.withMessage(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewPropertiesStatus; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewResultProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewResultProperties.java index 58bb5a3e2feca..d7961fddea6ea 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewResultProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewResultProperties.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -45,4 +49,48 @@ public ClusterInstanceViewResultProperties withServiceStatuses(List writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewResultProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInstanceViewResultProperties. + */ + public static ClusterInstanceViewResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewResultProperties deserializedClusterInstanceViewResultProperties + = new ClusterInstanceViewResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedClusterInstanceViewResultProperties + .withStatus(ClusterInstanceViewPropertiesStatus.fromJson(reader)); + } else if ("serviceStatuses".equals(fieldName)) { + List serviceStatuses = reader.readArray(reader1 -> ServiceStatus.fromJson(reader1)); + deserializedClusterInstanceViewResultProperties.withServiceStatuses(serviceStatuses); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewResultProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewStatus.java index 84b84efd45a58..11357d15fd7c6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewStatus.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Status of the instance view. */ @Fluent -public class ClusterInstanceViewStatus { +public class ClusterInstanceViewStatus implements JsonSerializable { /* * The cluster ready status */ - @JsonProperty(value = "ready", required = true) private String ready; /* * The status reason. */ - @JsonProperty(value = "reason") private String reason; /* * The additional message. */ - @JsonProperty(value = "message") private String message; /** @@ -104,10 +105,54 @@ public ClusterInstanceViewStatus withMessage(String message) { */ public void validate() { if (ready() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ready in model ClusterInstanceViewStatus")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property ready in model ClusterInstanceViewStatus")); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewStatus.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ready", this.ready); + jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewStatus if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterInstanceViewStatus. + */ + public static ClusterInstanceViewStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewStatus deserializedClusterInstanceViewStatus = new ClusterInstanceViewStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ready".equals(fieldName)) { + deserializedClusterInstanceViewStatus.ready = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedClusterInstanceViewStatus.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedClusterInstanceViewStatus.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewStatus; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewsResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewsResult.java index 02f0bd9d0a29e..af7bb24663686 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewsResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterInstanceViewsResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterInstanceViewResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The instance view of a HDInsight Cluster. */ @Fluent -public final class ClusterInstanceViewsResult { +public final class ClusterInstanceViewsResult implements JsonSerializable { /* * Cluster instance view array. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInstanceViewsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInstanceViewsResult 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 ClusterInstanceViewsResult. + */ + public static ClusterInstanceViewsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInstanceViewsResult deserializedClusterInstanceViewsResult = new ClusterInstanceViewsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterInstanceViewResultInner.fromJson(reader1)); + deserializedClusterInstanceViewsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterInstanceViewsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInstanceViewsResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobList.java index 92e54a186eb69..b67d80a74c2ef 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobList.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobList.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterJobInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of cluster job. */ @Fluent -public final class ClusterJobList { +public final class ClusterJobList implements JsonSerializable { /* * Collection of cluster job. */ - @JsonProperty(value = "value", required = true) private List value; /* * The Url of next result page. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public ClusterJobList withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ClusterJobList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ClusterJobList")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterJobList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterJobList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterJobList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterJobList. + */ + public static ClusterJobList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterJobList deserializedClusterJobList = new ClusterJobList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterJobInner.fromJson(reader1)); + deserializedClusterJobList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterJobList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterJobList; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobProperties.java index b61a2f37a0227..b3bc1c50e0ffc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterJobProperties.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of cluster job. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "jobType", - defaultImpl = ClusterJobProperties.class) -@JsonTypeName("ClusterJobProperties") -@JsonSubTypes({ @JsonSubTypes.Type(name = "FlinkJob", value = FlinkJobProperties.class) }) @Immutable -public class ClusterJobProperties { +public class ClusterJobProperties implements JsonSerializable { + /* + * Type of cluster job. + */ + private JobType jobType = JobType.fromString("ClusterJobProperties"); + /** * Creates an instance of ClusterJobProperties class. */ public ClusterJobProperties() { } + /** + * Get the jobType property: Type of cluster job. + * + * @return the jobType value. + */ + public JobType jobType() { + return this.jobType; + } + /** * Validates the instance. * @@ -34,4 +43,65 @@ public ClusterJobProperties() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterJobProperties 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 ClusterJobProperties. + */ + public static ClusterJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FlinkJob".equals(discriminatorValue)) { + return FlinkJobProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterJobProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterJobProperties deserializedClusterJobProperties = new ClusterJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedClusterJobProperties.jobType = JobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterJobProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraries.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraries.java new file mode 100644 index 0000000000000..3fc4251f73723 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraries.java @@ -0,0 +1,75 @@ +// 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.containers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ClusterLibraries. + */ +public interface ClusterLibraries { + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category); + + /** + * Get all libraries of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param category The system query option to filter libraries returned in the response. Allowed value is 'custom' + * or 'predefined'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all libraries of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Category category, Context context); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation); + + /** + * Library management operations on HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param operation The library management operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void manageLibraries(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterLibraryManagementOperation operation, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibrary.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibrary.java new file mode 100644 index 0000000000000..683849bc3ddce --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibrary.java @@ -0,0 +1,55 @@ +// 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.containers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; + +/** + * An immutable client-side representation of ClusterLibrary. + */ +public interface ClusterLibrary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of a library in the cluster. + * + * @return the properties value. + */ + ClusterLibraryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner object. + * + * @return the inner object. + */ + ClusterLibraryInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryList.java new file mode 100644 index 0000000000000..0c8085a26a7e1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryList.java @@ -0,0 +1,123 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of libraries in the cluster. + */ +@Fluent +public final class ClusterLibraryList implements JsonSerializable { + /* + * Collection of libraries in the cluster. + */ + private List value; + + /* + * The url of next result page. + */ + private String nextLink; + + /** + * Creates an instance of ClusterLibraryList class. + */ + public ClusterLibraryList() { + } + + /** + * Get the value property: Collection of libraries in the cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of libraries in the cluster. + * + * @param value the value value to set. + * @return the ClusterLibraryList object itself. + */ + public ClusterLibraryList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The url of next result page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ClusterLibraryList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterLibraryList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLibraryList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLibraryList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterLibraryList. + */ + public static ClusterLibraryList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLibraryList deserializedClusterLibraryList = new ClusterLibraryList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterLibraryInner.fromJson(reader1)); + deserializedClusterLibraryList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterLibraryList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLibraryList; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperation.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperation.java new file mode 100644 index 0000000000000..d79c08eeebb0f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperation.java @@ -0,0 +1,174 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Library management operation. + */ +@Fluent +public final class ClusterLibraryManagementOperation extends ProxyResource { + /* + * Properties of a library management operation. + */ + private ClusterLibraryManagementOperationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ClusterLibraryManagementOperation class. + */ + public ClusterLibraryManagementOperation() { + } + + /** + * Get the properties property: Properties of a library management operation. + * + * @return the properties value. + */ + public ClusterLibraryManagementOperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a library management operation. + * + * @param properties the properties value to set. + * @return the ClusterLibraryManagementOperation object itself. + */ + public ClusterLibraryManagementOperation withProperties(ClusterLibraryManagementOperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ClusterLibraryManagementOperation")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterLibraryManagementOperation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLibraryManagementOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLibraryManagementOperation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterLibraryManagementOperation. + */ + public static ClusterLibraryManagementOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLibraryManagementOperation deserializedClusterLibraryManagementOperation + = new ClusterLibraryManagementOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterLibraryManagementOperation.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterLibraryManagementOperation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterLibraryManagementOperation.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterLibraryManagementOperation.properties + = ClusterLibraryManagementOperationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterLibraryManagementOperation.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLibraryManagementOperation; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperationProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperationProperties.java new file mode 100644 index 0000000000000..c7cba709db00c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryManagementOperationProperties.java @@ -0,0 +1,144 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a library management operation. + */ +@Fluent +public final class ClusterLibraryManagementOperationProperties + implements JsonSerializable { + /* + * The library management action. + */ + private LibraryManagementAction action; + + /* + * The libraries to be installed/updated/uninstalled. + */ + private List libraries; + + /** + * Creates an instance of ClusterLibraryManagementOperationProperties class. + */ + public ClusterLibraryManagementOperationProperties() { + } + + /** + * Get the action property: The library management action. + * + * @return the action value. + */ + public LibraryManagementAction action() { + return this.action; + } + + /** + * Set the action property: The library management action. + * + * @param action the action value to set. + * @return the ClusterLibraryManagementOperationProperties object itself. + */ + public ClusterLibraryManagementOperationProperties withAction(LibraryManagementAction action) { + this.action = action; + return this; + } + + /** + * Get the libraries property: The libraries to be installed/updated/uninstalled. + * + * @return the libraries value. + */ + public List libraries() { + return this.libraries; + } + + /** + * Set the libraries property: The libraries to be installed/updated/uninstalled. + * + * @param libraries the libraries value to set. + * @return the ClusterLibraryManagementOperationProperties object itself. + */ + public ClusterLibraryManagementOperationProperties withLibraries(List libraries) { + this.libraries = libraries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property action in model ClusterLibraryManagementOperationProperties")); + } + if (libraries() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property libraries in model ClusterLibraryManagementOperationProperties")); + } else { + libraries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterLibraryManagementOperationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeArrayField("libraries", this.libraries, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLibraryManagementOperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLibraryManagementOperationProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterLibraryManagementOperationProperties. + */ + public static ClusterLibraryManagementOperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLibraryManagementOperationProperties deserializedClusterLibraryManagementOperationProperties + = new ClusterLibraryManagementOperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedClusterLibraryManagementOperationProperties.action + = LibraryManagementAction.fromString(reader.getString()); + } else if ("libraries".equals(fieldName)) { + List libraries + = reader.readArray(reader1 -> ClusterLibraryInner.fromJson(reader1)); + deserializedClusterLibraryManagementOperationProperties.libraries = libraries; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLibraryManagementOperationProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryProperties.java new file mode 100644 index 0000000000000..d3d35a5b77262 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLibraryProperties.java @@ -0,0 +1,221 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of a library in the cluster. + */ +@Fluent +public class ClusterLibraryProperties implements JsonSerializable { + /* + * Type of the library. + */ + private Type type = Type.fromString("ClusterLibraryProperties"); + + /* + * Remark of the latest library management operation. + */ + private String remarks; + + /* + * Timestamp of the latest library management operation. + */ + private OffsetDateTime timestamp; + + /* + * Status of the library. + */ + private Status status; + + /* + * Error message of the library operation when a failure occurs. + */ + private String message; + + /** + * Creates an instance of ClusterLibraryProperties class. + */ + public ClusterLibraryProperties() { + } + + /** + * Get the type property: Type of the library. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Get the remarks property: Remark of the latest library management operation. + * + * @return the remarks value. + */ + public String remarks() { + return this.remarks; + } + + /** + * Set the remarks property: Remark of the latest library management operation. + * + * @param remarks the remarks value to set. + * @return the ClusterLibraryProperties object itself. + */ + public ClusterLibraryProperties withRemarks(String remarks) { + this.remarks = remarks; + return this; + } + + /** + * Get the timestamp property: Timestamp of the latest library management operation. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: Timestamp of the latest library management operation. + * + * @param timestamp the timestamp value to set. + * @return the ClusterLibraryProperties object itself. + */ + ClusterLibraryProperties withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the status property: Status of the library. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: Status of the library. + * + * @param status the status value to set. + * @return the ClusterLibraryProperties object itself. + */ + ClusterLibraryProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the message property: Error message of the library operation when a failure occurs. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message of the library operation when a failure occurs. + * + * @param message the message value to set. + * @return the ClusterLibraryProperties object itself. + */ + ClusterLibraryProperties withMessage(String message) { + this.message = message; + 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("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("remarks", this.remarks); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLibraryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLibraryProperties 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 ClusterLibraryProperties. + */ + public static ClusterLibraryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("pypi".equals(discriminatorValue)) { + return PyPiLibraryProperties.fromJson(readerToUse.reset()); + } else if ("maven".equals(discriminatorValue)) { + return MavenLibraryProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterLibraryProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLibraryProperties deserializedClusterLibraryProperties = new ClusterLibraryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedClusterLibraryProperties.type = Type.fromString(reader.getString()); + } else if ("remarks".equals(fieldName)) { + deserializedClusterLibraryProperties.remarks = reader.getString(); + } else if ("timestamp".equals(fieldName)) { + deserializedClusterLibraryProperties.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedClusterLibraryProperties.status = Status.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedClusterLibraryProperties.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLibraryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterListResult.java index 39115fdaa01aa..6f818ee502fae 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The list cluster operation response. */ @Fluent -public final class ClusterListResult { +public final class ClusterListResult implements JsonSerializable { /* * The list of clusters. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterListResult 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 ClusterListResult. + */ + public static ClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterListResult deserializedClusterListResult = new ClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterInner.fromJson(reader1)); + deserializedClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsApplicationLogs.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsApplicationLogs.java index ca445dab915c3..184da15810fd5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsApplicationLogs.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsApplicationLogs.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Collection of logs to be enabled or disabled for log analytics. */ @Fluent -public final class ClusterLogAnalyticsApplicationLogs { +public final class ClusterLogAnalyticsApplicationLogs implements JsonSerializable { /* * True if stdout is enabled, otherwise false. */ - @JsonProperty(value = "stdOutEnabled") private Boolean stdOutEnabled; /* * True if stderror is enabled, otherwise false. */ - @JsonProperty(value = "stdErrorEnabled") private Boolean stdErrorEnabled; /** @@ -77,4 +79,46 @@ public ClusterLogAnalyticsApplicationLogs withStdErrorEnabled(Boolean stdErrorEn */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("stdOutEnabled", this.stdOutEnabled); + jsonWriter.writeBooleanField("stdErrorEnabled", this.stdErrorEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLogAnalyticsApplicationLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLogAnalyticsApplicationLogs 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 ClusterLogAnalyticsApplicationLogs. + */ + public static ClusterLogAnalyticsApplicationLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLogAnalyticsApplicationLogs deserializedClusterLogAnalyticsApplicationLogs + = new ClusterLogAnalyticsApplicationLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("stdOutEnabled".equals(fieldName)) { + deserializedClusterLogAnalyticsApplicationLogs.stdOutEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("stdErrorEnabled".equals(fieldName)) { + deserializedClusterLogAnalyticsApplicationLogs.stdErrorEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLogAnalyticsApplicationLogs; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsProfile.java index 5f5bf60f32fef..e413148da880c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterLogAnalyticsProfile.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster log analytics profile to enable or disable OMS agent for cluster. */ @Fluent -public final class ClusterLogAnalyticsProfile { +public final class ClusterLogAnalyticsProfile implements JsonSerializable { /* * True if log analytics is enabled for the cluster, otherwise false. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * Collection of logs to be enabled or disabled for log analytics. */ - @JsonProperty(value = "applicationLogs") private ClusterLogAnalyticsApplicationLogs applicationLogs; /* * True if metrics are enabled, otherwise false. */ - @JsonProperty(value = "metricsEnabled") private Boolean metricsEnabled; /** @@ -106,4 +107,48 @@ public void validate() { applicationLogs().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("applicationLogs", this.applicationLogs); + jsonWriter.writeBooleanField("metricsEnabled", this.metricsEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterLogAnalyticsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterLogAnalyticsProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterLogAnalyticsProfile. + */ + public static ClusterLogAnalyticsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterLogAnalyticsProfile deserializedClusterLogAnalyticsProfile = new ClusterLogAnalyticsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedClusterLogAnalyticsProfile.enabled = reader.getBoolean(); + } else if ("applicationLogs".equals(fieldName)) { + deserializedClusterLogAnalyticsProfile.applicationLogs + = ClusterLogAnalyticsApplicationLogs.fromJson(reader); + } else if ("metricsEnabled".equals(fieldName)) { + deserializedClusterLogAnalyticsProfile.metricsEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterLogAnalyticsProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatch.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatch.java index f72ab3f884ef8..a031e0275bd99 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatch.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatch.java @@ -5,26 +5,26 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The patch for a cluster. */ @Fluent -public final class ClusterPatch { +public final class ClusterPatch implements JsonSerializable { /* * Define cluster patch specific properties. */ - @JsonProperty(value = "properties") private ClusterPatchProperties properties; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -83,4 +83,44 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatch 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 ClusterPatch. + */ + public static ClusterPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatch deserializedClusterPatch = new ClusterPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterPatch.properties = ClusterPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterPatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatch; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchProperties.java index 686f17110f3dc..1580460970ee9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchProperties.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster resource patch data. */ @Fluent -public final class ClusterPatchProperties { +public final class ClusterPatchProperties implements JsonSerializable { /* * Cluster resource patch properties. */ - @JsonProperty(value = "clusterProfile") private UpdatableClusterProfile clusterProfile; /** @@ -54,4 +57,40 @@ public void validate() { clusterProfile().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("clusterProfile", this.clusterProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchProperties 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 ClusterPatchProperties. + */ + public static ClusterPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchProperties deserializedClusterPatchProperties = new ClusterPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterProfile".equals(fieldName)) { + deserializedClusterPatchProperties.clusterProfile = UpdatableClusterProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..ef765c8e9cf9b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeHistoryProperties.java @@ -0,0 +1,212 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster patch version upgrade history properties. + */ +@Fluent +public final class ClusterPatchVersionUpgradeHistoryProperties extends ClusterInPlaceUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType = ClusterUpgradeHistoryType.PATCH_VERSION_UPGRADE; + + /** + * Creates an instance of ClusterPatchVersionUpgradeHistoryProperties class. + */ + public ClusterPatchVersionUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withSourceClusterVersion(String sourceClusterVersion) { + super.withSourceClusterVersion(sourceClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withSourceOssVersion(String sourceOssVersion) { + super.withSourceOssVersion(sourceOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withSourceBuildNumber(String sourceBuildNumber) { + super.withSourceBuildNumber(sourceBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withSeverity(ClusterUpgradeHistorySeverityType severity) { + super.withSeverity(severity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchVersionUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchVersionUpgradeHistoryProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPatchVersionUpgradeHistoryProperties. + */ + public static ClusterPatchVersionUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchVersionUpgradeHistoryProperties deserializedClusterPatchVersionUpgradeHistoryProperties + = new ClusterPatchVersionUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties + .withSourceClusterVersion(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withSourceOssVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withSourceBuildNumber(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties + .withTargetClusterVersion(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withTargetOssVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties + .withSeverity(ClusterUpgradeHistorySeverityType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchVersionUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeProperties.java new file mode 100644 index 0000000000000..dab36780a3859 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeProperties.java @@ -0,0 +1,134 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of upgrading cluster's patch version. + */ +@Fluent +public final class ClusterPatchVersionUpgradeProperties extends ClusterInPlaceUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeType upgradeType = ClusterUpgradeType.PATCH_VERSION_UPGRADE; + + /** + * Creates an instance of ClusterPatchVersionUpgradeProperties class. + */ + public ClusterPatchVersionUpgradeProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchVersionUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchVersionUpgradeProperties 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 ClusterPatchVersionUpgradeProperties. + */ + public static ClusterPatchVersionUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchVersionUpgradeProperties deserializedClusterPatchVersionUpgradeProperties + = new ClusterPatchVersionUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetOssVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeProperties.withTargetOssVersion(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeProperties.withTargetClusterVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeProperties.withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeProperties.withComponentName(reader.getString()); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeProperties.upgradeType + = ClusterUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchVersionUpgradeProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeRollbackHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeRollbackHistoryProperties.java new file mode 100644 index 0000000000000..509c46d047d77 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPatchVersionUpgradeRollbackHistoryProperties.java @@ -0,0 +1,219 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster patch version upgrade rollback history properties. + */ +@Fluent +public final class ClusterPatchVersionUpgradeRollbackHistoryProperties extends ClusterInPlaceUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType = ClusterUpgradeHistoryType.PATCH_VERSION_UPGRADE_ROLLBACK; + + /** + * Creates an instance of ClusterPatchVersionUpgradeRollbackHistoryProperties class. + */ + public ClusterPatchVersionUpgradeRollbackHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withSourceClusterVersion(String sourceClusterVersion) { + super.withSourceClusterVersion(sourceClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withSourceOssVersion(String sourceOssVersion) { + super.withSourceOssVersion(sourceOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withSourceBuildNumber(String sourceBuildNumber) { + super.withSourceBuildNumber(sourceBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withTargetClusterVersion(String targetClusterVersion) { + super.withTargetClusterVersion(targetClusterVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withTargetOssVersion(String targetOssVersion) { + super.withTargetOssVersion(targetOssVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withTargetBuildNumber(String targetBuildNumber) { + super.withTargetBuildNumber(targetBuildNumber); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties + withSeverity(ClusterUpgradeHistorySeverityType severity) { + super.withSeverity(severity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPatchVersionUpgradeRollbackHistoryProperties + withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("sourceClusterVersion", sourceClusterVersion()); + jsonWriter.writeStringField("sourceOssVersion", sourceOssVersion()); + jsonWriter.writeStringField("sourceBuildNumber", sourceBuildNumber()); + jsonWriter.writeStringField("targetClusterVersion", targetClusterVersion()); + jsonWriter.writeStringField("targetOssVersion", targetOssVersion()); + jsonWriter.writeStringField("targetBuildNumber", targetBuildNumber()); + jsonWriter.writeStringField("componentName", componentName()); + jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchVersionUpgradeRollbackHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchVersionUpgradeRollbackHistoryProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPatchVersionUpgradeRollbackHistoryProperties. + */ + public static ClusterPatchVersionUpgradeRollbackHistoryProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchVersionUpgradeRollbackHistoryProperties deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + = new ClusterPatchVersionUpgradeRollbackHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("sourceClusterVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withSourceClusterVersion(reader.getString()); + } else if ("sourceOssVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withSourceOssVersion(reader.getString()); + } else if ("sourceBuildNumber".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withSourceBuildNumber(reader.getString()); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withTargetClusterVersion(reader.getString()); + } else if ("targetOssVersion".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withTargetOssVersion(reader.getString()); + } else if ("targetBuildNumber".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withTargetBuildNumber(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withComponentName(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties + .withSeverity(ClusterUpgradeHistorySeverityType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPatchVersionUpgradeRollbackHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchVersionUpgradeRollbackHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..dc7149e5f5270 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchUpgradeHistoryProperties.java @@ -0,0 +1,227 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster pool aks upgrade history properties. + */ +@Fluent +public final class ClusterPoolAksPatchUpgradeHistoryProperties extends ClusterPoolUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeHistoryType upgradeType = ClusterPoolUpgradeHistoryType.AKSPATCH_UPGRADE; + + /* + * Whether upgrade cluster pool. + */ + private Boolean upgradeClusterPool; + + /* + * Whether upgrade all cluster nodes. + */ + private Boolean upgradeAllClusterNodes; + + /* + * Version before update. + */ + private String originalVersion; + + /* + * Version going to update. + */ + private String newVersion; + + /** + * Creates an instance of ClusterPoolAksPatchUpgradeHistoryProperties class. + */ + public ClusterPoolAksPatchUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the upgradeClusterPool property: Whether upgrade cluster pool. + * + * @return the upgradeClusterPool value. + */ + public Boolean upgradeClusterPool() { + return this.upgradeClusterPool; + } + + /** + * Set the upgradeClusterPool property: Whether upgrade cluster pool. + * + * @param upgradeClusterPool the upgradeClusterPool value to set. + * @return the ClusterPoolAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterPoolAksPatchUpgradeHistoryProperties withUpgradeClusterPool(Boolean upgradeClusterPool) { + this.upgradeClusterPool = upgradeClusterPool; + return this; + } + + /** + * Get the upgradeAllClusterNodes property: Whether upgrade all cluster nodes. + * + * @return the upgradeAllClusterNodes value. + */ + public Boolean upgradeAllClusterNodes() { + return this.upgradeAllClusterNodes; + } + + /** + * Set the upgradeAllClusterNodes property: Whether upgrade all cluster nodes. + * + * @param upgradeAllClusterNodes the upgradeAllClusterNodes value to set. + * @return the ClusterPoolAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterPoolAksPatchUpgradeHistoryProperties withUpgradeAllClusterNodes(Boolean upgradeAllClusterNodes) { + this.upgradeAllClusterNodes = upgradeAllClusterNodes; + return this; + } + + /** + * Get the originalVersion property: Version before update. + * + * @return the originalVersion value. + */ + public String originalVersion() { + return this.originalVersion; + } + + /** + * Set the originalVersion property: Version before update. + * + * @param originalVersion the originalVersion value to set. + * @return the ClusterPoolAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterPoolAksPatchUpgradeHistoryProperties withOriginalVersion(String originalVersion) { + this.originalVersion = originalVersion; + return this; + } + + /** + * Get the newVersion property: Version going to update. + * + * @return the newVersion value. + */ + public String newVersion() { + return this.newVersion; + } + + /** + * Set the newVersion property: Version going to update. + * + * @param newVersion the newVersion value to set. + * @return the ClusterPoolAksPatchUpgradeHistoryProperties object itself. + */ + public ClusterPoolAksPatchUpgradeHistoryProperties withNewVersion(String newVersion) { + this.newVersion = newVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolAksPatchUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolAksPatchUpgradeHistoryProperties + withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeBooleanField("upgradeClusterPool", this.upgradeClusterPool); + jsonWriter.writeBooleanField("upgradeAllClusterNodes", this.upgradeAllClusterNodes); + jsonWriter.writeStringField("originalVersion", this.originalVersion); + jsonWriter.writeStringField("newVersion", this.newVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAksPatchUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAksPatchUpgradeHistoryProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolAksPatchUpgradeHistoryProperties. + */ + public static ClusterPoolAksPatchUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAksPatchUpgradeHistoryProperties deserializedClusterPoolAksPatchUpgradeHistoryProperties + = new ClusterPoolAksPatchUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.upgradeType + = ClusterPoolUpgradeHistoryType.fromString(reader.getString()); + } else if ("upgradeClusterPool".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.upgradeClusterPool + = reader.getNullable(JsonReader::getBoolean); + } else if ("upgradeAllClusterNodes".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.upgradeAllClusterNodes + = reader.getNullable(JsonReader::getBoolean); + } else if ("originalVersion".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.originalVersion = reader.getString(); + } else if ("newVersion".equals(fieldName)) { + deserializedClusterPoolAksPatchUpgradeHistoryProperties.newVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAksPatchUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchVersionUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchVersionUpgradeProperties.java index edf972fbd1dc8..a182dcf7bd7b8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchVersionUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAksPatchVersionUpgradeProperties.java @@ -5,27 +5,29 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster pool's AKS patch version. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("AKSPatchUpgrade") @Fluent public final class ClusterPoolAksPatchVersionUpgradeProperties extends ClusterPoolUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeType upgradeType = ClusterPoolUpgradeType.AKSPATCH_UPGRADE; + /* * whether upgrade cluster pool or not. If it's true, upgradeAllClusterNodes should be false. */ - @JsonProperty(value = "upgradeClusterPool") private Boolean upgradeClusterPool; /* * whether upgrade all clusters' nodes. If it's true, upgradeClusterPool should be false. */ - @JsonProperty(value = "upgradeAllClusterNodes") private Boolean upgradeAllClusterNodes; /* @@ -34,7 +36,6 @@ public final class ClusterPoolAksPatchVersionUpgradeProperties extends ClusterPo * upgradeClusterPool is false and upgradeAllClusterNodes is true, target version should be equal to AKS version of * cluster pool. */ - @JsonProperty(value = "targetAksVersion") private String targetAksVersion; /** @@ -43,6 +44,16 @@ public final class ClusterPoolAksPatchVersionUpgradeProperties extends ClusterPo public ClusterPoolAksPatchVersionUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Get the upgradeClusterPool property: whether upgrade cluster pool or not. If it's true, upgradeAllClusterNodes * should be false. @@ -122,4 +133,53 @@ public ClusterPoolAksPatchVersionUpgradeProperties withTargetAksVersion(String t public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeBooleanField("upgradeClusterPool", this.upgradeClusterPool); + jsonWriter.writeBooleanField("upgradeAllClusterNodes", this.upgradeAllClusterNodes); + jsonWriter.writeStringField("targetAksVersion", this.targetAksVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAksPatchVersionUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAksPatchVersionUpgradeProperties 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 ClusterPoolAksPatchVersionUpgradeProperties. + */ + public static ClusterPoolAksPatchVersionUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAksPatchVersionUpgradeProperties deserializedClusterPoolAksPatchVersionUpgradeProperties + = new ClusterPoolAksPatchVersionUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolAksPatchVersionUpgradeProperties.upgradeType + = ClusterPoolUpgradeType.fromString(reader.getString()); + } else if ("upgradeClusterPool".equals(fieldName)) { + deserializedClusterPoolAksPatchVersionUpgradeProperties.upgradeClusterPool + = reader.getNullable(JsonReader::getBoolean); + } else if ("upgradeAllClusterNodes".equals(fieldName)) { + deserializedClusterPoolAksPatchVersionUpgradeProperties.upgradeAllClusterNodes + = reader.getNullable(JsonReader::getBoolean); + } else if ("targetAksVersion".equals(fieldName)) { + deserializedClusterPoolAksPatchVersionUpgradeProperties.targetAksVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAksPatchVersionUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.java index 71402a73564bd..68fd297ea328c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.java @@ -5,33 +5,34 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool available AKS patch version upgrade. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("AKSPatchUpgrade") @Fluent public final class ClusterPoolAvailableUpgradeAksPatchUpgradeProperties extends ClusterPoolAvailableUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterPoolAvailableUpgradeType upgradeType = ClusterPoolAvailableUpgradeType.AKSPATCH_UPGRADE; + /* * Current AKS version. */ - @JsonProperty(value = "currentVersion") private String currentVersion; /* * Current AKS version's status: whether it is deprecated or supported */ - @JsonProperty(value = "currentVersionStatus") private CurrentClusterPoolAksVersionStatus currentVersionStatus; /* * Latest AKS patch version. */ - @JsonProperty(value = "latestVersion") private String latestVersion; /** @@ -40,6 +41,16 @@ public final class ClusterPoolAvailableUpgradeAksPatchUpgradeProperties extends public ClusterPoolAvailableUpgradeAksPatchUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Get the currentVersion property: Current AKS version. * @@ -110,4 +121,55 @@ public ClusterPoolAvailableUpgradeAksPatchUpgradeProperties withLatestVersion(St public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("currentVersion", this.currentVersion); + jsonWriter.writeStringField("currentVersionStatus", + this.currentVersionStatus == null ? null : this.currentVersionStatus.toString()); + jsonWriter.writeStringField("latestVersion", this.latestVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAvailableUpgradeAksPatchUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAvailableUpgradeAksPatchUpgradeProperties 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 ClusterPoolAvailableUpgradeAksPatchUpgradeProperties. + */ + public static ClusterPoolAvailableUpgradeAksPatchUpgradeProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAvailableUpgradeAksPatchUpgradeProperties deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties + = new ClusterPoolAvailableUpgradeAksPatchUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties.upgradeType + = ClusterPoolAvailableUpgradeType.fromString(reader.getString()); + } else if ("currentVersion".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties.currentVersion + = reader.getString(); + } else if ("currentVersionStatus".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties.currentVersionStatus + = CurrentClusterPoolAksVersionStatus.fromString(reader.getString()); + } else if ("latestVersion".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties.latestVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAvailableUpgradeAksPatchUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeList.java index 4a09f96e9ce15..0dd8d4f05fa2c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeList.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeList.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolAvailableUpgradeInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * collection of cluster pool available upgrade. */ @Fluent -public final class ClusterPoolAvailableUpgradeList { +public final class ClusterPoolAvailableUpgradeList implements JsonSerializable { /* * Collection of cluster pool available upgrade. */ - @JsonProperty(value = "value", required = true) private List value; /* * The Url of next result page. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public ClusterPoolAvailableUpgradeList withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model ClusterPoolAvailableUpgradeList")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ClusterPoolAvailableUpgradeList")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolAvailableUpgradeList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAvailableUpgradeList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAvailableUpgradeList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolAvailableUpgradeList. + */ + public static ClusterPoolAvailableUpgradeList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAvailableUpgradeList deserializedClusterPoolAvailableUpgradeList + = new ClusterPoolAvailableUpgradeList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterPoolAvailableUpgradeInner.fromJson(reader1)); + deserializedClusterPoolAvailableUpgradeList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAvailableUpgradeList; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.java index c23a7ff298215..bd3696eb1bfe1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.java @@ -5,21 +5,24 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool available node OS update. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("NodeOsUpgrade") @Fluent public final class ClusterPoolAvailableUpgradeNodeOsUpgradeProperties extends ClusterPoolAvailableUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterPoolAvailableUpgradeType upgradeType = ClusterPoolAvailableUpgradeType.NODE_OS_UPGRADE; + /* * The latest node OS version. */ - @JsonProperty(value = "latestVersion") private String latestVersion; /** @@ -28,6 +31,16 @@ public final class ClusterPoolAvailableUpgradeNodeOsUpgradeProperties extends Cl public ClusterPoolAvailableUpgradeNodeOsUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Get the latestVersion property: The latest node OS version. * @@ -57,4 +70,46 @@ public ClusterPoolAvailableUpgradeNodeOsUpgradeProperties withLatestVersion(Stri public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("latestVersion", this.latestVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAvailableUpgradeNodeOsUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAvailableUpgradeNodeOsUpgradeProperties 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 ClusterPoolAvailableUpgradeNodeOsUpgradeProperties. + */ + public static ClusterPoolAvailableUpgradeNodeOsUpgradeProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAvailableUpgradeNodeOsUpgradeProperties deserializedClusterPoolAvailableUpgradeNodeOsUpgradeProperties + = new ClusterPoolAvailableUpgradeNodeOsUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeNodeOsUpgradeProperties.upgradeType + = ClusterPoolAvailableUpgradeType.fromString(reader.getString()); + } else if ("latestVersion".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeNodeOsUpgradeProperties.latestVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAvailableUpgradeNodeOsUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeProperties.java index 9489e214d6d31..7f0369e786c5d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeProperties.java @@ -5,30 +5,38 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool available upgrade properties. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "upgradeType", - defaultImpl = ClusterPoolAvailableUpgradeProperties.class) -@JsonTypeName("ClusterPoolAvailableUpgradeProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKSPatchUpgrade", value = ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.class), - @JsonSubTypes.Type(name = "NodeOsUpgrade", value = ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.class) }) @Immutable -public class ClusterPoolAvailableUpgradeProperties { +public class ClusterPoolAvailableUpgradeProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterPoolAvailableUpgradeType upgradeType + = ClusterPoolAvailableUpgradeType.fromString("ClusterPoolAvailableUpgradeProperties"); + /** * Creates an instance of ClusterPoolAvailableUpgradeProperties class. */ public ClusterPoolAvailableUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterPoolAvailableUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -36,4 +44,69 @@ public ClusterPoolAvailableUpgradeProperties() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolAvailableUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolAvailableUpgradeProperties 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 ClusterPoolAvailableUpgradeProperties. + */ + public static ClusterPoolAvailableUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("NodeOsUpgrade".equals(discriminatorValue)) { + return ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterPoolAvailableUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolAvailableUpgradeProperties deserializedClusterPoolAvailableUpgradeProperties + = new ClusterPoolAvailableUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolAvailableUpgradeProperties.upgradeType + = ClusterPoolAvailableUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolAvailableUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeType.java index 0f678c547d0f3..0b023ee4f770d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolAvailableUpgradeType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ClusterPoolAvailableUpgradeType() { * @param name a name to look for. * @return the corresponding ClusterPoolAvailableUpgradeType. */ - @JsonCreator public static ClusterPoolAvailableUpgradeType fromString(String name) { return fromString(name, ClusterPoolAvailableUpgradeType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolComputeProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolComputeProfile.java index fa5471f694544..902b3182c90b7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolComputeProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolComputeProfile.java @@ -6,25 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * Cluster pool compute profile. */ @Fluent -public class ClusterPoolComputeProfile { +public class ClusterPoolComputeProfile implements JsonSerializable { /* * The virtual machine SKU. */ - @JsonProperty(value = "vmSize", required = true) private String vmSize; /* * The number of virtual machines. */ - @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) private Integer count; + /* + * The list of Availability zones to use for AKS VMSS nodes. + */ + private List availabilityZones; + /** * Creates an instance of ClusterPoolComputeProfile class. */ @@ -60,6 +68,37 @@ public Integer count() { return this.count; } + /** + * Set the count property: The number of virtual machines. + * + * @param count the count value to set. + * @return the ClusterPoolComputeProfile object itself. + */ + ClusterPoolComputeProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the availabilityZones property: The list of Availability zones to use for AKS VMSS nodes. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for AKS VMSS nodes. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ClusterPoolComputeProfile object itself. + */ + public ClusterPoolComputeProfile withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + /** * Validates the instance. * @@ -67,10 +106,55 @@ public Integer count() { */ public void validate() { if (vmSize() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vmSize in model ClusterPoolComputeProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSize in model ClusterPoolComputeProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolComputeProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolComputeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolComputeProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolComputeProfile. + */ + public static ClusterPoolComputeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolComputeProfile deserializedClusterPoolComputeProfile = new ClusterPoolComputeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedClusterPoolComputeProfile.vmSize = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedClusterPoolComputeProfile.count = reader.getNullable(JsonReader::getInt); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterPoolComputeProfile.availabilityZones = availabilityZones; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolComputeProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolListResult.java index fa066fa77d71a..7bba7a6949d2c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The list cluster pools operation response. */ @Fluent -public final class ClusterPoolListResult { +public final class ClusterPoolListResult implements JsonSerializable { /* * The list of cluster pools. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolListResult 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 ClusterPoolListResult. + */ + public static ClusterPoolListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolListResult deserializedClusterPoolListResult = new ClusterPoolListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterPoolInner.fromJson(reader1)); + deserializedClusterPoolListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterPoolListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolLogAnalyticsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolLogAnalyticsProfile.java index c071788b9c4fd..2f5d5d65b5f05 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolLogAnalyticsProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolLogAnalyticsProfile.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool log analytics profile used to enable or disable OMS agent for AKS cluster. */ @Fluent -public class ClusterPoolLogAnalyticsProfile { +public class ClusterPoolLogAnalyticsProfile implements JsonSerializable { /* * True if log analytics is enabled for cluster pool, otherwise false. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * Log analytics workspace to associate with the OMS agent. */ - @JsonProperty(value = "workspaceId") private String workspaceId; /** @@ -77,4 +79,45 @@ public ClusterPoolLogAnalyticsProfile withWorkspaceId(String workspaceId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolLogAnalyticsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolLogAnalyticsProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolLogAnalyticsProfile. + */ + public static ClusterPoolLogAnalyticsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolLogAnalyticsProfile deserializedClusterPoolLogAnalyticsProfile + = new ClusterPoolLogAnalyticsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedClusterPoolLogAnalyticsProfile.enabled = reader.getBoolean(); + } else if ("workspaceId".equals(fieldName)) { + deserializedClusterPoolLogAnalyticsProfile.workspaceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolLogAnalyticsProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNetworkProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNetworkProfile.java index 6a934d56f6037..16fea3adbaa6c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNetworkProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNetworkProfile.java @@ -6,43 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster pool networking configuration. */ @Fluent -public class ClusterPoolNetworkProfile { +public class ClusterPoolNetworkProfile implements JsonSerializable { /* * Cluster pool subnet resource id. */ - @JsonProperty(value = "subnetId", required = true) private String subnetId; /* - * The outbound (egress) routing method. - * * This can only be set at cluster pool creation time and cannot be changed later. */ - @JsonProperty(value = "outboundType") private OutboundType outboundType; /* - * ClusterPool is based on AKS cluster. AKS cluster exposes the API server to public internet by default. If you - * set this property to true, a private AKS cluster will be created, and it will use private apiserver, which is - * not exposed to public internet. + * ClusterPool is based on AKS cluster. AKS cluster exposes the API server to public internet by default. If you set + * this property to true, a private AKS cluster will be created, and it will use private apiserver, which is not + * exposed to public internet. */ - @JsonProperty(value = "enablePrivateApiServer") private Boolean enablePrivateApiServer; /* - * The IP ranges authorized to access the AKS API server. - * * IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with private AKS * clusters. So you cannot set enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + * Currently, this property is not supported and please don't use it. */ - @JsonProperty(value = "apiServerAuthorizedIpRanges") private List apiServerAuthorizedIpRanges; /** @@ -72,9 +69,7 @@ public ClusterPoolNetworkProfile withSubnetId(String subnetId) { } /** - * Get the outboundType property: The outbound (egress) routing method. - * - * This can only be set at cluster pool creation time and cannot be changed later. + * Get the outboundType property: This can only be set at cluster pool creation time and cannot be changed later. * * @return the outboundType value. */ @@ -83,9 +78,7 @@ public OutboundType outboundType() { } /** - * Set the outboundType property: The outbound (egress) routing method. - * - * This can only be set at cluster pool creation time and cannot be changed later. + * Set the outboundType property: This can only be set at cluster pool creation time and cannot be changed later. * * @param outboundType the outboundType value to set. * @return the ClusterPoolNetworkProfile object itself. @@ -120,10 +113,9 @@ public ClusterPoolNetworkProfile withEnablePrivateApiServer(Boolean enablePrivat } /** - * Get the apiServerAuthorizedIpRanges property: The IP ranges authorized to access the AKS API server. - * - * IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with private AKS - * clusters. So you cannot set enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + * Get the apiServerAuthorizedIpRanges property: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + * This feature is not compatible with private AKS clusters. So you cannot set enablePrivateApiServer to true and + * apiServerAuthorizedIpRanges at the same time. Currently, this property is not supported and please don't use it. * * @return the apiServerAuthorizedIpRanges value. */ @@ -132,10 +124,9 @@ public List apiServerAuthorizedIpRanges() { } /** - * Set the apiServerAuthorizedIpRanges property: The IP ranges authorized to access the AKS API server. - * - * IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with private AKS - * clusters. So you cannot set enablePrivateApiServer to true and apiServerAuthorizedIpRanges at the same time. + * Set the apiServerAuthorizedIpRanges property: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + * This feature is not compatible with private AKS clusters. So you cannot set enablePrivateApiServer to true and + * apiServerAuthorizedIpRanges at the same time. Currently, this property is not supported and please don't use it. * * @param apiServerAuthorizedIpRanges the apiServerAuthorizedIpRanges value to set. * @return the ClusterPoolNetworkProfile object itself. @@ -152,10 +143,60 @@ public ClusterPoolNetworkProfile withApiServerAuthorizedIpRanges(List ap */ public void validate() { if (subnetId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property subnetId in model ClusterPoolNetworkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subnetId in model ClusterPoolNetworkProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolNetworkProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("outboundType", this.outboundType == null ? null : this.outboundType.toString()); + jsonWriter.writeBooleanField("enablePrivateApiServer", this.enablePrivateApiServer); + jsonWriter.writeArrayField("apiServerAuthorizedIpRanges", this.apiServerAuthorizedIpRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolNetworkProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolNetworkProfile. + */ + public static ClusterPoolNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolNetworkProfile deserializedClusterPoolNetworkProfile = new ClusterPoolNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedClusterPoolNetworkProfile.subnetId = reader.getString(); + } else if ("outboundType".equals(fieldName)) { + deserializedClusterPoolNetworkProfile.outboundType = OutboundType.fromString(reader.getString()); + } else if ("enablePrivateApiServer".equals(fieldName)) { + deserializedClusterPoolNetworkProfile.enablePrivateApiServer + = reader.getNullable(JsonReader::getBoolean); + } else if ("apiServerAuthorizedIpRanges".equals(fieldName)) { + List apiServerAuthorizedIpRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterPoolNetworkProfile.apiServerAuthorizedIpRanges = apiServerAuthorizedIpRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolNetworkProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsImageUpdateProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsImageUpdateProperties.java index 260229fe983d7..a72f80fe4266e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsImageUpdateProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsImageUpdateProperties.java @@ -5,22 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster pool's AKS patch version. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "upgradeType") -@JsonTypeName("NodeOsUpgrade") @Immutable public final class ClusterPoolNodeOsImageUpdateProperties extends ClusterPoolUpgradeProperties { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeType upgradeType = ClusterPoolUpgradeType.NODE_OS_UPGRADE; + /** * Creates an instance of ClusterPoolNodeOsImageUpdateProperties class. */ public ClusterPoolNodeOsImageUpdateProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -30,4 +45,42 @@ public ClusterPoolNodeOsImageUpdateProperties() { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolNodeOsImageUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolNodeOsImageUpdateProperties 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 ClusterPoolNodeOsImageUpdateProperties. + */ + public static ClusterPoolNodeOsImageUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolNodeOsImageUpdateProperties deserializedClusterPoolNodeOsImageUpdateProperties + = new ClusterPoolNodeOsImageUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolNodeOsImageUpdateProperties.upgradeType + = ClusterPoolUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolNodeOsImageUpdateProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..107fdbaaaa47f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolNodeOsUpgradeHistoryProperties.java @@ -0,0 +1,141 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster pool node os upgrade history properties. + */ +@Fluent +public final class ClusterPoolNodeOsUpgradeHistoryProperties extends ClusterPoolUpgradeHistoryProperties { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeHistoryType upgradeType = ClusterPoolUpgradeHistoryType.NODE_OS_UPGRADE; + + /* + * New Node Os version. + */ + private String newNodeOs; + + /** + * Creates an instance of ClusterPoolNodeOsUpgradeHistoryProperties class. + */ + public ClusterPoolNodeOsUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + @Override + public ClusterPoolUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the newNodeOs property: New Node Os version. + * + * @return the newNodeOs value. + */ + public String newNodeOs() { + return this.newNodeOs; + } + + /** + * Set the newNodeOs property: New Node Os version. + * + * @param newNodeOs the newNodeOs value to set. + * @return the ClusterPoolNodeOsUpgradeHistoryProperties object itself. + */ + public ClusterPoolNodeOsUpgradeHistoryProperties withNewNodeOs(String newNodeOs) { + this.newNodeOs = newNodeOs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolNodeOsUpgradeHistoryProperties withUtcTime(String utcTime) { + super.withUtcTime(utcTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolNodeOsUpgradeHistoryProperties + withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType upgradeResult) { + super.withUpgradeResult(upgradeResult); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", utcTime()); + jsonWriter.writeStringField("upgradeResult", upgradeResult() == null ? null : upgradeResult().toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + jsonWriter.writeStringField("newNodeOs", this.newNodeOs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolNodeOsUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolNodeOsUpgradeHistoryProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolNodeOsUpgradeHistoryProperties. + */ + public static ClusterPoolNodeOsUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolNodeOsUpgradeHistoryProperties deserializedClusterPoolNodeOsUpgradeHistoryProperties + = new ClusterPoolNodeOsUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterPoolNodeOsUpgradeHistoryProperties.withUtcTime(reader.getString()); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterPoolNodeOsUpgradeHistoryProperties + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.fromString(reader.getString())); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolNodeOsUpgradeHistoryProperties.upgradeType + = ClusterPoolUpgradeHistoryType.fromString(reader.getString()); + } else if ("newNodeOs".equals(fieldName)) { + deserializedClusterPoolNodeOsUpgradeHistoryProperties.newNodeOs = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolNodeOsUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolProfile.java index 3bdea7f8d7579..87b0639fca5e0 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolProfile.java @@ -6,19 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool profile. */ @Fluent -public class ClusterPoolProfile { +public class ClusterPoolProfile implements JsonSerializable { /* * Cluster pool version is a 2-part version. */ - @JsonProperty(value = "clusterPoolVersion", required = true) private String clusterPoolVersion; + /* + * Gets or sets the IP tag for the public IPs created along with the HDInsightOnAks ClusterPools and Clusters. + */ + private IpTag publicIpTag; + /** * Creates an instance of ClusterPoolProfile class. */ @@ -45,6 +53,28 @@ public ClusterPoolProfile withClusterPoolVersion(String clusterPoolVersion) { return this; } + /** + * Get the publicIpTag property: Gets or sets the IP tag for the public IPs created along with the HDInsightOnAks + * ClusterPools and Clusters. + * + * @return the publicIpTag value. + */ + public IpTag publicIpTag() { + return this.publicIpTag; + } + + /** + * Set the publicIpTag property: Gets or sets the IP tag for the public IPs created along with the HDInsightOnAks + * ClusterPools and Clusters. + * + * @param publicIpTag the publicIpTag value to set. + * @return the ClusterPoolProfile object itself. + */ + public ClusterPoolProfile withPublicIpTag(IpTag publicIpTag) { + this.publicIpTag = publicIpTag; + return this; + } + /** * Validates the instance. * @@ -52,10 +82,54 @@ public ClusterPoolProfile withClusterPoolVersion(String clusterPoolVersion) { */ public void validate() { if (clusterPoolVersion() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property clusterPoolVersion in model ClusterPoolProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clusterPoolVersion in model ClusterPoolProfile")); + } + if (publicIpTag() != null) { + publicIpTag().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterPoolVersion", this.clusterPoolVersion); + jsonWriter.writeJsonField("publicIpTag", this.publicIpTag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolProfile. + */ + public static ClusterPoolProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolProfile deserializedClusterPoolProfile = new ClusterPoolProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterPoolVersion".equals(fieldName)) { + deserializedClusterPoolProfile.clusterPoolVersion = reader.getString(); + } else if ("publicIpTag".equals(fieldName)) { + deserializedClusterPoolProfile.publicIpTag = IpTag.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourceProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourceProperties.java index 19af964acef54..05b047ec6eec7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourceProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourceProperties.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool resource properties. */ @Fluent -public final class ClusterPoolResourceProperties { +public final class ClusterPoolResourceProperties implements JsonSerializable { /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStatus provisioningState; /* * A unique id generated by the RP to identify the resource. */ - @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY) private String deploymentId; /* @@ -30,7 +32,6 @@ public final class ClusterPoolResourceProperties { * to generate aksManagedResourceGroupName by pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. * Please make sure it meets resource group name restriction. */ - @JsonProperty(value = "managedResourceGroupName") private String managedResourceGroupName; /* @@ -38,43 +39,36 @@ public final class ClusterPoolResourceProperties { * is generated by cluster pool name and managed resource group name by pattern: * MC_{managedResourceGroupName}_{clusterPoolName}_{region} */ - @JsonProperty(value = "aksManagedResourceGroupName", access = JsonProperty.Access.WRITE_ONLY) private String aksManagedResourceGroupName; /* * CLuster pool profile. */ - @JsonProperty(value = "clusterPoolProfile") private ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile; /* * CLuster pool compute profile. */ - @JsonProperty(value = "computeProfile", required = true) private ClusterPoolResourcePropertiesComputeProfile computeProfile; /* * Properties of underlying AKS cluster. */ - @JsonProperty(value = "aksClusterProfile", access = JsonProperty.Access.WRITE_ONLY) private ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile; /* * Cluster pool network profile. */ - @JsonProperty(value = "networkProfile") private ClusterPoolResourcePropertiesNetworkProfile networkProfile; /* * Cluster pool log analytics profile to enable OMS agent for AKS cluster. */ - @JsonProperty(value = "logAnalyticsProfile") private ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile; /* * Business status of the resource. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; /** @@ -250,8 +244,9 @@ public void validate() { clusterPoolProfile().validate(); } if (computeProfile() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property computeProfile in model ClusterPoolResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeProfile in model ClusterPoolResourceProperties")); } else { computeProfile().validate(); } @@ -267,4 +262,70 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("computeProfile", this.computeProfile); + jsonWriter.writeStringField("managedResourceGroupName", this.managedResourceGroupName); + jsonWriter.writeJsonField("clusterPoolProfile", this.clusterPoolProfile); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("logAnalyticsProfile", this.logAnalyticsProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolResourceProperties. + */ + public static ClusterPoolResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourceProperties deserializedClusterPoolResourceProperties + = new ClusterPoolResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeProfile".equals(fieldName)) { + deserializedClusterPoolResourceProperties.computeProfile + = ClusterPoolResourcePropertiesComputeProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterPoolResourceProperties.provisioningState + = ProvisioningStatus.fromString(reader.getString()); + } else if ("deploymentId".equals(fieldName)) { + deserializedClusterPoolResourceProperties.deploymentId = reader.getString(); + } else if ("managedResourceGroupName".equals(fieldName)) { + deserializedClusterPoolResourceProperties.managedResourceGroupName = reader.getString(); + } else if ("aksManagedResourceGroupName".equals(fieldName)) { + deserializedClusterPoolResourceProperties.aksManagedResourceGroupName = reader.getString(); + } else if ("clusterPoolProfile".equals(fieldName)) { + deserializedClusterPoolResourceProperties.clusterPoolProfile + = ClusterPoolResourcePropertiesClusterPoolProfile.fromJson(reader); + } else if ("aksClusterProfile".equals(fieldName)) { + deserializedClusterPoolResourceProperties.aksClusterProfile + = ClusterPoolResourcePropertiesAksClusterProfile.fromJson(reader); + } else if ("networkProfile".equals(fieldName)) { + deserializedClusterPoolResourceProperties.networkProfile + = ClusterPoolResourcePropertiesNetworkProfile.fromJson(reader); + } else if ("logAnalyticsProfile".equals(fieldName)) { + deserializedClusterPoolResourceProperties.logAnalyticsProfile + = ClusterPoolResourcePropertiesLogAnalyticsProfile.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedClusterPoolResourceProperties.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourceProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesAksClusterProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesAksClusterProfile.java index e96e116036627..7f662fbee7506 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesAksClusterProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesAksClusterProfile.java @@ -5,18 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of underlying AKS cluster. */ @Fluent public final class ClusterPoolResourcePropertiesAksClusterProfile extends AksClusterProfile { + /* + * AKS control plane and default node pool version of this ClusterPool + */ + private String aksVersion; + /** * Creates an instance of ClusterPoolResourcePropertiesAksClusterProfile class. */ public ClusterPoolResourcePropertiesAksClusterProfile() { } + /** + * Get the aksVersion property: AKS control plane and default node pool version of this ClusterPool. + * + * @return the aksVersion value. + */ + @Override + public String aksVersion() { + return this.aksVersion; + } + /** * {@inheritDoc} */ @@ -45,4 +64,48 @@ public ClusterPoolResourcePropertiesAksClusterProfile withAksClusterAgentPoolIde public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aksClusterResourceId", aksClusterResourceId()); + jsonWriter.writeJsonField("aksClusterAgentPoolIdentityProfile", aksClusterAgentPoolIdentityProfile()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourcePropertiesAksClusterProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourcePropertiesAksClusterProfile 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 ClusterPoolResourcePropertiesAksClusterProfile. + */ + public static ClusterPoolResourcePropertiesAksClusterProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourcePropertiesAksClusterProfile deserializedClusterPoolResourcePropertiesAksClusterProfile + = new ClusterPoolResourcePropertiesAksClusterProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aksClusterResourceId".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesAksClusterProfile + .withAksClusterResourceId(reader.getString()); + } else if ("aksClusterAgentPoolIdentityProfile".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesAksClusterProfile.withAksClusterAgentPoolIdentityProfile( + AksClusterProfileAksClusterAgentPoolIdentityProfile.fromJson(reader)); + } else if ("aksVersion".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesAksClusterProfile.aksVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourcePropertiesAksClusterProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesClusterPoolProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesClusterPoolProfile.java index d9427758564ff..d3a20985bf0b9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesClusterPoolProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesClusterPoolProfile.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * CLuster pool profile. @@ -26,6 +30,15 @@ public ClusterPoolResourcePropertiesClusterPoolProfile withClusterPoolVersion(St return this; } + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolResourcePropertiesClusterPoolProfile withPublicIpTag(IpTag publicIpTag) { + super.withPublicIpTag(publicIpTag); + return this; + } + /** * Validates the instance. * @@ -35,4 +48,46 @@ public ClusterPoolResourcePropertiesClusterPoolProfile withClusterPoolVersion(St public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterPoolVersion", clusterPoolVersion()); + jsonWriter.writeJsonField("publicIpTag", publicIpTag()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourcePropertiesClusterPoolProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourcePropertiesClusterPoolProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolResourcePropertiesClusterPoolProfile. + */ + public static ClusterPoolResourcePropertiesClusterPoolProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourcePropertiesClusterPoolProfile deserializedClusterPoolResourcePropertiesClusterPoolProfile + = new ClusterPoolResourcePropertiesClusterPoolProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterPoolVersion".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesClusterPoolProfile + .withClusterPoolVersion(reader.getString()); + } else if ("publicIpTag".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesClusterPoolProfile.withPublicIpTag(IpTag.fromJson(reader)); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourcePropertiesClusterPoolProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesComputeProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesComputeProfile.java index baf505e9af649..eac314a9a3da6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesComputeProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesComputeProfile.java @@ -5,18 +5,38 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * CLuster pool compute profile. */ @Fluent public final class ClusterPoolResourcePropertiesComputeProfile extends ClusterPoolComputeProfile { + /* + * The number of virtual machines. + */ + private Integer count; + /** * Creates an instance of ClusterPoolResourcePropertiesComputeProfile class. */ public ClusterPoolResourcePropertiesComputeProfile() { } + /** + * Get the count property: The number of virtual machines. + * + * @return the count value. + */ + @Override + public Integer count() { + return this.count; + } + /** * {@inheritDoc} */ @@ -26,6 +46,15 @@ public ClusterPoolResourcePropertiesComputeProfile withVmSize(String vmSize) { return this; } + /** + * {@inheritDoc} + */ + @Override + public ClusterPoolResourcePropertiesComputeProfile withAvailabilityZones(List availabilityZones) { + super.withAvailabilityZones(availabilityZones); + return this; + } + /** * Validates the instance. * @@ -35,4 +64,50 @@ public ClusterPoolResourcePropertiesComputeProfile withVmSize(String vmSize) { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", vmSize()); + jsonWriter.writeArrayField("availabilityZones", availabilityZones(), + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourcePropertiesComputeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourcePropertiesComputeProfile if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolResourcePropertiesComputeProfile. + */ + public static ClusterPoolResourcePropertiesComputeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourcePropertiesComputeProfile deserializedClusterPoolResourcePropertiesComputeProfile + = new ClusterPoolResourcePropertiesComputeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesComputeProfile.withVmSize(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesComputeProfile.count + = reader.getNullable(JsonReader::getInt); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterPoolResourcePropertiesComputeProfile.withAvailabilityZones(availabilityZones); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourcePropertiesComputeProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java index c10da9fdd989b..fb1e25006d4c8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool log analytics profile to enable OMS agent for AKS cluster. @@ -44,4 +48,45 @@ public ClusterPoolResourcePropertiesLogAnalyticsProfile withWorkspaceId(String w public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", enabled()); + jsonWriter.writeStringField("workspaceId", workspaceId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourcePropertiesLogAnalyticsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourcePropertiesLogAnalyticsProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolResourcePropertiesLogAnalyticsProfile. + */ + public static ClusterPoolResourcePropertiesLogAnalyticsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourcePropertiesLogAnalyticsProfile deserializedClusterPoolResourcePropertiesLogAnalyticsProfile + = new ClusterPoolResourcePropertiesLogAnalyticsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesLogAnalyticsProfile.withEnabled(reader.getBoolean()); + } else if ("workspaceId".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesLogAnalyticsProfile.withWorkspaceId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourcePropertiesLogAnalyticsProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesNetworkProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesNetworkProfile.java index 0818eb9fb0720..d2614cc53c75a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesNetworkProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolResourcePropertiesNetworkProfile.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -64,4 +68,56 @@ public ClusterPoolResourcePropertiesNetworkProfile withEnablePrivateApiServer(Bo public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", subnetId()); + jsonWriter.writeStringField("outboundType", outboundType() == null ? null : outboundType().toString()); + jsonWriter.writeBooleanField("enablePrivateApiServer", enablePrivateApiServer()); + jsonWriter.writeArrayField("apiServerAuthorizedIpRanges", apiServerAuthorizedIpRanges(), + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolResourcePropertiesNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolResourcePropertiesNetworkProfile if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolResourcePropertiesNetworkProfile. + */ + public static ClusterPoolResourcePropertiesNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolResourcePropertiesNetworkProfile deserializedClusterPoolResourcePropertiesNetworkProfile + = new ClusterPoolResourcePropertiesNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesNetworkProfile.withSubnetId(reader.getString()); + } else if ("outboundType".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesNetworkProfile + .withOutboundType(OutboundType.fromString(reader.getString())); + } else if ("enablePrivateApiServer".equals(fieldName)) { + deserializedClusterPoolResourcePropertiesNetworkProfile + .withEnablePrivateApiServer(reader.getNullable(JsonReader::getBoolean)); + } else if ("apiServerAuthorizedIpRanges".equals(fieldName)) { + List apiServerAuthorizedIpRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterPoolResourcePropertiesNetworkProfile + .withApiServerAuthorizedIpRanges(apiServerAuthorizedIpRanges); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolResourcePropertiesNetworkProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgrade.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgrade.java index dc7cd829b9692..56e67b73425eb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgrade.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgrade.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster Pool Upgrade. */ @Fluent -public final class ClusterPoolUpgrade { +public final class ClusterPoolUpgrade implements JsonSerializable { /* * Properties of upgrading cluster pool. */ - @JsonProperty(value = "properties", required = true) private ClusterPoolUpgradeProperties properties; /** @@ -52,12 +55,49 @@ public ClusterPoolUpgrade withProperties(ClusterPoolUpgradeProperties properties */ public void validate() { if (properties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ClusterPoolUpgrade")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ClusterPoolUpgrade")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolUpgrade.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolUpgrade from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolUpgrade if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolUpgrade. + */ + public static ClusterPoolUpgrade fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolUpgrade deserializedClusterPoolUpgrade = new ClusterPoolUpgrade(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterPoolUpgrade.properties = ClusterPoolUpgradeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolUpgrade; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistories.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistories.java new file mode 100644 index 0000000000000..003ce6e7906b4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistories.java @@ -0,0 +1,38 @@ +// 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.containers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ClusterPoolUpgradeHistories. + */ +public interface ClusterPoolUpgradeHistories { + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName); + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool upgrade history as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistory.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistory.java new file mode 100644 index 0000000000000..e1ff4c92016a0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistory.java @@ -0,0 +1,56 @@ +// 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.containers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; + +/** + * An immutable client-side representation of ClusterPoolUpgradeHistory. + */ +public interface ClusterPoolUpgradeHistory { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of cluster pool upgrade history. + * + * @return the properties value. + */ + ClusterPoolUpgradeHistoryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner + * object. + * + * @return the inner object. + */ + ClusterPoolUpgradeHistoryInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryListResult.java new file mode 100644 index 0000000000000..c78dcccafdb6d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryListResult.java @@ -0,0 +1,126 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import java.io.IOException; +import java.util.List; + +/** + * Represents a list of cluster pool upgrade history. + */ +@Fluent +public final class ClusterPoolUpgradeHistoryListResult + implements JsonSerializable { + /* + * The list of cluster pool upgrade history. + */ + private List value; + + /* + * The link (url) to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ClusterPoolUpgradeHistoryListResult class. + */ + public ClusterPoolUpgradeHistoryListResult() { + } + + /** + * Get the value property: The list of cluster pool upgrade history. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster pool upgrade history. + * + * @param value the value value to set. + * @return the ClusterPoolUpgradeHistoryListResult object itself. + */ + public ClusterPoolUpgradeHistoryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ClusterPoolUpgradeHistoryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolUpgradeHistoryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolUpgradeHistoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolUpgradeHistoryListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolUpgradeHistoryListResult. + */ + public static ClusterPoolUpgradeHistoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolUpgradeHistoryListResult deserializedClusterPoolUpgradeHistoryListResult + = new ClusterPoolUpgradeHistoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterPoolUpgradeHistoryInner.fromJson(reader1)); + deserializedClusterPoolUpgradeHistoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolUpgradeHistoryListResult; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..24c6851743b80 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryProperties.java @@ -0,0 +1,184 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of cluster pool upgrade history. + */ +@Fluent +public class ClusterPoolUpgradeHistoryProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeHistoryType upgradeType + = ClusterPoolUpgradeHistoryType.fromString("ClusterPoolUpgradeHistoryProperties"); + + /* + * Time when created this upgrade history. + */ + private String utcTime; + + /* + * Result of this upgrade. + */ + private ClusterPoolUpgradeHistoryUpgradeResultType upgradeResult; + + /** + * Creates an instance of ClusterPoolUpgradeHistoryProperties class. + */ + public ClusterPoolUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterPoolUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the utcTime property: Time when created this upgrade history. + * + * @return the utcTime value. + */ + public String utcTime() { + return this.utcTime; + } + + /** + * Set the utcTime property: Time when created this upgrade history. + * + * @param utcTime the utcTime value to set. + * @return the ClusterPoolUpgradeHistoryProperties object itself. + */ + public ClusterPoolUpgradeHistoryProperties withUtcTime(String utcTime) { + this.utcTime = utcTime; + return this; + } + + /** + * Get the upgradeResult property: Result of this upgrade. + * + * @return the upgradeResult value. + */ + public ClusterPoolUpgradeHistoryUpgradeResultType upgradeResult() { + return this.upgradeResult; + } + + /** + * Set the upgradeResult property: Result of this upgrade. + * + * @param upgradeResult the upgradeResult value to set. + * @return the ClusterPoolUpgradeHistoryProperties object itself. + */ + public ClusterPoolUpgradeHistoryProperties + withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType upgradeResult) { + this.upgradeResult = upgradeResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (utcTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property utcTime in model ClusterPoolUpgradeHistoryProperties")); + } + if (upgradeResult() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property upgradeResult in model ClusterPoolUpgradeHistoryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolUpgradeHistoryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", this.utcTime); + jsonWriter.writeStringField("upgradeResult", this.upgradeResult == null ? null : this.upgradeResult.toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolUpgradeHistoryProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPoolUpgradeHistoryProperties. + */ + public static ClusterPoolUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("NodeOsUpgrade".equals(discriminatorValue)) { + return ClusterPoolNodeOsUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterPoolAksPatchUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterPoolUpgradeHistoryProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolUpgradeHistoryProperties deserializedClusterPoolUpgradeHistoryProperties + = new ClusterPoolUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryProperties.utcTime = reader.getString(); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryProperties.upgradeResult + = ClusterPoolUpgradeHistoryUpgradeResultType.fromString(reader.getString()); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolUpgradeHistoryProperties.upgradeType + = ClusterPoolUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryType.java new file mode 100644 index 0000000000000..8d9f3af4f7a01 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of upgrade. + */ +public final class ClusterPoolUpgradeHistoryType extends ExpandableStringEnum { + /** + * Static value AKSPatchUpgrade for ClusterPoolUpgradeHistoryType. + */ + public static final ClusterPoolUpgradeHistoryType AKSPATCH_UPGRADE = fromString("AKSPatchUpgrade"); + + /** + * Static value NodeOsUpgrade for ClusterPoolUpgradeHistoryType. + */ + public static final ClusterPoolUpgradeHistoryType NODE_OS_UPGRADE = fromString("NodeOsUpgrade"); + + /** + * Creates a new instance of ClusterPoolUpgradeHistoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterPoolUpgradeHistoryType() { + } + + /** + * Creates or finds a ClusterPoolUpgradeHistoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterPoolUpgradeHistoryType. + */ + public static ClusterPoolUpgradeHistoryType fromString(String name) { + return fromString(name, ClusterPoolUpgradeHistoryType.class); + } + + /** + * Gets known ClusterPoolUpgradeHistoryType values. + * + * @return known ClusterPoolUpgradeHistoryType values. + */ + public static Collection values() { + return values(ClusterPoolUpgradeHistoryType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryUpgradeResultType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryUpgradeResultType.java new file mode 100644 index 0000000000000..1e4f0ec9e8e58 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeHistoryUpgradeResultType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Result of this upgrade. + */ +public final class ClusterPoolUpgradeHistoryUpgradeResultType + extends ExpandableStringEnum { + /** + * Static value Succeed for ClusterPoolUpgradeHistoryUpgradeResultType. + */ + public static final ClusterPoolUpgradeHistoryUpgradeResultType SUCCEED = fromString("Succeed"); + + /** + * Static value Failed for ClusterPoolUpgradeHistoryUpgradeResultType. + */ + public static final ClusterPoolUpgradeHistoryUpgradeResultType FAILED = fromString("Failed"); + + /** + * Creates a new instance of ClusterPoolUpgradeHistoryUpgradeResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterPoolUpgradeHistoryUpgradeResultType() { + } + + /** + * Creates or finds a ClusterPoolUpgradeHistoryUpgradeResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterPoolUpgradeHistoryUpgradeResultType. + */ + public static ClusterPoolUpgradeHistoryUpgradeResultType fromString(String name) { + return fromString(name, ClusterPoolUpgradeHistoryUpgradeResultType.class); + } + + /** + * Gets known ClusterPoolUpgradeHistoryUpgradeResultType values. + * + * @return known ClusterPoolUpgradeHistoryUpgradeResultType values. + */ + public static Collection values() { + return values(ClusterPoolUpgradeHistoryUpgradeResultType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeProperties.java index 9d6dd3bbe8945..21345e492c550 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeProperties.java @@ -5,30 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster pool. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "upgradeType", - defaultImpl = ClusterPoolUpgradeProperties.class) -@JsonTypeName("ClusterPoolUpgradeProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKSPatchUpgrade", value = ClusterPoolAksPatchVersionUpgradeProperties.class), - @JsonSubTypes.Type(name = "NodeOsUpgrade", value = ClusterPoolNodeOsImageUpdateProperties.class) }) @Immutable -public class ClusterPoolUpgradeProperties { +public class ClusterPoolUpgradeProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterPoolUpgradeType upgradeType = ClusterPoolUpgradeType.fromString("ClusterPoolUpgradeProperties"); + /** * Creates an instance of ClusterPoolUpgradeProperties class. */ public ClusterPoolUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterPoolUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -36,4 +43,68 @@ public ClusterPoolUpgradeProperties() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolUpgradeProperties 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 ClusterPoolUpgradeProperties. + */ + public static ClusterPoolUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterPoolAksPatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("NodeOsUpgrade".equals(discriminatorValue)) { + return ClusterPoolNodeOsImageUpdateProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterPoolUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolUpgradeProperties deserializedClusterPoolUpgradeProperties = new ClusterPoolUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterPoolUpgradeProperties.upgradeType + = ClusterPoolUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeType.java index 5e994c5888060..e3db56ca48da3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolUpgradeType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ClusterPoolUpgradeType() { * @param name a name to look for. * @return the corresponding ClusterPoolUpgradeType. */ - @JsonCreator public static ClusterPoolUpgradeType fromString(String name) { return fromString(name, ClusterPoolUpgradeType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionProperties.java index 332f7e128f23f..492967f31ecb1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionProperties.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster pool version properties. */ @Fluent -public final class ClusterPoolVersionProperties { +public final class ClusterPoolVersionProperties implements JsonSerializable { /* * Cluster pool version is a 2-part version. */ - @JsonProperty(value = "clusterPoolVersion") private String clusterPoolVersion; /* * AKS version. */ - @JsonProperty(value = "aksVersion") private String aksVersion; /* * Indicate if this version is in preview or not. */ - @JsonProperty(value = "isPreview") private Boolean isPreview; /** @@ -103,4 +104,46 @@ public ClusterPoolVersionProperties withIsPreview(Boolean isPreview) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterPoolVersion", this.clusterPoolVersion); + jsonWriter.writeStringField("aksVersion", this.aksVersion); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolVersionProperties 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 ClusterPoolVersionProperties. + */ + public static ClusterPoolVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolVersionProperties deserializedClusterPoolVersionProperties = new ClusterPoolVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterPoolVersion".equals(fieldName)) { + deserializedClusterPoolVersionProperties.clusterPoolVersion = reader.getString(); + } else if ("aksVersion".equals(fieldName)) { + deserializedClusterPoolVersionProperties.aksVersion = reader.getString(); + } else if ("isPreview".equals(fieldName)) { + deserializedClusterPoolVersionProperties.isPreview = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolVersionProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionsListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionsListResult.java index 36c3dd2ce9541..f33e891759343 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionsListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPoolVersionsListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Represents a list of cluster pool versions. */ @Fluent -public final class ClusterPoolVersionsListResult { +public final class ClusterPoolVersionsListResult implements JsonSerializable { /* * The list of cluster pool versions. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPoolVersionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPoolVersionsListResult 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 ClusterPoolVersionsListResult. + */ + public static ClusterPoolVersionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPoolVersionsListResult deserializedClusterPoolVersionsListResult + = new ClusterPoolVersionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterPoolVersionInner.fromJson(reader1)); + deserializedClusterPoolVersionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterPoolVersionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPoolVersionsListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterProfile.java index 3cec54a993703..6d42cd3a096cc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterProfile.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -15,140 +18,120 @@ * Cluster profile. */ @Fluent -public final class ClusterProfile { +public final class ClusterProfile implements JsonSerializable { /* * Version with 3/4 part. */ - @JsonProperty(value = "clusterVersion", required = true) private String clusterVersion; /* * Version with three part. */ - @JsonProperty(value = "ossVersion", required = true) private String ossVersion; /* * Component list of this cluster type and version. */ - @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) private List components; /* - * This property is required by Trino, Spark and Flink cluster but is optional for Kafka cluster. + * This is deprecated. Please use managed identity profile instead. */ - @JsonProperty(value = "identityProfile") private IdentityProfile identityProfile; + /* + * This property is required by Trino, Spark and Flink cluster but is optional for Kafka cluster. + */ + private ManagedIdentityProfile managedIdentityProfile; + /* * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. */ - @JsonProperty(value = "authorizationProfile", required = true) private AuthorizationProfile authorizationProfile; /* * The cluster secret profile. */ - @JsonProperty(value = "secretsProfile") private SecretsProfile secretsProfile; /* * The service configs profiles. */ - @JsonProperty(value = "serviceConfigsProfiles") private List serviceConfigsProfiles; /* * Cluster connectivity profile. */ - @JsonProperty(value = "connectivityProfile", access = JsonProperty.Access.WRITE_ONLY) private ConnectivityProfile connectivityProfile; /* * Cluster access profile. */ - @JsonProperty(value = "clusterAccessProfile") private ClusterAccessProfile clusterAccessProfile; /* * Cluster log analytics profile to enable or disable OMS agent for cluster. */ - @JsonProperty(value = "logAnalyticsProfile") private ClusterLogAnalyticsProfile logAnalyticsProfile; /* * Cluster Prometheus profile. */ - @JsonProperty(value = "prometheusProfile") private ClusterPrometheusProfile prometheusProfile; /* * Ssh profile for the cluster. */ - @JsonProperty(value = "sshProfile") private SshProfile sshProfile; /* - * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with - * Autoscale. + * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. */ - @JsonProperty(value = "autoscaleProfile") private AutoscaleProfile autoscaleProfile; /* * Cluster Ranger plugin profile. */ - @JsonProperty(value = "rangerPluginProfile") private ClusterRangerPluginProfile rangerPluginProfile; /* * The Kafka cluster profile. */ - @JsonProperty(value = "kafkaProfile") private KafkaProfile kafkaProfile; /* * Trino Cluster profile. */ - @JsonProperty(value = "trinoProfile") private TrinoProfile trinoProfile; /* * LLAP cluster profile. */ - @JsonProperty(value = "llapProfile") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map llapProfile; /* * The Flink cluster profile. */ - @JsonProperty(value = "flinkProfile") private FlinkProfile flinkProfile; /* * The spark cluster profile. */ - @JsonProperty(value = "sparkProfile") private SparkProfile sparkProfile; /* * The ranger cluster profile. */ - @JsonProperty(value = "rangerProfile") private RangerProfile rangerProfile; /* * Stub cluster profile. */ - @JsonProperty(value = "stubProfile") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map stubProfile; /* * The script action profile list. */ - @JsonProperty(value = "scriptActionProfiles") private List scriptActionProfiles; /** @@ -207,8 +190,7 @@ public List components() { } /** - * Get the identityProfile property: This property is required by Trino, Spark and Flink cluster but is optional - * for Kafka cluster. + * Get the identityProfile property: This is deprecated. Please use managed identity profile instead. * * @return the identityProfile value. */ @@ -217,8 +199,7 @@ public IdentityProfile identityProfile() { } /** - * Set the identityProfile property: This property is required by Trino, Spark and Flink cluster but is optional - * for Kafka cluster. + * Set the identityProfile property: This is deprecated. Please use managed identity profile instead. * * @param identityProfile the identityProfile value to set. * @return the ClusterProfile object itself. @@ -228,6 +209,28 @@ public ClusterProfile withIdentityProfile(IdentityProfile identityProfile) { return this; } + /** + * Get the managedIdentityProfile property: This property is required by Trino, Spark and Flink cluster but is + * optional for Kafka cluster. + * + * @return the managedIdentityProfile value. + */ + public ManagedIdentityProfile managedIdentityProfile() { + return this.managedIdentityProfile; + } + + /** + * Set the managedIdentityProfile property: This property is required by Trino, Spark and Flink cluster but is + * optional for Kafka cluster. + * + * @param managedIdentityProfile the managedIdentityProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withManagedIdentityProfile(ManagedIdentityProfile managedIdentityProfile) { + this.managedIdentityProfile = managedIdentityProfile; + return this; + } + /** * Get the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids * authorized for data plane access. @@ -588,12 +591,12 @@ public ClusterProfile withScriptActionProfiles(List scriptA */ public void validate() { if (clusterVersion() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property clusterVersion in model ClusterProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clusterVersion in model ClusterProfile")); } if (ossVersion() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ossVersion in model ClusterProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ossVersion in model ClusterProfile")); } if (components() != null) { components().forEach(e -> e.validate()); @@ -601,9 +604,13 @@ public void validate() { if (identityProfile() != null) { identityProfile().validate(); } + if (managedIdentityProfile() != null) { + managedIdentityProfile().validate(); + } if (authorizationProfile() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property authorizationProfile in model ClusterProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authorizationProfile in model ClusterProfile")); } else { authorizationProfile().validate(); } @@ -655,4 +662,115 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ClusterProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterVersion", this.clusterVersion); + jsonWriter.writeStringField("ossVersion", this.ossVersion); + jsonWriter.writeJsonField("authorizationProfile", this.authorizationProfile); + jsonWriter.writeJsonField("identityProfile", this.identityProfile); + jsonWriter.writeJsonField("managedIdentityProfile", this.managedIdentityProfile); + jsonWriter.writeJsonField("secretsProfile", this.secretsProfile); + jsonWriter.writeArrayField("serviceConfigsProfiles", this.serviceConfigsProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("clusterAccessProfile", this.clusterAccessProfile); + jsonWriter.writeJsonField("logAnalyticsProfile", this.logAnalyticsProfile); + jsonWriter.writeJsonField("prometheusProfile", this.prometheusProfile); + jsonWriter.writeJsonField("sshProfile", this.sshProfile); + jsonWriter.writeJsonField("autoscaleProfile", this.autoscaleProfile); + jsonWriter.writeJsonField("rangerPluginProfile", this.rangerPluginProfile); + jsonWriter.writeJsonField("kafkaProfile", this.kafkaProfile); + jsonWriter.writeJsonField("trinoProfile", this.trinoProfile); + jsonWriter.writeMapField("llapProfile", this.llapProfile, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeJsonField("flinkProfile", this.flinkProfile); + jsonWriter.writeJsonField("sparkProfile", this.sparkProfile); + jsonWriter.writeJsonField("rangerProfile", this.rangerProfile); + jsonWriter.writeMapField("stubProfile", this.stubProfile, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeArrayField("scriptActionProfiles", this.scriptActionProfiles, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterProfile. + */ + public static ClusterProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterProfile deserializedClusterProfile = new ClusterProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterVersion".equals(fieldName)) { + deserializedClusterProfile.clusterVersion = reader.getString(); + } else if ("ossVersion".equals(fieldName)) { + deserializedClusterProfile.ossVersion = reader.getString(); + } else if ("authorizationProfile".equals(fieldName)) { + deserializedClusterProfile.authorizationProfile = AuthorizationProfile.fromJson(reader); + } else if ("components".equals(fieldName)) { + List components + = reader.readArray(reader1 -> ClusterComponentsItem.fromJson(reader1)); + deserializedClusterProfile.components = components; + } else if ("identityProfile".equals(fieldName)) { + deserializedClusterProfile.identityProfile = IdentityProfile.fromJson(reader); + } else if ("managedIdentityProfile".equals(fieldName)) { + deserializedClusterProfile.managedIdentityProfile = ManagedIdentityProfile.fromJson(reader); + } else if ("secretsProfile".equals(fieldName)) { + deserializedClusterProfile.secretsProfile = SecretsProfile.fromJson(reader); + } else if ("serviceConfigsProfiles".equals(fieldName)) { + List serviceConfigsProfiles + = reader.readArray(reader1 -> ClusterServiceConfigsProfile.fromJson(reader1)); + deserializedClusterProfile.serviceConfigsProfiles = serviceConfigsProfiles; + } else if ("connectivityProfile".equals(fieldName)) { + deserializedClusterProfile.connectivityProfile = ConnectivityProfile.fromJson(reader); + } else if ("clusterAccessProfile".equals(fieldName)) { + deserializedClusterProfile.clusterAccessProfile = ClusterAccessProfile.fromJson(reader); + } else if ("logAnalyticsProfile".equals(fieldName)) { + deserializedClusterProfile.logAnalyticsProfile = ClusterLogAnalyticsProfile.fromJson(reader); + } else if ("prometheusProfile".equals(fieldName)) { + deserializedClusterProfile.prometheusProfile = ClusterPrometheusProfile.fromJson(reader); + } else if ("sshProfile".equals(fieldName)) { + deserializedClusterProfile.sshProfile = SshProfile.fromJson(reader); + } else if ("autoscaleProfile".equals(fieldName)) { + deserializedClusterProfile.autoscaleProfile = AutoscaleProfile.fromJson(reader); + } else if ("rangerPluginProfile".equals(fieldName)) { + deserializedClusterProfile.rangerPluginProfile = ClusterRangerPluginProfile.fromJson(reader); + } else if ("kafkaProfile".equals(fieldName)) { + deserializedClusterProfile.kafkaProfile = KafkaProfile.fromJson(reader); + } else if ("trinoProfile".equals(fieldName)) { + deserializedClusterProfile.trinoProfile = TrinoProfile.fromJson(reader); + } else if ("llapProfile".equals(fieldName)) { + Map llapProfile = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedClusterProfile.llapProfile = llapProfile; + } else if ("flinkProfile".equals(fieldName)) { + deserializedClusterProfile.flinkProfile = FlinkProfile.fromJson(reader); + } else if ("sparkProfile".equals(fieldName)) { + deserializedClusterProfile.sparkProfile = SparkProfile.fromJson(reader); + } else if ("rangerProfile".equals(fieldName)) { + deserializedClusterProfile.rangerProfile = RangerProfile.fromJson(reader); + } else if ("stubProfile".equals(fieldName)) { + Map stubProfile = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedClusterProfile.stubProfile = stubProfile; + } else if ("scriptActionProfiles".equals(fieldName)) { + List scriptActionProfiles + = reader.readArray(reader1 -> ScriptActionProfile.fromJson(reader1)); + deserializedClusterProfile.scriptActionProfiles = scriptActionProfiles; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPrometheusProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPrometheusProfile.java index 5d8c9385b8e9e..c1bf21d5bc92e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPrometheusProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterPrometheusProfile.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster Prometheus profile. */ @Fluent -public final class ClusterPrometheusProfile { +public final class ClusterPrometheusProfile implements JsonSerializable { /* * Enable Prometheus for cluster or not. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /** @@ -51,4 +54,41 @@ public ClusterPrometheusProfile withEnabled(boolean enabled) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPrometheusProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPrometheusProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterPrometheusProfile. + */ + public static ClusterPrometheusProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPrometheusProfile deserializedClusterPrometheusProfile = new ClusterPrometheusProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedClusterPrometheusProfile.enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPrometheusProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterRangerPluginProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterRangerPluginProfile.java index 6b1ca1d3bdaee..54f20a152d1bb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterRangerPluginProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterRangerPluginProfile.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster Ranger plugin profile. */ @Fluent -public final class ClusterRangerPluginProfile { +public final class ClusterRangerPluginProfile implements JsonSerializable { /* * Enable Ranger for cluster or not. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /** @@ -51,4 +54,41 @@ public ClusterRangerPluginProfile withEnabled(boolean enabled) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterRangerPluginProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterRangerPluginProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterRangerPluginProfile. + */ + public static ClusterRangerPluginProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterRangerPluginProfile deserializedClusterRangerPluginProfile = new ClusterRangerPluginProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedClusterRangerPluginProfile.enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterRangerPluginProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeData.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeData.java index 2cba09175ef03..d5d94c97b2c76 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeData.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeData.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -18,15 +21,28 @@ public final class ClusterResizeData extends Resource { /* * Sets the properties. Define cluster resize specific properties. */ - @JsonProperty(value = "properties") private ClusterResizeProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ClusterResizeData class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -90,4 +136,56 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterResizeData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterResizeData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterResizeData. + */ + public static ClusterResizeData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterResizeData deserializedClusterResizeData = new ClusterResizeData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterResizeData.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterResizeData.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterResizeData.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterResizeData.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterResizeData.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedClusterResizeData.properties = ClusterResizeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterResizeData.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterResizeData; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeProperties.java index 9dfc66d83c115..94f6a1d274c52 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResizeProperties.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The properties for resizing a cluster. */ @Fluent -public final class ClusterResizeProperties { +public final class ClusterResizeProperties implements JsonSerializable { /* * Target node count of worker node. */ - @JsonProperty(value = "targetWorkerNodeCount", required = true) private int targetWorkerNodeCount; /** @@ -51,4 +54,41 @@ public ClusterResizeProperties withTargetWorkerNodeCount(int targetWorkerNodeCou */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("targetWorkerNodeCount", this.targetWorkerNodeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterResizeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterResizeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterResizeProperties. + */ + public static ClusterResizeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterResizeProperties deserializedClusterResizeProperties = new ClusterResizeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetWorkerNodeCount".equals(fieldName)) { + deserializedClusterResizeProperties.targetWorkerNodeCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterResizeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResourceProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResourceProperties.java index c978bdfc06d39..e052ce230be92 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResourceProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterResourceProperties.java @@ -6,47 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster resource properties. */ @Fluent -public final class ClusterResourceProperties { +public final class ClusterResourceProperties implements JsonSerializable { /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStatus provisioningState; /* * The type of cluster. */ - @JsonProperty(value = "clusterType", required = true) private String clusterType; /* * A unique id generated by the RP to identify the resource. */ - @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY) private String deploymentId; /* * The compute profile. */ - @JsonProperty(value = "computeProfile", required = true) private ComputeProfile computeProfile; /* * Cluster profile. */ - @JsonProperty(value = "clusterProfile", required = true) private ClusterProfile clusterProfile; /* * Business status of the resource. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; /** @@ -149,22 +147,75 @@ public String status() { */ public void validate() { if (clusterType() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property clusterType in model ClusterResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clusterType in model ClusterResourceProperties")); } if (computeProfile() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property computeProfile in model ClusterResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeProfile in model ClusterResourceProperties")); } else { computeProfile().validate(); } if (clusterProfile() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property clusterProfile in model ClusterResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clusterProfile in model ClusterResourceProperties")); } else { clusterProfile().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterType", this.clusterType); + jsonWriter.writeJsonField("computeProfile", this.computeProfile); + jsonWriter.writeJsonField("clusterProfile", this.clusterProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterResourceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterResourceProperties. + */ + public static ClusterResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterResourceProperties deserializedClusterResourceProperties = new ClusterResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterType".equals(fieldName)) { + deserializedClusterResourceProperties.clusterType = reader.getString(); + } else if ("computeProfile".equals(fieldName)) { + deserializedClusterResourceProperties.computeProfile = ComputeProfile.fromJson(reader); + } else if ("clusterProfile".equals(fieldName)) { + deserializedClusterResourceProperties.clusterProfile = ClusterProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterResourceProperties.provisioningState + = ProvisioningStatus.fromString(reader.getString()); + } else if ("deploymentId".equals(fieldName)) { + deserializedClusterResourceProperties.deploymentId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedClusterResourceProperties.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterResourceProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfig.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfig.java index cab411ac9a961..0fd69aa529c1b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfig.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfig.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster configs per component. */ @Fluent -public final class ClusterServiceConfig { +public final class ClusterServiceConfig implements JsonSerializable { /* * Name of the component the config files should apply to. */ - @JsonProperty(value = "component", required = true) private String component; /* * List of Config Files. */ - @JsonProperty(value = "files", required = true) private List files; /** @@ -79,16 +81,57 @@ public ClusterServiceConfig withFiles(List files) { */ public void validate() { if (component() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property component in model ClusterServiceConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property component in model ClusterServiceConfig")); } if (files() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property files in model ClusterServiceConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property files in model ClusterServiceConfig")); } else { files().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterServiceConfig.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("component", this.component); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterServiceConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterServiceConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterServiceConfig. + */ + public static ClusterServiceConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterServiceConfig deserializedClusterServiceConfig = new ClusterServiceConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("component".equals(fieldName)) { + deserializedClusterServiceConfig.component = reader.getString(); + } else if ("files".equals(fieldName)) { + List files = reader.readArray(reader1 -> ClusterConfigFile.fromJson(reader1)); + deserializedClusterServiceConfig.files = files; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterServiceConfig; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfigsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfigsProfile.java index 91a2e04cfec97..a68a2d9bb8b2a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfigsProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterServiceConfigsProfile.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster service configs. */ @Fluent -public final class ClusterServiceConfigsProfile { +public final class ClusterServiceConfigsProfile implements JsonSerializable { /* * Name of the service the configurations should apply to. */ - @JsonProperty(value = "serviceName", required = true) private String serviceName; /* * List of service configs. */ - @JsonProperty(value = "configs", required = true) private List configs; /** @@ -79,16 +81,60 @@ public ClusterServiceConfigsProfile withConfigs(List confi */ public void validate() { if (serviceName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serviceName in model ClusterServiceConfigsProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serviceName in model ClusterServiceConfigsProfile")); } if (configs() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property configs in model ClusterServiceConfigsProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property configs in model ClusterServiceConfigsProfile")); } else { configs().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterServiceConfigsProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("configs", this.configs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterServiceConfigsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterServiceConfigsProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterServiceConfigsProfile. + */ + public static ClusterServiceConfigsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterServiceConfigsProfile deserializedClusterServiceConfigsProfile = new ClusterServiceConfigsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedClusterServiceConfigsProfile.serviceName = reader.getString(); + } else if ("configs".equals(fieldName)) { + List configs + = reader.readArray(reader1 -> ClusterServiceConfig.fromJson(reader1)); + deserializedClusterServiceConfigsProfile.configs = configs; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterServiceConfigsProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgrade.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgrade.java index 86a3e29c42f97..d82a1c1884e02 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgrade.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgrade.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Cluster Upgrade. */ @Fluent -public final class ClusterUpgrade { +public final class ClusterUpgrade implements JsonSerializable { /* * Properties of upgrading cluster. */ - @JsonProperty(value = "properties", required = true) private ClusterUpgradeProperties properties; /** @@ -52,12 +55,49 @@ public ClusterUpgrade withProperties(ClusterUpgradeProperties properties) { */ public void validate() { if (properties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ClusterUpgrade")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ClusterUpgrade")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgrade.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgrade from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgrade if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgrade. + */ + public static ClusterUpgrade fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgrade deserializedClusterUpgrade = new ClusterUpgrade(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterUpgrade.properties = ClusterUpgradeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgrade; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistories.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistories.java new file mode 100644 index 0000000000000..8b9be68121507 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistories.java @@ -0,0 +1,41 @@ +// 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.containers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ClusterUpgradeHistories. + */ +public interface ClusterUpgradeHistories { + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Returns a list of upgrade history. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster upgrade history as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName, + Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistory.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistory.java new file mode 100644 index 0000000000000..20c234cabef90 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistory.java @@ -0,0 +1,55 @@ +// 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.containers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; + +/** + * An immutable client-side representation of ClusterUpgradeHistory. + */ +public interface ClusterUpgradeHistory { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of cluster upgrade history. + * + * @return the properties value. + */ + ClusterUpgradeHistoryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner object. + * + * @return the inner object. + */ + ClusterUpgradeHistoryInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryListResult.java new file mode 100644 index 0000000000000..465e4b1cd42ac --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryListResult.java @@ -0,0 +1,125 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import java.io.IOException; +import java.util.List; + +/** + * Represents a list of cluster upgrade history. + */ +@Fluent +public final class ClusterUpgradeHistoryListResult implements JsonSerializable { + /* + * The list of cluster upgrade history. + */ + private List value; + + /* + * The link (url) to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ClusterUpgradeHistoryListResult class. + */ + public ClusterUpgradeHistoryListResult() { + } + + /** + * Get the value property: The list of cluster upgrade history. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster upgrade history. + * + * @param value the value value to set. + * @return the ClusterUpgradeHistoryListResult object itself. + */ + public ClusterUpgradeHistoryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ClusterUpgradeHistoryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeHistoryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeHistoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeHistoryListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgradeHistoryListResult. + */ + public static ClusterUpgradeHistoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeHistoryListResult deserializedClusterUpgradeHistoryListResult + = new ClusterUpgradeHistoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterUpgradeHistoryInner.fromJson(reader1)); + deserializedClusterUpgradeHistoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterUpgradeHistoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeHistoryListResult; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryProperties.java new file mode 100644 index 0000000000000..591d388f59e98 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryProperties.java @@ -0,0 +1,191 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of cluster upgrade history. + */ +@Fluent +public class ClusterUpgradeHistoryProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterUpgradeHistoryType upgradeType + = ClusterUpgradeHistoryType.fromString("ClusterUpgradeHistoryProperties"); + + /* + * Time when created this upgrade history. + */ + private String utcTime; + + /* + * Result of this upgrade. + */ + private ClusterUpgradeHistoryUpgradeResultType upgradeResult; + + /** + * Creates an instance of ClusterUpgradeHistoryProperties class. + */ + public ClusterUpgradeHistoryProperties() { + } + + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterUpgradeHistoryType upgradeType() { + return this.upgradeType; + } + + /** + * Get the utcTime property: Time when created this upgrade history. + * + * @return the utcTime value. + */ + public String utcTime() { + return this.utcTime; + } + + /** + * Set the utcTime property: Time when created this upgrade history. + * + * @param utcTime the utcTime value to set. + * @return the ClusterUpgradeHistoryProperties object itself. + */ + public ClusterUpgradeHistoryProperties withUtcTime(String utcTime) { + this.utcTime = utcTime; + return this; + } + + /** + * Get the upgradeResult property: Result of this upgrade. + * + * @return the upgradeResult value. + */ + public ClusterUpgradeHistoryUpgradeResultType upgradeResult() { + return this.upgradeResult; + } + + /** + * Set the upgradeResult property: Result of this upgrade. + * + * @param upgradeResult the upgradeResult value to set. + * @return the ClusterUpgradeHistoryProperties object itself. + */ + public ClusterUpgradeHistoryProperties withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType upgradeResult) { + this.upgradeResult = upgradeResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (utcTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property utcTime in model ClusterUpgradeHistoryProperties")); + } + if (upgradeResult() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property upgradeResult in model ClusterUpgradeHistoryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeHistoryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("utcTime", this.utcTime); + jsonWriter.writeStringField("upgradeResult", this.upgradeResult == null ? null : this.upgradeResult.toString()); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeHistoryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgradeHistoryProperties. + */ + public static ClusterUpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ClusterInPlaceUpgradeHistoryProperties".equals(discriminatorValue)) { + return ClusterInPlaceUpgradeHistoryProperties.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterHotfixUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else if ("HotfixUpgradeRollback".equals(discriminatorValue)) { + return ClusterHotfixUpgradeRollbackHistoryProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgradeRollback".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeRollbackHistoryProperties.fromJson(readerToUse.reset()); + } else if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterAksPatchUpgradeHistoryProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterUpgradeHistoryProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeHistoryProperties deserializedClusterUpgradeHistoryProperties + = new ClusterUpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("utcTime".equals(fieldName)) { + deserializedClusterUpgradeHistoryProperties.utcTime = reader.getString(); + } else if ("upgradeResult".equals(fieldName)) { + deserializedClusterUpgradeHistoryProperties.upgradeResult + = ClusterUpgradeHistoryUpgradeResultType.fromString(reader.getString()); + } else if ("upgradeType".equals(fieldName)) { + deserializedClusterUpgradeHistoryProperties.upgradeType + = ClusterUpgradeHistoryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistorySeverityType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistorySeverityType.java new file mode 100644 index 0000000000000..051219c98c92f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistorySeverityType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of this upgrade. + */ +public final class ClusterUpgradeHistorySeverityType extends ExpandableStringEnum { + /** + * Static value low for ClusterUpgradeHistorySeverityType. + */ + public static final ClusterUpgradeHistorySeverityType LOW = fromString("low"); + + /** + * Static value medium for ClusterUpgradeHistorySeverityType. + */ + public static final ClusterUpgradeHistorySeverityType MEDIUM = fromString("medium"); + + /** + * Static value high for ClusterUpgradeHistorySeverityType. + */ + public static final ClusterUpgradeHistorySeverityType HIGH = fromString("high"); + + /** + * Static value critical for ClusterUpgradeHistorySeverityType. + */ + public static final ClusterUpgradeHistorySeverityType CRITICAL = fromString("critical"); + + /** + * Creates a new instance of ClusterUpgradeHistorySeverityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterUpgradeHistorySeverityType() { + } + + /** + * Creates or finds a ClusterUpgradeHistorySeverityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterUpgradeHistorySeverityType. + */ + public static ClusterUpgradeHistorySeverityType fromString(String name) { + return fromString(name, ClusterUpgradeHistorySeverityType.class); + } + + /** + * Gets known ClusterUpgradeHistorySeverityType values. + * + * @return known ClusterUpgradeHistorySeverityType values. + */ + public static Collection values() { + return values(ClusterUpgradeHistorySeverityType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryType.java new file mode 100644 index 0000000000000..c74cc9fd0177a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryType.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of upgrade. + */ +public final class ClusterUpgradeHistoryType extends ExpandableStringEnum { + /** + * Static value AKSPatchUpgrade for ClusterUpgradeHistoryType. + */ + public static final ClusterUpgradeHistoryType AKSPATCH_UPGRADE = fromString("AKSPatchUpgrade"); + + /** + * Static value HotfixUpgrade for ClusterUpgradeHistoryType. + */ + public static final ClusterUpgradeHistoryType HOTFIX_UPGRADE = fromString("HotfixUpgrade"); + + /** + * Static value HotfixUpgradeRollback for ClusterUpgradeHistoryType. + */ + public static final ClusterUpgradeHistoryType HOTFIX_UPGRADE_ROLLBACK = fromString("HotfixUpgradeRollback"); + + /** + * Static value PatchVersionUpgrade for ClusterUpgradeHistoryType. + */ + public static final ClusterUpgradeHistoryType PATCH_VERSION_UPGRADE = fromString("PatchVersionUpgrade"); + + /** + * Static value PatchVersionUpgradeRollback for ClusterUpgradeHistoryType. + */ + public static final ClusterUpgradeHistoryType PATCH_VERSION_UPGRADE_ROLLBACK + = fromString("PatchVersionUpgradeRollback"); + + /** + * Creates a new instance of ClusterUpgradeHistoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterUpgradeHistoryType() { + } + + /** + * Creates or finds a ClusterUpgradeHistoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterUpgradeHistoryType. + */ + public static ClusterUpgradeHistoryType fromString(String name) { + return fromString(name, ClusterUpgradeHistoryType.class); + } + + /** + * Gets known ClusterUpgradeHistoryType values. + * + * @return known ClusterUpgradeHistoryType values. + */ + public static Collection values() { + return values(ClusterUpgradeHistoryType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryUpgradeResultType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryUpgradeResultType.java new file mode 100644 index 0000000000000..11bf6b89f95b1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeHistoryUpgradeResultType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Result of this upgrade. + */ +public final class ClusterUpgradeHistoryUpgradeResultType + extends ExpandableStringEnum { + /** + * Static value Succeed for ClusterUpgradeHistoryUpgradeResultType. + */ + public static final ClusterUpgradeHistoryUpgradeResultType SUCCEED = fromString("Succeed"); + + /** + * Static value Failed for ClusterUpgradeHistoryUpgradeResultType. + */ + public static final ClusterUpgradeHistoryUpgradeResultType FAILED = fromString("Failed"); + + /** + * Creates a new instance of ClusterUpgradeHistoryUpgradeResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterUpgradeHistoryUpgradeResultType() { + } + + /** + * Creates or finds a ClusterUpgradeHistoryUpgradeResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterUpgradeHistoryUpgradeResultType. + */ + public static ClusterUpgradeHistoryUpgradeResultType fromString(String name) { + return fromString(name, ClusterUpgradeHistoryUpgradeResultType.class); + } + + /** + * Gets known ClusterUpgradeHistoryUpgradeResultType values. + * + * @return known ClusterUpgradeHistoryUpgradeResultType values. + */ + public static Collection values() { + return values(ClusterUpgradeHistoryUpgradeResultType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeProperties.java index d34de0f7ff9ef..d2b6db8d751d7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeProperties.java @@ -5,30 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of upgrading cluster. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "upgradeType", - defaultImpl = ClusterUpgradeProperties.class) -@JsonTypeName("ClusterUpgradeProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKSPatchUpgrade", value = ClusterAksPatchVersionUpgradeProperties.class), - @JsonSubTypes.Type(name = "HotfixUpgrade", value = ClusterHotfixUpgradeProperties.class) }) @Immutable -public class ClusterUpgradeProperties { +public class ClusterUpgradeProperties implements JsonSerializable { + /* + * Type of upgrade. + */ + private ClusterUpgradeType upgradeType = ClusterUpgradeType.fromString("ClusterUpgradeProperties"); + /** * Creates an instance of ClusterUpgradeProperties class. */ public ClusterUpgradeProperties() { } + /** + * Get the upgradeType property: Type of upgrade. + * + * @return the upgradeType value. + */ + public ClusterUpgradeType upgradeType() { + return this.upgradeType; + } + /** * Validates the instance. * @@ -36,4 +43,72 @@ public ClusterUpgradeProperties() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeType", this.upgradeType == null ? null : this.upgradeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeProperties 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 ClusterUpgradeProperties. + */ + public static ClusterUpgradeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("upgradeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKSPatchUpgrade".equals(discriminatorValue)) { + return ClusterAksPatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("ClusterInPlaceUpgradeProperties".equals(discriminatorValue)) { + return ClusterInPlaceUpgradeProperties.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("HotfixUpgrade".equals(discriminatorValue)) { + return ClusterHotfixUpgradeProperties.fromJson(readerToUse.reset()); + } else if ("PatchVersionUpgrade".equals(discriminatorValue)) { + return ClusterPatchVersionUpgradeProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClusterUpgradeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeProperties deserializedClusterUpgradeProperties = new ClusterUpgradeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeType".equals(fieldName)) { + deserializedClusterUpgradeProperties.upgradeType + = ClusterUpgradeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollback.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollback.java new file mode 100644 index 0000000000000..51a7ec0c96d23 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollback.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster Upgrade. + */ +@Fluent +public final class ClusterUpgradeRollback implements JsonSerializable { + /* + * Properties for manual rollback of cluster's upgrade. + */ + private ClusterUpgradeRollbackProperties properties; + + /** + * Creates an instance of ClusterUpgradeRollback class. + */ + public ClusterUpgradeRollback() { + } + + /** + * Get the properties property: Properties for manual rollback of cluster's upgrade. + * + * @return the properties value. + */ + public ClusterUpgradeRollbackProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties for manual rollback of cluster's upgrade. + * + * @param properties the properties value to set. + * @return the ClusterUpgradeRollback object itself. + */ + public ClusterUpgradeRollback withProperties(ClusterUpgradeRollbackProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ClusterUpgradeRollback")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeRollback.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeRollback from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeRollback if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgradeRollback. + */ + public static ClusterUpgradeRollback fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeRollback deserializedClusterUpgradeRollback = new ClusterUpgradeRollback(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterUpgradeRollback.properties = ClusterUpgradeRollbackProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeRollback; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollbackProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollbackProperties.java new file mode 100644 index 0000000000000..afbacfefe08be --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeRollbackProperties.java @@ -0,0 +1,103 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties for manual rollback of cluster's upgrade. + */ +@Fluent +public final class ClusterUpgradeRollbackProperties implements JsonSerializable { + /* + * A specific upgrade history to rollback + */ + private String upgradeHistory; + + /** + * Creates an instance of ClusterUpgradeRollbackProperties class. + */ + public ClusterUpgradeRollbackProperties() { + } + + /** + * Get the upgradeHistory property: A specific upgrade history to rollback. + * + * @return the upgradeHistory value. + */ + public String upgradeHistory() { + return this.upgradeHistory; + } + + /** + * Set the upgradeHistory property: A specific upgrade history to rollback. + * + * @param upgradeHistory the upgradeHistory value to set. + * @return the ClusterUpgradeRollbackProperties object itself. + */ + public ClusterUpgradeRollbackProperties withUpgradeHistory(String upgradeHistory) { + this.upgradeHistory = upgradeHistory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradeHistory() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property upgradeHistory in model ClusterUpgradeRollbackProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradeRollbackProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeHistory", this.upgradeHistory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpgradeRollbackProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpgradeRollbackProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterUpgradeRollbackProperties. + */ + public static ClusterUpgradeRollbackProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpgradeRollbackProperties deserializedClusterUpgradeRollbackProperties + = new ClusterUpgradeRollbackProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeHistory".equals(fieldName)) { + deserializedClusterUpgradeRollbackProperties.upgradeHistory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpgradeRollbackProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeType.java index ee64e92342013..c7c80fa9299a2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterUpgradeType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -22,6 +21,11 @@ public final class ClusterUpgradeType extends ExpandableStringEnum { /* * The type of cluster. */ - @JsonProperty(value = "clusterType") private String clusterType; /* * Version with three part. */ - @JsonProperty(value = "clusterVersion") private String clusterVersion; /* * Version with three part. */ - @JsonProperty(value = "ossVersion") private String ossVersion; /* * The two part cluster pool version. If the cluster version is before cluster pool version on-board, the return * value will be empty string */ - @JsonProperty(value = "clusterPoolVersion") private String clusterPoolVersion; /* * Indicate if this version is in preview or not. */ - @JsonProperty(value = "isPreview") private Boolean isPreview; /* * Component list of this cluster type and version. */ - @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) private List components; /** @@ -177,4 +175,56 @@ public void validate() { components().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterType", this.clusterType); + jsonWriter.writeStringField("clusterVersion", this.clusterVersion); + jsonWriter.writeStringField("ossVersion", this.ossVersion); + jsonWriter.writeStringField("clusterPoolVersion", this.clusterPoolVersion); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterVersionProperties 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 ClusterVersionProperties. + */ + public static ClusterVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterVersionProperties deserializedClusterVersionProperties = new ClusterVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterType".equals(fieldName)) { + deserializedClusterVersionProperties.clusterType = reader.getString(); + } else if ("clusterVersion".equals(fieldName)) { + deserializedClusterVersionProperties.clusterVersion = reader.getString(); + } else if ("ossVersion".equals(fieldName)) { + deserializedClusterVersionProperties.ossVersion = reader.getString(); + } else if ("clusterPoolVersion".equals(fieldName)) { + deserializedClusterVersionProperties.clusterPoolVersion = reader.getString(); + } else if ("isPreview".equals(fieldName)) { + deserializedClusterVersionProperties.isPreview = reader.getNullable(JsonReader::getBoolean); + } else if ("components".equals(fieldName)) { + List components + = reader.readArray(reader1 -> ClusterComponentsItem.fromJson(reader1)); + deserializedClusterVersionProperties.components = components; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterVersionProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterVersionsListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterVersionsListResult.java index f23145254d01b..1953ad0c129ee 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterVersionsListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ClusterVersionsListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Represents a list of cluster versions. */ @Fluent -public final class ClusterVersionsListResult { +public final class ClusterVersionsListResult implements JsonSerializable { /* * The list of cluster versions. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterVersionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterVersionsListResult 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 ClusterVersionsListResult. + */ + public static ClusterVersionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterVersionsListResult deserializedClusterVersionsListResult = new ClusterVersionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterVersionInner.fromJson(reader1)); + deserializedClusterVersionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterVersionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterVersionsListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Clusters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Clusters.java index 0d27206820b09..37d3c76594a37 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Clusters.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Clusters.java @@ -68,6 +68,37 @@ Cluster upgrade(String resourceGroupName, String clusterPoolName, String cluster Cluster upgrade(String resourceGroupName, String clusterPoolName, String clusterName, ClusterUpgrade clusterUpgradeRequest, Context context); + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + Cluster upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest); + + /** + * Manual rollback upgrade for a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterRollbackUpgradeRequest Manual rollback upgrade for a cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + Cluster upgradeManualRollback(String resourceGroupName, String clusterPoolName, String clusterName, + ClusterUpgradeRollback clusterRollbackUpgradeRequest, Context context); + /** * Resize an existing Cluster. * diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonOperator.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonOperator.java index 36f31b5848871..e6092f0c799ed 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonOperator.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonOperator.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ComparisonOperator() { * @param name a name to look for. * @return the corresponding ComparisonOperator. */ - @JsonCreator public static ComparisonOperator fromString(String name) { return fromString(name, ComparisonOperator.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonRule.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonRule.java index dc7b572491b3d..77dedb8e79847 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonRule.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComparisonRule.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The comparison rule. */ @Fluent -public final class ComparisonRule { +public final class ComparisonRule implements JsonSerializable { /* * The comparison operator. */ - @JsonProperty(value = "operator", required = true) private ComparisonOperator operator; /* * Threshold setting. */ - @JsonProperty(value = "threshold", required = true) private float threshold; /** @@ -78,10 +80,50 @@ public ComparisonRule withThreshold(float threshold) { */ public void validate() { if (operator() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model ComparisonRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model ComparisonRule")); } } private static final ClientLogger LOGGER = new ClientLogger(ComparisonRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeFloatField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComparisonRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComparisonRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComparisonRule. + */ + public static ComparisonRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComparisonRule deserializedComparisonRule = new ComparisonRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedComparisonRule.operator = ComparisonOperator.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedComparisonRule.threshold = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedComparisonRule; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeProfile.java index 6a7e48e15fa24..e4a0c1012bc26 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeProfile.java @@ -6,20 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The compute profile. */ @Fluent -public final class ComputeProfile { +public final class ComputeProfile implements JsonSerializable { /* * The nodes definitions. */ - @JsonProperty(value = "nodes", required = true) private List nodes; + /* + * The list of Availability zones to use for AKS VMSS nodes. + */ + private List availabilityZones; + /** * Creates an instance of ComputeProfile class. */ @@ -46,6 +54,26 @@ public ComputeProfile withNodes(List nodes) { return this; } + /** + * Get the availabilityZones property: The list of Availability zones to use for AKS VMSS nodes. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for AKS VMSS nodes. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + /** * Validates the instance. * @@ -53,12 +81,55 @@ public ComputeProfile withNodes(List nodes) { */ public void validate() { if (nodes() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property nodes in model ComputeProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nodes in model ComputeProfile")); } else { nodes().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ComputeProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nodes", this.nodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComputeProfile. + */ + public static ComputeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeProfile deserializedComputeProfile = new ComputeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodes".equals(fieldName)) { + List nodes = reader.readArray(reader1 -> NodeProfile.fromJson(reader1)); + deserializedComputeProfile.nodes = nodes; + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedComputeProfile.availabilityZones = availabilityZones; + } else { + reader.skipChildren(); + } + } + + return deserializedComputeProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeResourceDefinition.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeResourceDefinition.java index b9c937a4b01cf..1e8c02bca6aba 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeResourceDefinition.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ComputeResourceDefinition.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The cpu and memory requirement definition. */ @Fluent -public final class ComputeResourceDefinition { +public final class ComputeResourceDefinition implements JsonSerializable { /* * The required CPU. */ - @JsonProperty(value = "cpu", required = true) private float cpu; /* * The required memory in MB, Container memory will be 110 percentile */ - @JsonProperty(value = "memory", required = true) private long memory; /** @@ -77,4 +79,44 @@ public ComputeResourceDefinition withMemory(long memory) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFloatField("cpu", this.cpu); + jsonWriter.writeLongField("memory", this.memory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeResourceDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeResourceDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComputeResourceDefinition. + */ + public static ComputeResourceDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeResourceDefinition deserializedComputeResourceDefinition = new ComputeResourceDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpu".equals(fieldName)) { + deserializedComputeResourceDefinition.cpu = reader.getFloat(); + } else if ("memory".equals(fieldName)) { + deserializedComputeResourceDefinition.memory = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeResourceDefinition; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfile.java index 2ee071d62a2f9..54de815d83c9b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfile.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster connectivity profile. */ @Fluent -public final class ConnectivityProfile { +public final class ConnectivityProfile implements JsonSerializable { /* * Web connectivity endpoint details. */ - @JsonProperty(value = "web", required = true) private ConnectivityProfileWeb web; /* * List of SSH connectivity endpoints. */ - @JsonProperty(value = "ssh") private List ssh; /** @@ -79,8 +81,8 @@ public ConnectivityProfile withSsh(List ssh) { */ public void validate() { if (web() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property web in model ConnectivityProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property web in model ConnectivityProfile")); } else { web().validate(); } @@ -90,4 +92,46 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ConnectivityProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("web", this.web); + jsonWriter.writeArrayField("ssh", this.ssh, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityProfile. + */ + public static ConnectivityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityProfile deserializedConnectivityProfile = new ConnectivityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("web".equals(fieldName)) { + deserializedConnectivityProfile.web = ConnectivityProfileWeb.fromJson(reader); + } else if ("ssh".equals(fieldName)) { + List ssh + = reader.readArray(reader1 -> SshConnectivityEndpoint.fromJson(reader1)); + deserializedConnectivityProfile.ssh = ssh; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfileWeb.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfileWeb.java index 5dc80d239b6ce..2d3d167ceed52 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfileWeb.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ConnectivityProfileWeb.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Web connectivity endpoint details. @@ -44,4 +48,44 @@ public ConnectivityProfileWeb withPrivateFqdn(String privateFqdn) { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", fqdn()); + jsonWriter.writeStringField("privateFqdn", privateFqdn()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityProfileWeb from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityProfileWeb if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityProfileWeb. + */ + public static ConnectivityProfileWeb fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityProfileWeb deserializedConnectivityProfileWeb = new ConnectivityProfileWeb(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedConnectivityProfileWeb.withFqdn(reader.getString()); + } else if ("privateFqdn".equals(fieldName)) { + deserializedConnectivityProfileWeb.withPrivateFqdn(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityProfileWeb; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ContentEncoding.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ContentEncoding.java index 15c4c9044c5f5..e9cade236f83b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ContentEncoding.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ContentEncoding.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public ContentEncoding() { * @param name a name to look for. * @return the corresponding ContentEncoding. */ - @JsonCreator public static ContentEncoding fromString(String name) { return fromString(name, ContentEncoding.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterAksVersionStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterAksVersionStatus.java index 6517797bed4bc..af84a6a854fd3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterAksVersionStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterAksVersionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CurrentClusterAksVersionStatus() { * @param name a name to look for. * @return the corresponding CurrentClusterAksVersionStatus. */ - @JsonCreator public static CurrentClusterAksVersionStatus fromString(String name) { return fromString(name, CurrentClusterAksVersionStatus.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterPoolAksVersionStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterPoolAksVersionStatus.java index ce2d24edbb370..975284912d604 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterPoolAksVersionStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/CurrentClusterPoolAksVersionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CurrentClusterPoolAksVersionStatus() { * @param name a name to look for. * @return the corresponding CurrentClusterPoolAksVersionStatus. */ - @JsonCreator public static CurrentClusterPoolAksVersionStatus fromString(String name) { return fromString(name, CurrentClusterPoolAksVersionStatus.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DataDiskType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DataDiskType.java index 38baa9c289a7d..c4f718aacf16c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DataDiskType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DataDiskType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public DataDiskType() { * @param name a name to look for. * @return the corresponding DataDiskType. */ - @JsonCreator public static DataDiskType fromString(String name) { return fromString(name, DataDiskType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DbConnectionAuthenticationMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DbConnectionAuthenticationMode.java index 79773f7ad46c3..f5aa8985deb40 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DbConnectionAuthenticationMode.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DbConnectionAuthenticationMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public DbConnectionAuthenticationMode() { * @param name a name to look for. * @return the corresponding DbConnectionAuthenticationMode. */ - @JsonCreator public static DbConnectionAuthenticationMode fromString(String name) { return fromString(name, DbConnectionAuthenticationMode.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DeploymentMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DeploymentMode.java index 2c2f3876a6da0..72924f34872ab 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DeploymentMode.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DeploymentMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public DeploymentMode() { * @param name a name to look for. * @return the corresponding DeploymentMode. */ - @JsonCreator public static DeploymentMode fromString(String name) { return fromString(name, DeploymentMode.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DiskStorageProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DiskStorageProfile.java index c73c85326a183..e9647e25d804b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DiskStorageProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/DiskStorageProfile.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Kafka disk storage profile. */ @Fluent -public final class DiskStorageProfile { +public final class DiskStorageProfile implements JsonSerializable { /* * Managed Disk size in GB. The maximum supported disk size for Standard and Premium HDD/SSD is 32TB, except for * Premium SSD v2, which supports up to 64TB. */ - @JsonProperty(value = "dataDiskSize", required = true) private int dataDiskSize; /* * Managed Disk Type. */ - @JsonProperty(value = "dataDiskType", required = true) private DataDiskType dataDiskType; /** @@ -81,10 +83,51 @@ public DiskStorageProfile withDataDiskType(DataDiskType dataDiskType) { */ public void validate() { if (dataDiskType() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property dataDiskType in model DiskStorageProfile")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property dataDiskType in model DiskStorageProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(DiskStorageProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("dataDiskSize", this.dataDiskSize); + jsonWriter.writeStringField("dataDiskType", this.dataDiskType == null ? null : this.dataDiskType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskStorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskStorageProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiskStorageProfile. + */ + public static DiskStorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskStorageProfile deserializedDiskStorageProfile = new DiskStorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDiskSize".equals(fieldName)) { + deserializedDiskStorageProfile.dataDiskSize = reader.getInt(); + } else if ("dataDiskType".equals(fieldName)) { + deserializedDiskStorageProfile.dataDiskType = DataDiskType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskStorageProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkCatalogOptions.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkCatalogOptions.java index 444e17446bfd0..a17521aa48f4e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkCatalogOptions.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkCatalogOptions.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Flink cluster catalog options. */ @Fluent -public final class FlinkCatalogOptions { +public final class FlinkCatalogOptions implements JsonSerializable { /* * Hive Catalog Option for Flink cluster. */ - @JsonProperty(value = "hive") private FlinkHiveCatalogOption hive; /** @@ -54,4 +57,40 @@ public void validate() { hive().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hive", this.hive); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkCatalogOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkCatalogOptions 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 FlinkCatalogOptions. + */ + public static FlinkCatalogOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkCatalogOptions deserializedFlinkCatalogOptions = new FlinkCatalogOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hive".equals(fieldName)) { + deserializedFlinkCatalogOptions.hive = FlinkHiveCatalogOption.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkCatalogOptions; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkHiveCatalogOption.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkHiveCatalogOption.java index 984a559bae511..084fabf873da3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkHiveCatalogOption.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkHiveCatalogOption.java @@ -6,37 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Hive Catalog Option for Flink cluster. */ @Fluent -public final class FlinkHiveCatalogOption { +public final class FlinkHiveCatalogOption implements JsonSerializable { /* * The authentication mode to connect to your Hive metastore database. More details: * https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and- * authorization */ - @JsonProperty(value = "metastoreDbConnectionAuthenticationMode") private MetastoreDbConnectionAuthenticationMode metastoreDbConnectionAuthenticationMode; /* * Secret reference name from secretsProfile.secrets containing password for database connection. */ - @JsonProperty(value = "metastoreDbConnectionPasswordSecret") private String metastoreDbConnectionPasswordSecret; /* * Connection string for hive metastore database. */ - @JsonProperty(value = "metastoreDbConnectionURL", required = true) private String metastoreDbConnectionUrl; /* * User name for database connection. */ - @JsonProperty(value = "metastoreDbConnectionUserName") private String metastoreDbConnectionUsername; /** @@ -139,10 +139,61 @@ public FlinkHiveCatalogOption withMetastoreDbConnectionUsername(String metastore */ public void validate() { if (metastoreDbConnectionUrl() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property metastoreDbConnectionUrl in model FlinkHiveCatalogOption")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metastoreDbConnectionUrl in model FlinkHiveCatalogOption")); } } private static final ClientLogger LOGGER = new ClientLogger(FlinkHiveCatalogOption.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metastoreDbConnectionURL", this.metastoreDbConnectionUrl); + jsonWriter.writeStringField("metastoreDbConnectionAuthenticationMode", + this.metastoreDbConnectionAuthenticationMode == null + ? null + : this.metastoreDbConnectionAuthenticationMode.toString()); + jsonWriter.writeStringField("metastoreDbConnectionPasswordSecret", this.metastoreDbConnectionPasswordSecret); + jsonWriter.writeStringField("metastoreDbConnectionUserName", this.metastoreDbConnectionUsername); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkHiveCatalogOption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkHiveCatalogOption if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlinkHiveCatalogOption. + */ + public static FlinkHiveCatalogOption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkHiveCatalogOption deserializedFlinkHiveCatalogOption = new FlinkHiveCatalogOption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metastoreDbConnectionURL".equals(fieldName)) { + deserializedFlinkHiveCatalogOption.metastoreDbConnectionUrl = reader.getString(); + } else if ("metastoreDbConnectionAuthenticationMode".equals(fieldName)) { + deserializedFlinkHiveCatalogOption.metastoreDbConnectionAuthenticationMode + = MetastoreDbConnectionAuthenticationMode.fromString(reader.getString()); + } else if ("metastoreDbConnectionPasswordSecret".equals(fieldName)) { + deserializedFlinkHiveCatalogOption.metastoreDbConnectionPasswordSecret = reader.getString(); + } else if ("metastoreDbConnectionUserName".equals(fieldName)) { + deserializedFlinkHiveCatalogOption.metastoreDbConnectionUsername = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkHiveCatalogOption; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProfile.java index 1cf93c222a66a..b68f6bf16b584 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProfile.java @@ -6,50 +6,48 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Job specifications for flink clusters in application deployment mode. The specification is immutable even if job * properties are changed by calling the RunJob API, please use the ListJob API to get the latest job information. */ @Fluent -public final class FlinkJobProfile { +public final class FlinkJobProfile implements JsonSerializable { /* * A string property that specifies the directory where the job JAR is located. */ - @JsonProperty(value = "jobJarDirectory", required = true) private String jobJarDirectory; /* * A string property that represents the name of the job JAR. */ - @JsonProperty(value = "jarName", required = true) private String jarName; /* * A string property that specifies the entry class for the Flink job. If not specified, the entry point is * auto-detected from the flink job jar package. */ - @JsonProperty(value = "entryClass") private String entryClass; /* * A string property representing additional JVM arguments for the Flink job. It should be space separated value. */ - @JsonProperty(value = "args") private String args; /* * A string property that represents the name of the savepoint for the Flink job */ - @JsonProperty(value = "savePointName") private String savePointName; /* * A string property that indicates the upgrade mode to be performed on the Flink job. It can have one of the * following enum values => STATELESS_UPDATE, UPDATE, LAST_STATE_UPDATE. */ - @JsonProperty(value = "upgradeMode", required = true) private UpgradeMode upgradeMode; /** @@ -163,8 +161,8 @@ public FlinkJobProfile withSavePointName(String savePointName) { } /** - * Get the upgradeMode property: A string property that indicates the upgrade mode to be performed on the Flink - * job. It can have one of the following enum values => STATELESS_UPDATE, UPDATE, LAST_STATE_UPDATE. + * Get the upgradeMode property: A string property that indicates the upgrade mode to be performed on the Flink job. + * It can have one of the following enum values => STATELESS_UPDATE, UPDATE, LAST_STATE_UPDATE. * * @return the upgradeMode value. */ @@ -173,8 +171,8 @@ public UpgradeMode upgradeMode() { } /** - * Set the upgradeMode property: A string property that indicates the upgrade mode to be performed on the Flink - * job. It can have one of the following enum values => STATELESS_UPDATE, UPDATE, LAST_STATE_UPDATE. + * Set the upgradeMode property: A string property that indicates the upgrade mode to be performed on the Flink job. + * It can have one of the following enum values => STATELESS_UPDATE, UPDATE, LAST_STATE_UPDATE. * * @param upgradeMode the upgradeMode value to set. * @return the FlinkJobProfile object itself. @@ -191,18 +189,71 @@ public FlinkJobProfile withUpgradeMode(UpgradeMode upgradeMode) { */ public void validate() { if (jobJarDirectory() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property jobJarDirectory in model FlinkJobProfile")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property jobJarDirectory in model FlinkJobProfile")); } if (jarName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property jarName in model FlinkJobProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property jarName in model FlinkJobProfile")); } if (upgradeMode() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property upgradeMode in model FlinkJobProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property upgradeMode in model FlinkJobProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(FlinkJobProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobJarDirectory", this.jobJarDirectory); + jsonWriter.writeStringField("jarName", this.jarName); + jsonWriter.writeStringField("upgradeMode", this.upgradeMode == null ? null : this.upgradeMode.toString()); + jsonWriter.writeStringField("entryClass", this.entryClass); + jsonWriter.writeStringField("args", this.args); + jsonWriter.writeStringField("savePointName", this.savePointName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkJobProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkJobProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlinkJobProfile. + */ + public static FlinkJobProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkJobProfile deserializedFlinkJobProfile = new FlinkJobProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobJarDirectory".equals(fieldName)) { + deserializedFlinkJobProfile.jobJarDirectory = reader.getString(); + } else if ("jarName".equals(fieldName)) { + deserializedFlinkJobProfile.jarName = reader.getString(); + } else if ("upgradeMode".equals(fieldName)) { + deserializedFlinkJobProfile.upgradeMode = UpgradeMode.fromString(reader.getString()); + } else if ("entryClass".equals(fieldName)) { + deserializedFlinkJobProfile.entryClass = reader.getString(); + } else if ("args".equals(fieldName)) { + deserializedFlinkJobProfile.args = reader.getString(); + } else if ("savePointName".equals(fieldName)) { + deserializedFlinkJobProfile.savePointName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkJobProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProperties.java index c8bd7e5b8c14e..4798bed61a5d1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkJobProperties.java @@ -5,66 +5,61 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Properties of flink job. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") -@JsonTypeName("FlinkJob") @Fluent public final class FlinkJobProperties extends ClusterJobProperties { + /* + * Type of cluster job. + */ + private JobType jobType = JobType.FLINK_JOB; + /* * Run id of job */ - @JsonProperty(value = "runId") private String runId; /* * Name of job */ - @JsonProperty(value = "jobName") private String jobName; /* * A string property that specifies the directory where the job JAR is located. */ - @JsonProperty(value = "jobJarDirectory") private String jobJarDirectory; /* * A string property that represents the name of the job JAR. */ - @JsonProperty(value = "jarName") private String jarName; /* * A string property that specifies the entry class for the Flink job. */ - @JsonProperty(value = "entryClass") private String entryClass; /* * A string property representing additional JVM arguments for the Flink job. It should be space separated value. */ - @JsonProperty(value = "args") private String args; /* * A string property that represents the name of the savepoint for the Flink job */ - @JsonProperty(value = "savePointName") private String savePointName; /* * A string property that indicates the action to be performed on the Flink job. It can have one of the following * enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, LIST_SAVEPOINT, or DELETE. */ - @JsonProperty(value = "action") private Action action; /* @@ -72,38 +67,31 @@ public final class FlinkJobProperties extends ClusterJobProperties { * jobSavePointDirectory. It accepts additional key-value pairs as properties, where the keys are strings and the * values are strings as well. */ - @JsonProperty(value = "flinkConfiguration") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map flinkConfiguration; /* * Unique id for identifying a job */ - @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) private String jobId; /* * Status of job. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; /* * Output of job. */ - @JsonProperty(value = "jobOutput", access = JsonProperty.Access.WRITE_ONLY) private String jobOutput; /* * Action result of job. */ - @JsonProperty(value = "actionResult", access = JsonProperty.Access.WRITE_ONLY) private String actionResult; /* * The last savepoint. */ - @JsonProperty(value = "lastSavePoint", access = JsonProperty.Access.WRITE_ONLY) private String lastSavePoint; /** @@ -112,6 +100,16 @@ public final class FlinkJobProperties extends ClusterJobProperties { public FlinkJobProperties() { } + /** + * Get the jobType property: Type of cluster job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + /** * Get the runId property: Run id of job. * @@ -356,4 +354,79 @@ public String lastSavePoint() { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeStringField("runId", this.runId); + jsonWriter.writeStringField("jobName", this.jobName); + jsonWriter.writeStringField("jobJarDirectory", this.jobJarDirectory); + jsonWriter.writeStringField("jarName", this.jarName); + jsonWriter.writeStringField("entryClass", this.entryClass); + jsonWriter.writeStringField("args", this.args); + jsonWriter.writeStringField("savePointName", this.savePointName); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeMapField("flinkConfiguration", this.flinkConfiguration, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkJobProperties 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 FlinkJobProperties. + */ + public static FlinkJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkJobProperties deserializedFlinkJobProperties = new FlinkJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedFlinkJobProperties.jobType = JobType.fromString(reader.getString()); + } else if ("runId".equals(fieldName)) { + deserializedFlinkJobProperties.runId = reader.getString(); + } else if ("jobName".equals(fieldName)) { + deserializedFlinkJobProperties.jobName = reader.getString(); + } else if ("jobJarDirectory".equals(fieldName)) { + deserializedFlinkJobProperties.jobJarDirectory = reader.getString(); + } else if ("jarName".equals(fieldName)) { + deserializedFlinkJobProperties.jarName = reader.getString(); + } else if ("entryClass".equals(fieldName)) { + deserializedFlinkJobProperties.entryClass = reader.getString(); + } else if ("args".equals(fieldName)) { + deserializedFlinkJobProperties.args = reader.getString(); + } else if ("savePointName".equals(fieldName)) { + deserializedFlinkJobProperties.savePointName = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedFlinkJobProperties.action = Action.fromString(reader.getString()); + } else if ("flinkConfiguration".equals(fieldName)) { + Map flinkConfiguration = reader.readMap(reader1 -> reader1.getString()); + deserializedFlinkJobProperties.flinkConfiguration = flinkConfiguration; + } else if ("jobId".equals(fieldName)) { + deserializedFlinkJobProperties.jobId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedFlinkJobProperties.status = reader.getString(); + } else if ("jobOutput".equals(fieldName)) { + deserializedFlinkJobProperties.jobOutput = reader.getString(); + } else if ("actionResult".equals(fieldName)) { + deserializedFlinkJobProperties.actionResult = reader.getString(); + } else if ("lastSavePoint".equals(fieldName)) { + deserializedFlinkJobProperties.lastSavePoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkJobProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkProfile.java index 2ed0b2016e070..4fc72ad39f29b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkProfile.java @@ -6,61 +6,57 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Flink cluster profile. */ @Fluent -public final class FlinkProfile { +public final class FlinkProfile implements JsonSerializable { /* * The storage profile */ - @JsonProperty(value = "storage", required = true) private FlinkStorageProfile storage; /* * The number of task managers. */ - @JsonProperty(value = "numReplicas") private Integer numReplicas; /* * Job Manager container/ process CPU and memory requirements */ - @JsonProperty(value = "jobManager", required = true) private ComputeResourceDefinition jobManager; /* * History Server container/ process CPU and memory requirements */ - @JsonProperty(value = "historyServer") private ComputeResourceDefinition historyServer; /* * Task Manager container/ process CPU and memory requirements */ - @JsonProperty(value = "taskManager", required = true) private ComputeResourceDefinition taskManager; /* * Flink cluster catalog options. */ - @JsonProperty(value = "catalogOptions") private FlinkCatalogOptions catalogOptions; /* * A string property that indicates the deployment mode of Flink cluster. It can have one of the following enum * values => Application, Session. Default value is Session */ - @JsonProperty(value = "deploymentMode") private DeploymentMode deploymentMode; /* * Job specifications for flink clusters in application deployment mode. The specification is immutable even if job * properties are changed by calling the RunJob API, please use the ListJob API to get the latest job information. */ - @JsonProperty(value = "jobSpec") private FlinkJobProfile jobSpec; /** @@ -212,9 +208,9 @@ public FlinkProfile withDeploymentMode(DeploymentMode deploymentMode) { } /** - * Get the jobSpec property: Job specifications for flink clusters in application deployment mode. The - * specification is immutable even if job properties are changed by calling the RunJob API, please use the ListJob - * API to get the latest job information. + * Get the jobSpec property: Job specifications for flink clusters in application deployment mode. The specification + * is immutable even if job properties are changed by calling the RunJob API, please use the ListJob API to get the + * latest job information. * * @return the jobSpec value. */ @@ -223,9 +219,9 @@ public FlinkJobProfile jobSpec() { } /** - * Set the jobSpec property: Job specifications for flink clusters in application deployment mode. The - * specification is immutable even if job properties are changed by calling the RunJob API, please use the ListJob - * API to get the latest job information. + * Set the jobSpec property: Job specifications for flink clusters in application deployment mode. The specification + * is immutable even if job properties are changed by calling the RunJob API, please use the ListJob API to get the + * latest job information. * * @param jobSpec the jobSpec value to set. * @return the FlinkProfile object itself. @@ -242,14 +238,14 @@ public FlinkProfile withJobSpec(FlinkJobProfile jobSpec) { */ public void validate() { if (storage() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property storage in model FlinkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property storage in model FlinkProfile")); } else { storage().validate(); } if (jobManager() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property jobManager in model FlinkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property jobManager in model FlinkProfile")); } else { jobManager().validate(); } @@ -257,8 +253,8 @@ public void validate() { historyServer().validate(); } if (taskManager() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property taskManager in model FlinkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property taskManager in model FlinkProfile")); } else { taskManager().validate(); } @@ -271,4 +267,63 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(FlinkProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storage", this.storage); + jsonWriter.writeJsonField("jobManager", this.jobManager); + jsonWriter.writeJsonField("taskManager", this.taskManager); + jsonWriter.writeNumberField("numReplicas", this.numReplicas); + jsonWriter.writeJsonField("historyServer", this.historyServer); + jsonWriter.writeJsonField("catalogOptions", this.catalogOptions); + jsonWriter.writeStringField("deploymentMode", + this.deploymentMode == null ? null : this.deploymentMode.toString()); + jsonWriter.writeJsonField("jobSpec", this.jobSpec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlinkProfile. + */ + public static FlinkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkProfile deserializedFlinkProfile = new FlinkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storage".equals(fieldName)) { + deserializedFlinkProfile.storage = FlinkStorageProfile.fromJson(reader); + } else if ("jobManager".equals(fieldName)) { + deserializedFlinkProfile.jobManager = ComputeResourceDefinition.fromJson(reader); + } else if ("taskManager".equals(fieldName)) { + deserializedFlinkProfile.taskManager = ComputeResourceDefinition.fromJson(reader); + } else if ("numReplicas".equals(fieldName)) { + deserializedFlinkProfile.numReplicas = reader.getNullable(JsonReader::getInt); + } else if ("historyServer".equals(fieldName)) { + deserializedFlinkProfile.historyServer = ComputeResourceDefinition.fromJson(reader); + } else if ("catalogOptions".equals(fieldName)) { + deserializedFlinkProfile.catalogOptions = FlinkCatalogOptions.fromJson(reader); + } else if ("deploymentMode".equals(fieldName)) { + deserializedFlinkProfile.deploymentMode = DeploymentMode.fromString(reader.getString()); + } else if ("jobSpec".equals(fieldName)) { + deserializedFlinkProfile.jobSpec = FlinkJobProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkStorageProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkStorageProfile.java index 10e24c81bffd1..86def0ff6daa5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkStorageProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/FlinkStorageProfile.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The storage profile. */ @Fluent -public final class FlinkStorageProfile { +public final class FlinkStorageProfile implements JsonSerializable { /* * Storage account uri which is used for savepoint and checkpoint state. */ - @JsonProperty(value = "storageUri", required = true) private String storageUri; /* * Storage key is only required for wasb(s) storage. */ - @JsonProperty(value = "storagekey") private String storagekey; /** @@ -78,10 +80,50 @@ public FlinkStorageProfile withStoragekey(String storagekey) { */ public void validate() { if (storageUri() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property storageUri in model FlinkStorageProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property storageUri in model FlinkStorageProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(FlinkStorageProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageUri", this.storageUri); + jsonWriter.writeStringField("storagekey", this.storagekey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlinkStorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlinkStorageProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlinkStorageProfile. + */ + public static FlinkStorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlinkStorageProfile deserializedFlinkStorageProfile = new FlinkStorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageUri".equals(fieldName)) { + deserializedFlinkStorageProfile.storageUri = reader.getString(); + } else if ("storagekey".equals(fieldName)) { + deserializedFlinkStorageProfile.storagekey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlinkStorageProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/HiveCatalogOption.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/HiveCatalogOption.java index 701aa749c2093..544133dfe2dad 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/HiveCatalogOption.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/HiveCatalogOption.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Hive Catalog Option. */ @Fluent -public final class HiveCatalogOption { +public final class HiveCatalogOption implements JsonSerializable { /* * Name of trino catalog which should use specified hive metastore. */ - @JsonProperty(value = "catalogName", required = true) private String catalogName; /* @@ -24,32 +27,27 @@ public final class HiveCatalogOption { * https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and- * authorization */ - @JsonProperty(value = "metastoreDbConnectionAuthenticationMode") private MetastoreDbConnectionAuthenticationMode metastoreDbConnectionAuthenticationMode; /* * Secret reference name from secretsProfile.secrets containing password for database connection. */ - @JsonProperty(value = "metastoreDbConnectionPasswordSecret") private String metastoreDbConnectionPasswordSecret; /* * Connection string for hive metastore database. */ - @JsonProperty(value = "metastoreDbConnectionURL", required = true) private String metastoreDbConnectionUrl; /* * User name for database connection. */ - @JsonProperty(value = "metastoreDbConnectionUserName") private String metastoreDbConnectionUsername; /* * Metastore root directory URI, format: abfs[s]://@.dfs.core.windows.net/. More * details: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri */ - @JsonProperty(value = "metastoreWarehouseDir", required = true) private String metastoreWarehouseDir; /** @@ -167,7 +165,7 @@ public HiveCatalogOption withMetastoreDbConnectionUsername(String metastoreDbCon /** * Get the metastoreWarehouseDir property: Metastore root directory URI, format: - * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: + * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: * https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. * * @return the metastoreWarehouseDir value. @@ -178,7 +176,7 @@ public String metastoreWarehouseDir() { /** * Set the metastoreWarehouseDir property: Metastore root directory URI, format: - * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: + * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: * https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. * * @param metastoreWarehouseDir the metastoreWarehouseDir value to set. @@ -196,18 +194,76 @@ public HiveCatalogOption withMetastoreWarehouseDir(String metastoreWarehouseDir) */ public void validate() { if (catalogName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property catalogName in model HiveCatalogOption")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property catalogName in model HiveCatalogOption")); } if (metastoreDbConnectionUrl() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property metastoreDbConnectionUrl in model HiveCatalogOption")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metastoreDbConnectionUrl in model HiveCatalogOption")); } if (metastoreWarehouseDir() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property metastoreWarehouseDir in model HiveCatalogOption")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metastoreWarehouseDir in model HiveCatalogOption")); } } private static final ClientLogger LOGGER = new ClientLogger(HiveCatalogOption.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("catalogName", this.catalogName); + jsonWriter.writeStringField("metastoreDbConnectionURL", this.metastoreDbConnectionUrl); + jsonWriter.writeStringField("metastoreWarehouseDir", this.metastoreWarehouseDir); + jsonWriter.writeStringField("metastoreDbConnectionAuthenticationMode", + this.metastoreDbConnectionAuthenticationMode == null + ? null + : this.metastoreDbConnectionAuthenticationMode.toString()); + jsonWriter.writeStringField("metastoreDbConnectionPasswordSecret", this.metastoreDbConnectionPasswordSecret); + jsonWriter.writeStringField("metastoreDbConnectionUserName", this.metastoreDbConnectionUsername); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HiveCatalogOption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HiveCatalogOption if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HiveCatalogOption. + */ + public static HiveCatalogOption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HiveCatalogOption deserializedHiveCatalogOption = new HiveCatalogOption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("catalogName".equals(fieldName)) { + deserializedHiveCatalogOption.catalogName = reader.getString(); + } else if ("metastoreDbConnectionURL".equals(fieldName)) { + deserializedHiveCatalogOption.metastoreDbConnectionUrl = reader.getString(); + } else if ("metastoreWarehouseDir".equals(fieldName)) { + deserializedHiveCatalogOption.metastoreWarehouseDir = reader.getString(); + } else if ("metastoreDbConnectionAuthenticationMode".equals(fieldName)) { + deserializedHiveCatalogOption.metastoreDbConnectionAuthenticationMode + = MetastoreDbConnectionAuthenticationMode.fromString(reader.getString()); + } else if ("metastoreDbConnectionPasswordSecret".equals(fieldName)) { + deserializedHiveCatalogOption.metastoreDbConnectionPasswordSecret = reader.getString(); + } else if ("metastoreDbConnectionUserName".equals(fieldName)) { + deserializedHiveCatalogOption.metastoreDbConnectionUsername = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHiveCatalogOption; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IdentityProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IdentityProfile.java index ed03b30988646..1d576af037cb1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IdentityProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IdentityProfile.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Identity Profile with details of an MSI. */ @Fluent -public class IdentityProfile { +public class IdentityProfile implements JsonSerializable { /* * ResourceId of the MSI. */ - @JsonProperty(value = "msiResourceId", required = true) private String msiResourceId; /* * ClientId of the MSI. */ - @JsonProperty(value = "msiClientId", required = true) private String msiClientId; /* * ObjectId of the MSI. */ - @JsonProperty(value = "msiObjectId", required = true) private String msiObjectId; /** @@ -104,18 +105,61 @@ public IdentityProfile withMsiObjectId(String msiObjectId) { */ public void validate() { if (msiResourceId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property msiResourceId in model IdentityProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property msiResourceId in model IdentityProfile")); } if (msiClientId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property msiClientId in model IdentityProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property msiClientId in model IdentityProfile")); } if (msiObjectId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property msiObjectId in model IdentityProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property msiObjectId in model IdentityProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(IdentityProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("msiResourceId", this.msiResourceId); + jsonWriter.writeStringField("msiClientId", this.msiClientId); + jsonWriter.writeStringField("msiObjectId", this.msiObjectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IdentityProfile. + */ + public static IdentityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityProfile deserializedIdentityProfile = new IdentityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("msiResourceId".equals(fieldName)) { + deserializedIdentityProfile.msiResourceId = reader.getString(); + } else if ("msiClientId".equals(fieldName)) { + deserializedIdentityProfile.msiClientId = reader.getString(); + } else if ("msiObjectId".equals(fieldName)) { + deserializedIdentityProfile.msiObjectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IpTag.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IpTag.java new file mode 100644 index 0000000000000..eedda0d3a868b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/IpTag.java @@ -0,0 +1,134 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the IpTag associated with the public IP address. + */ +@Fluent +public final class IpTag implements JsonSerializable { + /* + * Gets or sets the ipTag type: Example FirstPartyUsage. + */ + private String ipTagType; + + /* + * Gets or sets value of the IpTag associated with the public IP. Example HDInsight, SQL, Storage etc + */ + private String tag; + + /** + * Creates an instance of IpTag class. + */ + public IpTag() { + } + + /** + * Get the ipTagType property: Gets or sets the ipTag type: Example FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: Gets or sets the ipTag type: Example FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: Gets or sets value of the IpTag associated with the public IP. Example HDInsight, SQL, + * Storage etc. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: Gets or sets value of the IpTag associated with the public IP. Example HDInsight, SQL, + * Storage etc. + * + * @param tag the tag value to set. + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipTagType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ipTagType in model IpTag")); + } + if (tag() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property tag in model IpTag")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpTag.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipTagType", this.ipTagType); + jsonWriter.writeStringField("tag", this.tag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpTag if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpTag. + */ + public static IpTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpTag deserializedIpTag = new IpTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipTagType".equals(fieldName)) { + deserializedIpTag.ipTagType = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedIpTag.tag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpTag; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/JobType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/JobType.java index c93e0fa233742..d97b651bc9ab6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/JobType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/JobType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public JobType() { * @param name a name to look for. * @return the corresponding JobType. */ - @JsonCreator public static JobType fromString(String name) { return fromString(name, JobType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaConnectivityEndpoints.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaConnectivityEndpoints.java index 84c825a7997dc..a0a60ee779505 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaConnectivityEndpoints.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaConnectivityEndpoints.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Kafka bootstrap server and broker related connectivity endpoints. */ @Fluent -public final class KafkaConnectivityEndpoints { +public final class KafkaConnectivityEndpoints implements JsonSerializable { /* * bootstrap server connectivity endpoint. */ - @JsonProperty(value = "bootstrapServerEndpoint") private String bootstrapServerEndpoint; /* * Kafka broker endpoint list. */ - @JsonProperty(value = "brokerEndpoints") private List brokerEndpoints; /** @@ -78,4 +80,45 @@ public KafkaConnectivityEndpoints withBrokerEndpoints(List brokerEndpoin */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bootstrapServerEndpoint", this.bootstrapServerEndpoint); + jsonWriter.writeArrayField("brokerEndpoints", this.brokerEndpoints, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KafkaConnectivityEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KafkaConnectivityEndpoints 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 KafkaConnectivityEndpoints. + */ + public static KafkaConnectivityEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KafkaConnectivityEndpoints deserializedKafkaConnectivityEndpoints = new KafkaConnectivityEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bootstrapServerEndpoint".equals(fieldName)) { + deserializedKafkaConnectivityEndpoints.bootstrapServerEndpoint = reader.getString(); + } else if ("brokerEndpoints".equals(fieldName)) { + List brokerEndpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedKafkaConnectivityEndpoints.brokerEndpoints = brokerEndpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedKafkaConnectivityEndpoints; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaProfile.java index aa7967ba34818..adde24165fe09 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KafkaProfile.java @@ -6,47 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Kafka cluster profile. */ @Fluent -public final class KafkaProfile { +public final class KafkaProfile implements JsonSerializable { /* * Expose Kafka cluster in KRaft mode. */ - @JsonProperty(value = "enableKRaft") private Boolean enableKRaft; /* * Expose worker nodes as public endpoints. */ - @JsonProperty(value = "enablePublicEndpoints") private Boolean enablePublicEndpoints; /* * Fully qualified path of Azure Storage container used for Tiered Storage. */ - @JsonProperty(value = "remoteStorageUri") private String remoteStorageUri; /* * Kafka disk storage profile. */ - @JsonProperty(value = "diskStorage", required = true) private DiskStorageProfile diskStorage; - /* - * Identity of the internal service components inside the Kafka cluster. - */ - @JsonProperty(value = "clusterIdentity", access = JsonProperty.Access.WRITE_ONLY) - private IdentityProfile clusterIdentity; - /* * Kafka bootstrap server and brokers related connectivity endpoints. */ - @JsonProperty(value = "connectivityEndpoints", access = JsonProperty.Access.WRITE_ONLY) private KafkaConnectivityEndpoints connectivityEndpoints; /** @@ -135,15 +128,6 @@ public KafkaProfile withDiskStorage(DiskStorageProfile diskStorage) { return this; } - /** - * Get the clusterIdentity property: Identity of the internal service components inside the Kafka cluster. - * - * @return the clusterIdentity value. - */ - public IdentityProfile clusterIdentity() { - return this.clusterIdentity; - } - /** * Get the connectivityEndpoints property: Kafka bootstrap server and brokers related connectivity endpoints. * @@ -160,18 +144,63 @@ public KafkaConnectivityEndpoints connectivityEndpoints() { */ public void validate() { if (diskStorage() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property diskStorage in model KafkaProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property diskStorage in model KafkaProfile")); } else { diskStorage().validate(); } - if (clusterIdentity() != null) { - clusterIdentity().validate(); - } if (connectivityEndpoints() != null) { connectivityEndpoints().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(KafkaProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("diskStorage", this.diskStorage); + jsonWriter.writeBooleanField("enableKRaft", this.enableKRaft); + jsonWriter.writeBooleanField("enablePublicEndpoints", this.enablePublicEndpoints); + jsonWriter.writeStringField("remoteStorageUri", this.remoteStorageUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KafkaProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KafkaProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KafkaProfile. + */ + public static KafkaProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KafkaProfile deserializedKafkaProfile = new KafkaProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskStorage".equals(fieldName)) { + deserializedKafkaProfile.diskStorage = DiskStorageProfile.fromJson(reader); + } else if ("enableKRaft".equals(fieldName)) { + deserializedKafkaProfile.enableKRaft = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePublicEndpoints".equals(fieldName)) { + deserializedKafkaProfile.enablePublicEndpoints = reader.getNullable(JsonReader::getBoolean); + } else if ("remoteStorageUri".equals(fieldName)) { + deserializedKafkaProfile.remoteStorageUri = reader.getString(); + } else if ("connectivityEndpoints".equals(fieldName)) { + deserializedKafkaProfile.connectivityEndpoints = KafkaConnectivityEndpoints.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKafkaProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KeyVaultObjectType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KeyVaultObjectType.java index 00111cb4dc6d0..f764e0a5f115e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KeyVaultObjectType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/KeyVaultObjectType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public KeyVaultObjectType() { * @param name a name to look for. * @return the corresponding KeyVaultObjectType. */ - @JsonCreator public static KeyVaultObjectType fromString(String name) { return fromString(name, KeyVaultObjectType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LibraryManagementAction.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LibraryManagementAction.java new file mode 100644 index 0000000000000..fca095d77c70c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LibraryManagementAction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The library management action. + */ +public final class LibraryManagementAction extends ExpandableStringEnum { + /** + * Static value Install for LibraryManagementAction. + */ + public static final LibraryManagementAction INSTALL = fromString("Install"); + + /** + * Static value Uninstall for LibraryManagementAction. + */ + public static final LibraryManagementAction UNINSTALL = fromString("Uninstall"); + + /** + * Creates a new instance of LibraryManagementAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LibraryManagementAction() { + } + + /** + * Creates or finds a LibraryManagementAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LibraryManagementAction. + */ + public static LibraryManagementAction fromString(String name) { + return fromString(name, LibraryManagementAction.class); + } + + /** + * Gets known LibraryManagementAction values. + * + * @return known LibraryManagementAction values. + */ + public static Collection values() { + return values(LibraryManagementAction.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LoadBasedConfig.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LoadBasedConfig.java index 937be25ef40c4..4fa6158b4425a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LoadBasedConfig.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/LoadBasedConfig.java @@ -6,47 +6,46 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Profile of load based Autoscale. */ @Fluent -public final class LoadBasedConfig { +public final class LoadBasedConfig implements JsonSerializable { /* * User needs to set the minimum number of nodes for load based scaling, the load based scaling will use this to * scale up and scale down between minimum and maximum number of nodes. */ - @JsonProperty(value = "minNodes", required = true) private int minNodes; /* * User needs to set the maximum number of nodes for load based scaling, the load based scaling will use this to * scale up and scale down between minimum and maximum number of nodes. */ - @JsonProperty(value = "maxNodes", required = true) private int maxNodes; /* * User can specify the poll interval, this is the time period (in seconds) after which scaling metrics are polled * for triggering a scaling operation. */ - @JsonProperty(value = "pollInterval") private Integer pollInterval; /* * This is a cool down period, this is a time period in seconds, which determines the amount of time that must - * elapse between a scaling activity started by a rule and the start of the next scaling activity, regardless of - * the rule that triggers it. The default value is 300 seconds. + * elapse between a scaling activity started by a rule and the start of the next scaling activity, regardless of the + * rule that triggers it. The default value is 300 seconds. */ - @JsonProperty(value = "cooldownPeriod") private Integer cooldownPeriod; /* * The scaling rules. */ - @JsonProperty(value = "scalingRules", required = true) private List scalingRules; /** @@ -172,12 +171,62 @@ public LoadBasedConfig withScalingRules(List scalingRules) { */ public void validate() { if (scalingRules() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property scalingRules in model LoadBasedConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property scalingRules in model LoadBasedConfig")); } else { scalingRules().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(LoadBasedConfig.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("minNodes", this.minNodes); + jsonWriter.writeIntField("maxNodes", this.maxNodes); + jsonWriter.writeArrayField("scalingRules", this.scalingRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("pollInterval", this.pollInterval); + jsonWriter.writeNumberField("cooldownPeriod", this.cooldownPeriod); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBasedConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBasedConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadBasedConfig. + */ + public static LoadBasedConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBasedConfig deserializedLoadBasedConfig = new LoadBasedConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minNodes".equals(fieldName)) { + deserializedLoadBasedConfig.minNodes = reader.getInt(); + } else if ("maxNodes".equals(fieldName)) { + deserializedLoadBasedConfig.maxNodes = reader.getInt(); + } else if ("scalingRules".equals(fieldName)) { + List scalingRules = reader.readArray(reader1 -> ScalingRule.fromJson(reader1)); + deserializedLoadBasedConfig.scalingRules = scalingRules; + } else if ("pollInterval".equals(fieldName)) { + deserializedLoadBasedConfig.pollInterval = reader.getNullable(JsonReader::getInt); + } else if ("cooldownPeriod".equals(fieldName)) { + deserializedLoadBasedConfig.cooldownPeriod = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBasedConfig; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityProfile.java new file mode 100644 index 0000000000000..d9aeda07c8be1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityProfile.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The details of managed identity. + */ +@Fluent +public final class ManagedIdentityProfile implements JsonSerializable { + /* + * The list of managed identity. + */ + private List identityList; + + /** + * Creates an instance of ManagedIdentityProfile class. + */ + public ManagedIdentityProfile() { + } + + /** + * Get the identityList property: The list of managed identity. + * + * @return the identityList value. + */ + public List identityList() { + return this.identityList; + } + + /** + * Set the identityList property: The list of managed identity. + * + * @param identityList the identityList value to set. + * @return the ManagedIdentityProfile object itself. + */ + public ManagedIdentityProfile withIdentityList(List identityList) { + this.identityList = identityList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identityList() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property identityList in model ManagedIdentityProfile")); + } else { + identityList().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedIdentityProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("identityList", this.identityList, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedIdentityProfile. + */ + public static ManagedIdentityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityProfile deserializedManagedIdentityProfile = new ManagedIdentityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityList".equals(fieldName)) { + List identityList + = reader.readArray(reader1 -> ManagedIdentitySpec.fromJson(reader1)); + deserializedManagedIdentityProfile.identityList = identityList; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityProfile; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentitySpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentitySpec.java new file mode 100644 index 0000000000000..aa2173d8dbf1e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentitySpec.java @@ -0,0 +1,197 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The details of a managed identity. + */ +@Fluent +public final class ManagedIdentitySpec implements JsonSerializable { + /* + * The type of managed identity. + */ + private ManagedIdentityType type; + + /* + * ResourceId of the managed identity. + */ + private String resourceId; + + /* + * ClientId of the managed identity. + */ + private String clientId; + + /* + * ObjectId of the managed identity. + */ + private String objectId; + + /** + * Creates an instance of ManagedIdentitySpec class. + */ + public ManagedIdentitySpec() { + } + + /** + * Get the type property: The type of managed identity. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity. + * + * @param type the type value to set. + * @return the ManagedIdentitySpec object itself. + */ + public ManagedIdentitySpec withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the resourceId property: ResourceId of the managed identity. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: ResourceId of the managed identity. + * + * @param resourceId the resourceId value to set. + * @return the ManagedIdentitySpec object itself. + */ + public ManagedIdentitySpec withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the clientId property: ClientId of the managed identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: ClientId of the managed identity. + * + * @param clientId the clientId value to set. + * @return the ManagedIdentitySpec object itself. + */ + public ManagedIdentitySpec withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the objectId property: ObjectId of the managed identity. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: ObjectId of the managed identity. + * + * @param objectId the objectId value to set. + * @return the ManagedIdentitySpec object itself. + */ + public ManagedIdentitySpec withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedIdentitySpec")); + } + if (resourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resourceId in model ManagedIdentitySpec")); + } + if (clientId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clientId in model ManagedIdentitySpec")); + } + if (objectId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property objectId in model ManagedIdentitySpec")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedIdentitySpec.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("objectId", this.objectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentitySpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentitySpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedIdentitySpec. + */ + public static ManagedIdentitySpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentitySpec deserializedManagedIdentitySpec = new ManagedIdentitySpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedIdentitySpec.type = ManagedIdentityType.fromString(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedManagedIdentitySpec.resourceId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedManagedIdentitySpec.clientId = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedManagedIdentitySpec.objectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentitySpec; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityType.java new file mode 100644 index 0000000000000..3bc604c2c8414 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ManagedIdentityType.java @@ -0,0 +1,56 @@ +// 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.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of managed identity. + */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** + * Static value cluster for ManagedIdentityType. + */ + public static final ManagedIdentityType CLUSTER = fromString("cluster"); + + /** + * Static value user for ManagedIdentityType. + */ + public static final ManagedIdentityType USER = fromString("user"); + + /** + * Static value internal for ManagedIdentityType. + */ + public static final ManagedIdentityType INTERNAL = fromString("internal"); + + /** + * Creates a new instance of ManagedIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedIdentityType() { + } + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** + * Gets known ManagedIdentityType values. + * + * @return known ManagedIdentityType values. + */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MavenLibraryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MavenLibraryProperties.java new file mode 100644 index 0000000000000..a2deb2148320e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MavenLibraryProperties.java @@ -0,0 +1,246 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of a Maven library in the cluster. + */ +@Fluent +public final class MavenLibraryProperties extends ClusterLibraryProperties { + /* + * Type of the library. + */ + private Type type = Type.MAVEN; + + /* + * GroupId of the Maven package. + */ + private String groupId; + + /* + * ArtifactId of the Maven package. + */ + private String name; + + /* + * Version of the Maven package. + */ + private String version; + + /* + * Timestamp of the latest library management operation. + */ + private OffsetDateTime timestamp; + + /* + * Status of the library. + */ + private Status status; + + /* + * Error message of the library operation when a failure occurs. + */ + private String message; + + /** + * Creates an instance of MavenLibraryProperties class. + */ + public MavenLibraryProperties() { + } + + /** + * Get the type property: Type of the library. + * + * @return the type value. + */ + @Override + public Type type() { + return this.type; + } + + /** + * Get the groupId property: GroupId of the Maven package. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: GroupId of the Maven package. + * + * @param groupId the groupId value to set. + * @return the MavenLibraryProperties object itself. + */ + public MavenLibraryProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the name property: ArtifactId of the Maven package. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: ArtifactId of the Maven package. + * + * @param name the name value to set. + * @return the MavenLibraryProperties object itself. + */ + public MavenLibraryProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: Version of the Maven package. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the Maven package. + * + * @param version the version value to set. + * @return the MavenLibraryProperties object itself. + */ + public MavenLibraryProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the timestamp property: Timestamp of the latest library management operation. + * + * @return the timestamp value. + */ + @Override + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the status property: Status of the library. + * + * @return the status value. + */ + @Override + public Status status() { + return this.status; + } + + /** + * Get the message property: Error message of the library operation when a failure occurs. + * + * @return the message value. + */ + @Override + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public MavenLibraryProperties withRemarks(String remarks) { + super.withRemarks(remarks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (groupId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property groupId in model MavenLibraryProperties")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model MavenLibraryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MavenLibraryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remarks", remarks()); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MavenLibraryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MavenLibraryProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MavenLibraryProperties. + */ + public static MavenLibraryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MavenLibraryProperties deserializedMavenLibraryProperties = new MavenLibraryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remarks".equals(fieldName)) { + deserializedMavenLibraryProperties.withRemarks(reader.getString()); + } else if ("timestamp".equals(fieldName)) { + deserializedMavenLibraryProperties.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedMavenLibraryProperties.status = Status.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedMavenLibraryProperties.message = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedMavenLibraryProperties.groupId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMavenLibraryProperties.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMavenLibraryProperties.type = Type.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMavenLibraryProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMavenLibraryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MetastoreDbConnectionAuthenticationMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MetastoreDbConnectionAuthenticationMode.java index 0e7f6e13fe88b..15f9410ebfdd5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MetastoreDbConnectionAuthenticationMode.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/MetastoreDbConnectionAuthenticationMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public MetastoreDbConnectionAuthenticationMode() { * @param name a name to look for. * @return the corresponding MetastoreDbConnectionAuthenticationMode. */ - @JsonCreator public static MetastoreDbConnectionAuthenticationMode fromString(String name) { return fromString(name, MetastoreDbConnectionAuthenticationMode.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NameAvailabilityParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NameAvailabilityParameters.java index 3633fbd66dc65..0964bdedf96d3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NameAvailabilityParameters.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NameAvailabilityParameters.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 check name availability request body. */ @Fluent -public final class NameAvailabilityParameters { +public final class NameAvailabilityParameters implements JsonSerializable { /* * Name for checking availability. */ - @JsonProperty(value = "name") private String name; /* * The resource type in Microsoft.HDInsight. */ - @JsonProperty(value = "type") private String type; /** @@ -77,4 +79,43 @@ public NameAvailabilityParameters withType(String type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameAvailabilityParameters 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 NameAvailabilityParameters. + */ + public static NameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameAvailabilityParameters deserializedNameAvailabilityParameters = new NameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameAvailabilityParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNameAvailabilityParameters.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameAvailabilityParameters; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NodeProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NodeProfile.java index 58ef2fb4854d7..3ae941ba9639c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NodeProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/NodeProfile.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The node profile. */ @Fluent -public final class NodeProfile { +public final class NodeProfile implements JsonSerializable { /* * The node type. */ - @JsonProperty(value = "type", required = true) private String type; /* * The virtual machine SKU. */ - @JsonProperty(value = "vmSize", required = true) private String vmSize; /* * The number of virtual machines. */ - @JsonProperty(value = "count", required = true) private int count; /** @@ -104,14 +105,57 @@ public NodeProfile withCount(int count) { */ public void validate() { if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model NodeProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model NodeProfile")); } if (vmSize() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vmSize in model NodeProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vmSize in model NodeProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(NodeProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeIntField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodeProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NodeProfile. + */ + public static NodeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodeProfile deserializedNodeProfile = new NodeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedNodeProfile.type = reader.getString(); + } else if ("vmSize".equals(fieldName)) { + deserializedNodeProfile.vmSize = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedNodeProfile.count = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedNodeProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationDisplay.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationDisplay.java index 561d7841b97a0..4cda8f158bb49 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationDisplay.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationDisplay.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information for this particular operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** @@ -92,4 +92,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationListResult.java index 0eea4cce5a90e..932f2e7bae0c1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OperationListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * URL to get the next set of operation list results (if there are any). */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -61,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Origin.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Origin.java index 75105959db47b..80cf1334618e1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Origin.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OutboundType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OutboundType.java index c55dc3ed98738..982e8bcb633d3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OutboundType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/OutboundType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public OutboundType() { * @param name a name to look for. * @return the corresponding OutboundType. */ - @JsonCreator public static OutboundType fromString(String name) { return fromString(name, OutboundType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ProvisioningStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ProvisioningStatus.java index e840ff79ca6c3..a9677fc9d66bb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ProvisioningStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ProvisioningStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ProvisioningStatus() { * @param name a name to look for. * @return the corresponding ProvisioningStatus. */ - @JsonCreator public static ProvisioningStatus fromString(String name) { return fromString(name, ProvisioningStatus.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/PyPiLibraryProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/PyPiLibraryProperties.java new file mode 100644 index 0000000000000..ad0c7df477a2f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/PyPiLibraryProperties.java @@ -0,0 +1,214 @@ +// 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.containers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of a PyPi library in the cluster. + */ +@Fluent +public final class PyPiLibraryProperties extends ClusterLibraryProperties { + /* + * Type of the library. + */ + private Type type = Type.PYPI; + + /* + * Name of the PyPi package. + */ + private String name; + + /* + * Version of the PyPi package. + */ + private String version; + + /* + * Timestamp of the latest library management operation. + */ + private OffsetDateTime timestamp; + + /* + * Status of the library. + */ + private Status status; + + /* + * Error message of the library operation when a failure occurs. + */ + private String message; + + /** + * Creates an instance of PyPiLibraryProperties class. + */ + public PyPiLibraryProperties() { + } + + /** + * Get the type property: Type of the library. + * + * @return the type value. + */ + @Override + public Type type() { + return this.type; + } + + /** + * Get the name property: Name of the PyPi package. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the PyPi package. + * + * @param name the name value to set. + * @return the PyPiLibraryProperties object itself. + */ + public PyPiLibraryProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: Version of the PyPi package. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the PyPi package. + * + * @param version the version value to set. + * @return the PyPiLibraryProperties object itself. + */ + public PyPiLibraryProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the timestamp property: Timestamp of the latest library management operation. + * + * @return the timestamp value. + */ + @Override + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the status property: Status of the library. + * + * @return the status value. + */ + @Override + public Status status() { + return this.status; + } + + /** + * Get the message property: Error message of the library operation when a failure occurs. + * + * @return the message value. + */ + @Override + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public PyPiLibraryProperties withRemarks(String remarks) { + super.withRemarks(remarks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model PyPiLibraryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PyPiLibraryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remarks", remarks()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PyPiLibraryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PyPiLibraryProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PyPiLibraryProperties. + */ + public static PyPiLibraryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PyPiLibraryProperties deserializedPyPiLibraryProperties = new PyPiLibraryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remarks".equals(fieldName)) { + deserializedPyPiLibraryProperties.withRemarks(reader.getString()); + } else if ("timestamp".equals(fieldName)) { + deserializedPyPiLibraryProperties.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedPyPiLibraryProperties.status = Status.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedPyPiLibraryProperties.message = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPyPiLibraryProperties.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPyPiLibraryProperties.type = Type.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedPyPiLibraryProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPyPiLibraryProperties; + }); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpec.java index 050052b6fb950..e820bafc040c9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpec.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpec.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Specification for the Ranger Admin service. */ @Fluent -public final class RangerAdminSpec { +public final class RangerAdminSpec implements JsonSerializable { /* * List of usernames that should be marked as ranger admins. These usernames should match the user principal name * (UPN) of the respective AAD users. */ - @JsonProperty(value = "admins", required = true) private List admins; /* * The database property. */ - @JsonProperty(value = "database", required = true) private RangerAdminSpecDatabase database; /** @@ -82,16 +84,57 @@ public RangerAdminSpec withDatabase(RangerAdminSpecDatabase database) { */ public void validate() { if (admins() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property admins in model RangerAdminSpec")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property admins in model RangerAdminSpec")); } if (database() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property database in model RangerAdminSpec")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property database in model RangerAdminSpec")); } else { database().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(RangerAdminSpec.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("admins", this.admins, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("database", this.database); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RangerAdminSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RangerAdminSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RangerAdminSpec. + */ + public static RangerAdminSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RangerAdminSpec deserializedRangerAdminSpec = new RangerAdminSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("admins".equals(fieldName)) { + List admins = reader.readArray(reader1 -> reader1.getString()); + deserializedRangerAdminSpec.admins = admins; + } else if ("database".equals(fieldName)) { + deserializedRangerAdminSpec.database = RangerAdminSpecDatabase.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRangerAdminSpec; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpecDatabase.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpecDatabase.java index 2843e156d7bf8..4d114f91e1b02 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpecDatabase.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAdminSpecDatabase.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The RangerAdminSpecDatabase model. */ @Fluent -public final class RangerAdminSpecDatabase { +public final class RangerAdminSpecDatabase implements JsonSerializable { /* * The database URL */ - @JsonProperty(value = "host", required = true) private String host; /* * The database name */ - @JsonProperty(value = "name", required = true) private String name; /* * Reference for the database password */ - @JsonProperty(value = "passwordSecretRef") private String passwordSecretRef; /* * The name of the database user */ - @JsonProperty(value = "username") private String username; /** @@ -130,14 +130,60 @@ public RangerAdminSpecDatabase withUsername(String username) { */ public void validate() { if (host() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property host in model RangerAdminSpecDatabase")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property host in model RangerAdminSpecDatabase")); } if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model RangerAdminSpecDatabase")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model RangerAdminSpecDatabase")); } } private static final ClientLogger LOGGER = new ClientLogger(RangerAdminSpecDatabase.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("passwordSecretRef", this.passwordSecretRef); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RangerAdminSpecDatabase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RangerAdminSpecDatabase if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RangerAdminSpecDatabase. + */ + public static RangerAdminSpecDatabase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RangerAdminSpecDatabase deserializedRangerAdminSpecDatabase = new RangerAdminSpecDatabase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("host".equals(fieldName)) { + deserializedRangerAdminSpecDatabase.host = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRangerAdminSpecDatabase.name = reader.getString(); + } else if ("passwordSecretRef".equals(fieldName)) { + deserializedRangerAdminSpecDatabase.passwordSecretRef = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedRangerAdminSpecDatabase.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRangerAdminSpecDatabase; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAuditSpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAuditSpec.java index f85be4b757729..b53560af1000d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAuditSpec.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerAuditSpec.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties required to describe audit log storage. */ @Fluent -public final class RangerAuditSpec { +public final class RangerAuditSpec implements JsonSerializable { /* * Azure storage location of the blobs. MSI should have read/write access to this Storage account. */ - @JsonProperty(value = "storageAccount") private String storageAccount; /** @@ -53,4 +56,40 @@ public RangerAuditSpec withStorageAccount(String storageAccount) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageAccount", this.storageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RangerAuditSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RangerAuditSpec 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 RangerAuditSpec. + */ + public static RangerAuditSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RangerAuditSpec deserializedRangerAuditSpec = new RangerAuditSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccount".equals(fieldName)) { + deserializedRangerAuditSpec.storageAccount = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRangerAuditSpec; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerProfile.java index a775be5f0bedc..06dd70158b557 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerProfile.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The ranger cluster profile. */ @Fluent -public final class RangerProfile { +public final class RangerProfile implements JsonSerializable { /* * Specification for the Ranger Admin service. */ - @JsonProperty(value = "rangerAdmin", required = true) private RangerAdminSpec rangerAdmin; /* * Properties required to describe audit log storage. */ - @JsonProperty(value = "rangerAudit") private RangerAuditSpec rangerAudit; /* * Specification for the Ranger Usersync service */ - @JsonProperty(value = "rangerUsersync", required = true) private RangerUsersyncSpec rangerUsersync; /** @@ -104,8 +105,8 @@ public RangerProfile withRangerUsersync(RangerUsersyncSpec rangerUsersync) { */ public void validate() { if (rangerAdmin() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rangerAdmin in model RangerProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rangerAdmin in model RangerProfile")); } else { rangerAdmin().validate(); } @@ -113,12 +114,55 @@ public void validate() { rangerAudit().validate(); } if (rangerUsersync() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rangerUsersync in model RangerProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rangerUsersync in model RangerProfile")); } else { rangerUsersync().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(RangerProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("rangerAdmin", this.rangerAdmin); + jsonWriter.writeJsonField("rangerUsersync", this.rangerUsersync); + jsonWriter.writeJsonField("rangerAudit", this.rangerAudit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RangerProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RangerProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RangerProfile. + */ + public static RangerProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RangerProfile deserializedRangerProfile = new RangerProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rangerAdmin".equals(fieldName)) { + deserializedRangerProfile.rangerAdmin = RangerAdminSpec.fromJson(reader); + } else if ("rangerUsersync".equals(fieldName)) { + deserializedRangerProfile.rangerUsersync = RangerUsersyncSpec.fromJson(reader); + } else if ("rangerAudit".equals(fieldName)) { + deserializedRangerProfile.rangerAudit = RangerAuditSpec.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRangerProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncMode.java index beaabda440301..0e1f5dcc5df96 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncMode.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public RangerUsersyncMode() { * @param name a name to look for. * @return the corresponding RangerUsersyncMode. */ - @JsonCreator public static RangerUsersyncMode fromString(String name) { return fromString(name, RangerUsersyncMode.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncSpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncSpec.java index 76577cbf9b360..5d7a472e39017 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncSpec.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/RangerUsersyncSpec.java @@ -5,43 +5,42 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Specification for the Ranger Usersync service. */ @Fluent -public final class RangerUsersyncSpec { +public final class RangerUsersyncSpec implements JsonSerializable { /* * Denotes whether usersync service should be enabled */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * List of groups that should be synced. These group names should match the object id of the respective AAD groups. */ - @JsonProperty(value = "groups") private List groups; /* * User & groups can be synced automatically or via a static list that's refreshed. */ - @JsonProperty(value = "mode") private RangerUsersyncMode mode; /* * Azure storage location of a mapping file that lists user & group associations. */ - @JsonProperty(value = "userMappingLocation") private String userMappingLocation; /* * List of user names that should be synced. These usernames should match the User principal name of the respective * AAD users. */ - @JsonProperty(value = "users") private List users; /** @@ -135,8 +134,8 @@ public RangerUsersyncSpec withUserMappingLocation(String userMappingLocation) { } /** - * Get the users property: List of user names that should be synced. These usernames should match the User - * principal name of the respective AAD users. + * Get the users property: List of user names that should be synced. These usernames should match the User principal + * name of the respective AAD users. * * @return the users value. */ @@ -145,8 +144,8 @@ public List users() { } /** - * Set the users property: List of user names that should be synced. These usernames should match the User - * principal name of the respective AAD users. + * Set the users property: List of user names that should be synced. These usernames should match the User principal + * name of the respective AAD users. * * @param users the users value to set. * @return the RangerUsersyncSpec object itself. @@ -163,4 +162,54 @@ public RangerUsersyncSpec withUsers(List users) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("userMappingLocation", this.userMappingLocation); + jsonWriter.writeArrayField("users", this.users, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RangerUsersyncSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RangerUsersyncSpec 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 RangerUsersyncSpec. + */ + public static RangerUsersyncSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RangerUsersyncSpec deserializedRangerUsersyncSpec = new RangerUsersyncSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedRangerUsersyncSpec.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("groups".equals(fieldName)) { + List groups = reader.readArray(reader1 -> reader1.getString()); + deserializedRangerUsersyncSpec.groups = groups; + } else if ("mode".equals(fieldName)) { + deserializedRangerUsersyncSpec.mode = RangerUsersyncMode.fromString(reader.getString()); + } else if ("userMappingLocation".equals(fieldName)) { + deserializedRangerUsersyncSpec.userMappingLocation = reader.getString(); + } else if ("users".equals(fieldName)) { + List users = reader.readArray(reader1 -> reader1.getString()); + deserializedRangerUsersyncSpec.users = users; + } else { + reader.skipChildren(); + } + } + + return deserializedRangerUsersyncSpec; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScaleActionType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScaleActionType.java index 818d38d930bdf..ee1e2806a5616 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScaleActionType.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScaleActionType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ScaleActionType() { * @param name a name to look for. * @return the corresponding ScaleActionType. */ - @JsonCreator public static ScaleActionType fromString(String name) { return fromString(name, ScaleActionType.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScalingRule.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScalingRule.java index 8227878c64d16..f0642f2ac331c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScalingRule.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScalingRule.java @@ -6,36 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The scaling rule. */ @Fluent -public final class ScalingRule { +public final class ScalingRule implements JsonSerializable { /* * The action type. */ - @JsonProperty(value = "actionType", required = true) private ScaleActionType actionType; /* * This is an evaluation count for a scaling condition, the number of times a trigger condition should be * successful, before scaling activity is triggered. */ - @JsonProperty(value = "evaluationCount", required = true) private int evaluationCount; /* * Metrics name for individual workloads. For example: cpu */ - @JsonProperty(value = "scalingMetric", required = true) private String scalingMetric; /* * The comparison rule. */ - @JsonProperty(value = "comparisonRule", required = true) private ComparisonRule comparisonRule; /** @@ -133,20 +133,66 @@ public ScalingRule withComparisonRule(ComparisonRule comparisonRule) { */ public void validate() { if (actionType() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property actionType in model ScalingRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property actionType in model ScalingRule")); } if (scalingMetric() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property scalingMetric in model ScalingRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property scalingMetric in model ScalingRule")); } if (comparisonRule() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property comparisonRule in model ScalingRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property comparisonRule in model ScalingRule")); } else { comparisonRule().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ScalingRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + jsonWriter.writeIntField("evaluationCount", this.evaluationCount); + jsonWriter.writeStringField("scalingMetric", this.scalingMetric); + jsonWriter.writeJsonField("comparisonRule", this.comparisonRule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingRule. + */ + public static ScalingRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingRule deserializedScalingRule = new ScalingRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionType".equals(fieldName)) { + deserializedScalingRule.actionType = ScaleActionType.fromString(reader.getString()); + } else if ("evaluationCount".equals(fieldName)) { + deserializedScalingRule.evaluationCount = reader.getInt(); + } else if ("scalingMetric".equals(fieldName)) { + deserializedScalingRule.scalingMetric = reader.getString(); + } else if ("comparisonRule".equals(fieldName)) { + deserializedScalingRule.comparisonRule = ComparisonRule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingRule; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Schedule.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Schedule.java index cdf23c24b8fa9..453ea283af878 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Schedule.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Schedule.java @@ -6,37 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Schedule definition. */ @Fluent -public final class Schedule { +public final class Schedule implements JsonSerializable { /* * User has to set the start time of current schedule configuration, format like 10:30 (HH:MM). */ - @JsonProperty(value = "startTime", required = true) private String startTime; /* * User has to set the end time of current schedule configuration, format like 10:30 (HH:MM). */ - @JsonProperty(value = "endTime", required = true) private String endTime; /* * User has to set the node count anticipated at end of the scaling operation of the set current schedule * configuration, format is integer. */ - @JsonProperty(value = "count", required = true) private int count; /* * User has to set the days where schedule has to be set for autoscale operation. */ - @JsonProperty(value = "days", required = true) private List days; /** @@ -138,18 +138,66 @@ public Schedule withDays(List days) { */ public void validate() { if (startTime() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property startTime in model Schedule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property startTime in model Schedule")); } if (endTime() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property endTime in model Schedule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property endTime in model Schedule")); } if (days() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property days in model Schedule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property days in model Schedule")); } } private static final ClientLogger LOGGER = new ClientLogger(Schedule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", this.startTime); + jsonWriter.writeStringField("endTime", this.endTime); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeArrayField("days", this.days, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Schedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Schedule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Schedule. + */ + public static Schedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Schedule deserializedSchedule = new Schedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedSchedule.startTime = reader.getString(); + } else if ("endTime".equals(fieldName)) { + deserializedSchedule.endTime = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedSchedule.count = reader.getInt(); + } else if ("days".equals(fieldName)) { + List days = reader.readArray(reader1 -> ScheduleDay.fromString(reader1.getString())); + deserializedSchedule.days = days; + } else { + reader.skipChildren(); + } + } + + return deserializedSchedule; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleBasedConfig.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleBasedConfig.java index 24de52ef8dbc1..9a58800428915 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleBasedConfig.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleBasedConfig.java @@ -6,32 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Profile of schedule based Autoscale. */ @Fluent -public final class ScheduleBasedConfig { +public final class ScheduleBasedConfig implements JsonSerializable { /* * User has to specify the timezone on which the schedule has to be set for schedule based autoscale configuration. */ - @JsonProperty(value = "timeZone", required = true) private String timeZone; /* * Setting default node count of current schedule configuration. Default node count specifies the number of nodes * which are default when an specified scaling operation is executed (scale up/scale down) */ - @JsonProperty(value = "defaultCount", required = true) private int defaultCount; /* - * This specifies the schedules where scheduled based Autoscale to be enabled, the user has a choice to set - * multiple rules within the schedule across days and times (start/end). + * This specifies the schedules where scheduled based Autoscale to be enabled, the user has a choice to set multiple + * rules within the schedule across days and times (start/end). */ - @JsonProperty(value = "schedules", required = true) private List schedules; /** @@ -115,16 +116,60 @@ public ScheduleBasedConfig withSchedules(List schedules) { */ public void validate() { if (timeZone() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property timeZone in model ScheduleBasedConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property timeZone in model ScheduleBasedConfig")); } if (schedules() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property schedules in model ScheduleBasedConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property schedules in model ScheduleBasedConfig")); } else { schedules().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ScheduleBasedConfig.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeIntField("defaultCount", this.defaultCount); + jsonWriter.writeArrayField("schedules", this.schedules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleBasedConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleBasedConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScheduleBasedConfig. + */ + public static ScheduleBasedConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleBasedConfig deserializedScheduleBasedConfig = new ScheduleBasedConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeZone".equals(fieldName)) { + deserializedScheduleBasedConfig.timeZone = reader.getString(); + } else if ("defaultCount".equals(fieldName)) { + deserializedScheduleBasedConfig.defaultCount = reader.getInt(); + } else if ("schedules".equals(fieldName)) { + List schedules = reader.readArray(reader1 -> Schedule.fromJson(reader1)); + deserializedScheduleBasedConfig.schedules = schedules; + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleBasedConfig; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleDay.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleDay.java index a4d9b55d4f1bb..9266aea4d9094 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleDay.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScheduleDay.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public ScheduleDay() { * @param name a name to look for. * @return the corresponding ScheduleDay. */ - @JsonCreator public static ScheduleDay fromString(String name) { return fromString(name, ScheduleDay.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScriptActionProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScriptActionProfile.java index 1df02de6c9120..9d2a0b9c94b70 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScriptActionProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ScriptActionProfile.java @@ -6,55 +6,52 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The script action profile. */ @Fluent -public final class ScriptActionProfile { +public final class ScriptActionProfile implements JsonSerializable { /* * Type of the script action. Supported type is bash scripts. */ - @JsonProperty(value = "type", required = true) private String type; /* * Script name. */ - @JsonProperty(value = "name", required = true) private String name; /* * Url of the script file. */ - @JsonProperty(value = "url", required = true) private String url; /* * Additional parameters for the script action. It should be space-separated list of arguments required for script * execution. */ - @JsonProperty(value = "parameters") private String parameters; /* * List of services to apply the script action. */ - @JsonProperty(value = "services", required = true) private List services; /* * Timeout duration for the script action in minutes. */ - @JsonProperty(value = "timeoutInMinutes") private Integer timeoutInMinutes; /* * Specify if the script should persist on the cluster. */ - @JsonProperty(value = "shouldPersist") private Boolean shouldPersist; /** @@ -212,22 +209,78 @@ public ScriptActionProfile withShouldPersist(Boolean shouldPersist) { */ public void validate() { if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ScriptActionProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ScriptActionProfile")); } if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ScriptActionProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ScriptActionProfile")); } if (url() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property url in model ScriptActionProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property url in model ScriptActionProfile")); } if (services() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property services in model ScriptActionProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property services in model ScriptActionProfile")); } } private static final ClientLogger LOGGER = new ClientLogger(ScriptActionProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeArrayField("services", this.services, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("parameters", this.parameters); + jsonWriter.writeNumberField("timeoutInMinutes", this.timeoutInMinutes); + jsonWriter.writeBooleanField("shouldPersist", this.shouldPersist); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScriptActionProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScriptActionProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScriptActionProfile. + */ + public static ScriptActionProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScriptActionProfile deserializedScriptActionProfile = new ScriptActionProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedScriptActionProfile.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScriptActionProfile.name = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedScriptActionProfile.url = reader.getString(); + } else if ("services".equals(fieldName)) { + List services = reader.readArray(reader1 -> reader1.getString()); + deserializedScriptActionProfile.services = services; + } else if ("parameters".equals(fieldName)) { + deserializedScriptActionProfile.parameters = reader.getString(); + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedScriptActionProfile.timeoutInMinutes = reader.getNullable(JsonReader::getInt); + } else if ("shouldPersist".equals(fieldName)) { + deserializedScriptActionProfile.shouldPersist = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedScriptActionProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretReference.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretReference.java index dd1c844af9abf..1fc5ba547e04f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretReference.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretReference.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Secret reference and corresponding properties of a key vault secret. */ @Fluent -public final class SecretReference { +public final class SecretReference implements JsonSerializable { /* * Reference name of the secret to be used in service configs. */ - @JsonProperty(value = "referenceName", required = true) private String referenceName; /* * Type of key vault object: secret, key or certificate. */ - @JsonProperty(value = "type", required = true) private KeyVaultObjectType type; /* * Version of the secret in key vault. */ - @JsonProperty(value = "version") private String version; /* * Object identifier name of the secret in key vault. */ - @JsonProperty(value = "keyVaultObjectName", required = true) private String keyVaultObjectName; /** @@ -130,18 +130,65 @@ public SecretReference withKeyVaultObjectName(String keyVaultObjectName) { */ public void validate() { if (referenceName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property referenceName in model SecretReference")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property referenceName in model SecretReference")); } if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model SecretReference")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model SecretReference")); } if (keyVaultObjectName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyVaultObjectName in model SecretReference")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultObjectName in model SecretReference")); } } private static final ClientLogger LOGGER = new ClientLogger(SecretReference.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("referenceName", this.referenceName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("keyVaultObjectName", this.keyVaultObjectName); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretReference. + */ + public static SecretReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretReference deserializedSecretReference = new SecretReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceName".equals(fieldName)) { + deserializedSecretReference.referenceName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecretReference.type = KeyVaultObjectType.fromString(reader.getString()); + } else if ("keyVaultObjectName".equals(fieldName)) { + deserializedSecretReference.keyVaultObjectName = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedSecretReference.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretReference; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretsProfile.java index aa7e3267e38a1..85844107d743e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretsProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SecretsProfile.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The cluster secret profile. */ @Fluent -public final class SecretsProfile { +public final class SecretsProfile implements JsonSerializable { /* * Name of the user Key Vault where all the cluster specific user secrets are stored. */ - @JsonProperty(value = "keyVaultResourceId", required = true) private String keyVaultResourceId; /* * Properties of Key Vault secret. */ - @JsonProperty(value = "secrets") private List secrets; /** @@ -81,8 +83,9 @@ public SecretsProfile withSecrets(List secrets) { */ public void validate() { if (keyVaultResourceId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyVaultResourceId in model SecretsProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultResourceId in model SecretsProfile")); } if (secrets() != null) { secrets().forEach(e -> e.validate()); @@ -90,4 +93,45 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SecretsProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultResourceId", this.keyVaultResourceId); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretsProfile. + */ + public static SecretsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsProfile deserializedSecretsProfile = new SecretsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultResourceId".equals(fieldName)) { + deserializedSecretsProfile.keyVaultResourceId = reader.getString(); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> SecretReference.fromJson(reader1)); + deserializedSecretsProfile.secrets = secrets; + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResult.java index 9871425603c8c..b9f33133a8a12 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResult.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ServiceConfigResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Cluster instance service configs api response. */ @Fluent -public final class ServiceConfigListResult { +public final class ServiceConfigListResult implements JsonSerializable { /* * Cluster instance service config array. */ - @JsonProperty(value = "value") private List value; /* * The link (url) to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConfigListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConfigListResult 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 ServiceConfigListResult. + */ + public static ServiceConfigListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConfigListResult deserializedServiceConfigListResult = new ServiceConfigListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServiceConfigResultInner.fromJson(reader1)); + deserializedServiceConfigListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceConfigListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConfigListResult; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultProperties.java index beacc7dee5e6f..05df783339d29 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultProperties.java @@ -6,63 +6,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Service config response. */ @Fluent -public class ServiceConfigListResultProperties { +public class ServiceConfigListResultProperties implements JsonSerializable { /* * Service Config Name. */ - @JsonProperty(value = "serviceName", required = true) private String serviceName; /* * File Name. */ - @JsonProperty(value = "fileName", required = true) private String fileName; /* * Content in the service config file. */ - @JsonProperty(value = "content") private String content; /* * Component Name. */ - @JsonProperty(value = "componentName", required = true) private String componentName; /* * Config type. */ - @JsonProperty(value = "type") private String type; /* * Config file path. */ - @JsonProperty(value = "path") private String path; /* * The custom keys. */ - @JsonProperty(value = "customKeys") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map customKeys; /* * The default keys. */ - @JsonProperty(value = "defaultKeys") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map defaultKeys; /** @@ -239,16 +232,19 @@ public Map defaultKeys() { */ public void validate() { if (serviceName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serviceName in model ServiceConfigListResultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serviceName in model ServiceConfigListResultProperties")); } if (fileName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property fileName in model ServiceConfigListResultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fileName in model ServiceConfigListResultProperties")); } if (componentName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property componentName in model ServiceConfigListResultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property componentName in model ServiceConfigListResultProperties")); } if (defaultKeys() != null) { defaultKeys().values().forEach(e -> { @@ -260,4 +256,66 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ServiceConfigListResultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeStringField("componentName", this.componentName); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeMapField("customKeys", this.customKeys, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("defaultKeys", this.defaultKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConfigListResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConfigListResultProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceConfigListResultProperties. + */ + public static ServiceConfigListResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConfigListResultProperties deserializedServiceConfigListResultProperties + = new ServiceConfigListResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedServiceConfigListResultProperties.serviceName = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedServiceConfigListResultProperties.fileName = reader.getString(); + } else if ("componentName".equals(fieldName)) { + deserializedServiceConfigListResultProperties.componentName = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedServiceConfigListResultProperties.content = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServiceConfigListResultProperties.type = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedServiceConfigListResultProperties.path = reader.getString(); + } else if ("customKeys".equals(fieldName)) { + Map customKeys = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceConfigListResultProperties.customKeys = customKeys; + } else if ("defaultKeys".equals(fieldName)) { + Map defaultKeys + = reader.readMap(reader1 -> ServiceConfigListResultValueEntity.fromJson(reader1)); + deserializedServiceConfigListResultProperties.defaultKeys = defaultKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConfigListResultProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultValueEntity.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultValueEntity.java index d252c9da5221a..33a59ab2b3775 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultValueEntity.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigListResultValueEntity.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Default config details. */ @Fluent -public final class ServiceConfigListResultValueEntity { +public final class ServiceConfigListResultValueEntity implements JsonSerializable { /* * Config value. */ - @JsonProperty(value = "value", required = true) private String value; /* * Config description. */ - @JsonProperty(value = "description") private String description; /** @@ -78,10 +80,52 @@ public ServiceConfigListResultValueEntity withDescription(String description) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model ServiceConfigListResultValueEntity")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ServiceConfigListResultValueEntity")); } } private static final ClientLogger LOGGER = new ClientLogger(ServiceConfigListResultValueEntity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConfigListResultValueEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConfigListResultValueEntity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceConfigListResultValueEntity. + */ + public static ServiceConfigListResultValueEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConfigListResultValueEntity deserializedServiceConfigListResultValueEntity + = new ServiceConfigListResultValueEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedServiceConfigListResultValueEntity.value = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedServiceConfigListResultValueEntity.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConfigListResultValueEntity; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigResultProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigResultProperties.java index 77c4a5936821f..d35ac29128902 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigResultProperties.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceConfigResultProperties.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -99,4 +103,66 @@ public ServiceConfigResultProperties withDefaultKeys(Map writer.writeString(element)); + jsonWriter.writeMapField("defaultKeys", defaultKeys(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConfigResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConfigResultProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceConfigResultProperties. + */ + public static ServiceConfigResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConfigResultProperties deserializedServiceConfigResultProperties + = new ServiceConfigResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedServiceConfigResultProperties.withServiceName(reader.getString()); + } else if ("fileName".equals(fieldName)) { + deserializedServiceConfigResultProperties.withFileName(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedServiceConfigResultProperties.withComponentName(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedServiceConfigResultProperties.withContent(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedServiceConfigResultProperties.withType(reader.getString()); + } else if ("path".equals(fieldName)) { + deserializedServiceConfigResultProperties.withPath(reader.getString()); + } else if ("customKeys".equals(fieldName)) { + Map customKeys = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceConfigResultProperties.withCustomKeys(customKeys); + } else if ("defaultKeys".equals(fieldName)) { + Map defaultKeys + = reader.readMap(reader1 -> ServiceConfigListResultValueEntity.fromJson(reader1)); + deserializedServiceConfigResultProperties.withDefaultKeys(defaultKeys); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConfigResultProperties; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceStatus.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceStatus.java index 95173725a01a4..f6964bcde64b9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceStatus.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/ServiceStatus.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Describes the status of a service of a HDInsight on AKS cluster. */ @Fluent -public final class ServiceStatus { +public final class ServiceStatus implements JsonSerializable { /* * Kind of the service. E.g. "Zookeeper". */ - @JsonProperty(value = "kind", required = true) private String kind; /* * Indicates if the service is ready / healthy. Values can be "true", "false", "unknown" or anything else. */ - @JsonProperty(value = "ready", required = true) private String ready; /* * A message describing the error if any. */ - @JsonProperty(value = "message") private String message; /** @@ -106,14 +107,57 @@ public ServiceStatus withMessage(String message) { */ public void validate() { if (kind() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model ServiceStatus")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model ServiceStatus")); } if (ready() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ready in model ServiceStatus")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ready in model ServiceStatus")); } } private static final ClientLogger LOGGER = new ClientLogger(ServiceStatus.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("ready", this.ready); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceStatus. + */ + public static ServiceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceStatus deserializedServiceStatus = new ServiceStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedServiceStatus.kind = reader.getString(); + } else if ("ready".equals(fieldName)) { + deserializedServiceStatus.ready = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedServiceStatus.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceStatus; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Severity.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Severity.java index 52b695ddaeb71..5c60dedebb558 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Severity.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Severity.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public Severity() { * @param name a name to look for. * @return the corresponding Severity. */ - @JsonCreator public static Severity fromString(String name) { return fromString(name, Severity.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkMetastoreSpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkMetastoreSpec.java index 112d1b3f96ad5..c071b34bf7981 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkMetastoreSpec.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkMetastoreSpec.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The metastore specification for Spark cluster. */ @Fluent -public final class SparkMetastoreSpec { +public final class SparkMetastoreSpec implements JsonSerializable { /* * The database server host. */ - @JsonProperty(value = "dbServerHost", required = true) private String dbServerHost; /* * The database name. */ - @JsonProperty(value = "dbName", required = true) private String dbName; /* @@ -30,31 +32,26 @@ public final class SparkMetastoreSpec { * https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and- * authorization */ - @JsonProperty(value = "dbConnectionAuthenticationMode") private DbConnectionAuthenticationMode dbConnectionAuthenticationMode; /* * The database user name. */ - @JsonProperty(value = "dbUserName") private String dbUsername; /* * The secret name which contains the database user password. */ - @JsonProperty(value = "dbPasswordSecretName") private String dbPasswordSecretName; /* * The key vault resource id. */ - @JsonProperty(value = "keyVaultId") private String keyVaultId; /* * The thrift url. */ - @JsonProperty(value = "thriftUrl") private String thriftUrl; /** @@ -215,14 +212,72 @@ public SparkMetastoreSpec withThriftUrl(String thriftUrl) { */ public void validate() { if (dbServerHost() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property dbServerHost in model SparkMetastoreSpec")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property dbServerHost in model SparkMetastoreSpec")); } if (dbName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property dbName in model SparkMetastoreSpec")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property dbName in model SparkMetastoreSpec")); } } private static final ClientLogger LOGGER = new ClientLogger(SparkMetastoreSpec.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dbServerHost", this.dbServerHost); + jsonWriter.writeStringField("dbName", this.dbName); + jsonWriter.writeStringField("dbConnectionAuthenticationMode", + this.dbConnectionAuthenticationMode == null ? null : this.dbConnectionAuthenticationMode.toString()); + jsonWriter.writeStringField("dbUserName", this.dbUsername); + jsonWriter.writeStringField("dbPasswordSecretName", this.dbPasswordSecretName); + jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + jsonWriter.writeStringField("thriftUrl", this.thriftUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkMetastoreSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkMetastoreSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SparkMetastoreSpec. + */ + public static SparkMetastoreSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkMetastoreSpec deserializedSparkMetastoreSpec = new SparkMetastoreSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dbServerHost".equals(fieldName)) { + deserializedSparkMetastoreSpec.dbServerHost = reader.getString(); + } else if ("dbName".equals(fieldName)) { + deserializedSparkMetastoreSpec.dbName = reader.getString(); + } else if ("dbConnectionAuthenticationMode".equals(fieldName)) { + deserializedSparkMetastoreSpec.dbConnectionAuthenticationMode + = DbConnectionAuthenticationMode.fromString(reader.getString()); + } else if ("dbUserName".equals(fieldName)) { + deserializedSparkMetastoreSpec.dbUsername = reader.getString(); + } else if ("dbPasswordSecretName".equals(fieldName)) { + deserializedSparkMetastoreSpec.dbPasswordSecretName = reader.getString(); + } else if ("keyVaultId".equals(fieldName)) { + deserializedSparkMetastoreSpec.keyVaultId = reader.getString(); + } else if ("thriftUrl".equals(fieldName)) { + deserializedSparkMetastoreSpec.thriftUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkMetastoreSpec; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkProfile.java index 9c23ffde15380..f43c6fba812cf 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkProfile.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The spark cluster profile. */ @Fluent -public final class SparkProfile { +public final class SparkProfile implements JsonSerializable { /* * The default storage URL. */ - @JsonProperty(value = "defaultStorageUrl") private String defaultStorageUrl; /* * The metastore specification for Spark cluster. */ - @JsonProperty(value = "metastoreSpec") private SparkMetastoreSpec metastoreSpec; /* * Spark user plugins spec */ - @JsonProperty(value = "userPluginsSpec") private SparkUserPlugins userPluginsSpec; /** @@ -109,4 +110,46 @@ public void validate() { userPluginsSpec().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultStorageUrl", this.defaultStorageUrl); + jsonWriter.writeJsonField("metastoreSpec", this.metastoreSpec); + jsonWriter.writeJsonField("userPluginsSpec", this.userPluginsSpec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkProfile 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 SparkProfile. + */ + public static SparkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkProfile deserializedSparkProfile = new SparkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultStorageUrl".equals(fieldName)) { + deserializedSparkProfile.defaultStorageUrl = reader.getString(); + } else if ("metastoreSpec".equals(fieldName)) { + deserializedSparkProfile.metastoreSpec = SparkMetastoreSpec.fromJson(reader); + } else if ("userPluginsSpec".equals(fieldName)) { + deserializedSparkProfile.userPluginsSpec = SparkUserPlugins.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugin.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugin.java index 82e160520b121..f148119362c30 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugin.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugin.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Spark user plugin. */ @Fluent -public final class SparkUserPlugin { +public final class SparkUserPlugin implements JsonSerializable { /* * Fully qualified path to the folder containing the plugins. */ - @JsonProperty(value = "path", required = true) private String path; /** @@ -52,10 +55,47 @@ public SparkUserPlugin withPath(String path) { */ public void validate() { if (path() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property path in model SparkUserPlugin")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property path in model SparkUserPlugin")); } } private static final ClientLogger LOGGER = new ClientLogger(SparkUserPlugin.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkUserPlugin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkUserPlugin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SparkUserPlugin. + */ + public static SparkUserPlugin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkUserPlugin deserializedSparkUserPlugin = new SparkUserPlugin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedSparkUserPlugin.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkUserPlugin; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugins.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugins.java index 018925c7af77b..c35d6e177fd65 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugins.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SparkUserPlugins.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Spark user plugins spec. */ @Fluent -public final class SparkUserPlugins { +public final class SparkUserPlugins implements JsonSerializable { /* * Spark user plugins. */ - @JsonProperty(value = "plugins") private List plugins; /** @@ -55,4 +58,41 @@ public void validate() { plugins().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("plugins", this.plugins, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkUserPlugins from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkUserPlugins 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 SparkUserPlugins. + */ + public static SparkUserPlugins fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkUserPlugins deserializedSparkUserPlugins = new SparkUserPlugins(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("plugins".equals(fieldName)) { + List plugins = reader.readArray(reader1 -> SparkUserPlugin.fromJson(reader1)); + deserializedSparkUserPlugins.plugins = plugins; + } else { + reader.skipChildren(); + } + } + + return deserializedSparkUserPlugins; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshConnectivityEndpoint.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshConnectivityEndpoint.java index 0a6057db47e6e..09329fc70b23e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshConnectivityEndpoint.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshConnectivityEndpoint.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * SSH connectivity endpoint details. */ @Fluent -public final class SshConnectivityEndpoint { +public final class SshConnectivityEndpoint implements JsonSerializable { /* * SSH connectivity endpoint. */ - @JsonProperty(value = "endpoint", required = true) private String endpoint; /* * Private SSH connectivity endpoint. This property will only be returned when enableInternalIngress is true. */ - @JsonProperty(value = "privateSshEndpoint") private String privateSshEndpoint; /** @@ -80,10 +82,51 @@ public SshConnectivityEndpoint withPrivateSshEndpoint(String privateSshEndpoint) */ public void validate() { if (endpoint() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property endpoint in model SshConnectivityEndpoint")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endpoint in model SshConnectivityEndpoint")); } } private static final ClientLogger LOGGER = new ClientLogger(SshConnectivityEndpoint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("privateSshEndpoint", this.privateSshEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshConnectivityEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshConnectivityEndpoint if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SshConnectivityEndpoint. + */ + public static SshConnectivityEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshConnectivityEndpoint deserializedSshConnectivityEndpoint = new SshConnectivityEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedSshConnectivityEndpoint.endpoint = reader.getString(); + } else if ("privateSshEndpoint".equals(fieldName)) { + deserializedSshConnectivityEndpoint.privateSshEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshConnectivityEndpoint; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshProfile.java index c7690c7d055b4..97957896875f6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/SshProfile.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Ssh profile for the cluster. */ @Fluent -public final class SshProfile { +public final class SshProfile implements JsonSerializable { /* * Number of ssh pods per cluster. */ - @JsonProperty(value = "count", required = true) private int count; /* * Prefix of the pod names. Pod number will be appended to the prefix. The ingress URLs for the pods will be * available at //- */ - @JsonProperty(value = "podPrefix", access = JsonProperty.Access.WRITE_ONLY) private String podPrefix; + /* + * The virtual machine SKU. + */ + private String vmSize; + /** * Creates an instance of SshProfile class. */ @@ -61,6 +68,26 @@ public String podPrefix() { return this.podPrefix; } + /** + * Get the vmSize property: The virtual machine SKU. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The virtual machine SKU. + * + * @param vmSize the vmSize value to set. + * @return the SshProfile object itself. + */ + public SshProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + /** * Validates the instance. * @@ -68,4 +95,46 @@ public String podPrefix() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeStringField("vmSize", this.vmSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SshProfile. + */ + public static SshProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshProfile deserializedSshProfile = new SshProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedSshProfile.count = reader.getInt(); + } else if ("podPrefix".equals(fieldName)) { + deserializedSshProfile.podPrefix = reader.getString(); + } else if ("vmSize".equals(fieldName)) { + deserializedSshProfile.vmSize = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Status.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Status.java new file mode 100644 index 0000000000000..99985a2ffc1a2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Status.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the library. + */ +public final class Status extends ExpandableStringEnum { + /** + * Static value INSTALLING for Status. + */ + public static final Status INSTALLING = fromString("INSTALLING"); + + /** + * Static value INSTALLED for Status. + */ + public static final Status INSTALLED = fromString("INSTALLED"); + + /** + * Static value INSTALL_FAILED for Status. + */ + public static final Status INSTALL_FAILED = fromString("INSTALL_FAILED"); + + /** + * Static value UNINSTALLING for Status. + */ + public static final Status UNINSTALLING = fromString("UNINSTALLING"); + + /** + * Static value UNINSTALL_FAILED for Status. + */ + public static final Status UNINSTALL_FAILED = fromString("UNINSTALL_FAILED"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TagsObject.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TagsObject.java index 4bcaa8302779d..34ae7cdc65775 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TagsObject.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TagsObject.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Tags object for patch operations. */ @Fluent -public final class TagsObject { +public final class TagsObject implements JsonSerializable { /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -54,4 +55,41 @@ public TagsObject withTags(Map tags) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagsObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagsObject 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 TagsObject. + */ + public static TagsObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagsObject deserializedTagsObject = new TagsObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTagsObject.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTagsObject; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoCoordinator.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoCoordinator.java index 05fbd8fdc7e6f..8b8a87929c2de 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoCoordinator.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoCoordinator.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino Coordinator. */ @Fluent -public final class TrinoCoordinator { +public final class TrinoCoordinator implements JsonSerializable { /* * Trino debug configuration. */ - @JsonProperty(value = "debug") private TrinoDebugConfig debug; /* * The flag that if enable coordinator HA, uses multiple coordinator replicas with auto failover, one per each head * node. Default: true. */ - @JsonProperty(value = "highAvailabilityEnabled") private Boolean highAvailabilityEnabled; /** @@ -83,4 +85,43 @@ public void validate() { debug().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("debug", this.debug); + jsonWriter.writeBooleanField("highAvailabilityEnabled", this.highAvailabilityEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoCoordinator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoCoordinator 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 TrinoCoordinator. + */ + public static TrinoCoordinator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoCoordinator deserializedTrinoCoordinator = new TrinoCoordinator(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("debug".equals(fieldName)) { + deserializedTrinoCoordinator.debug = TrinoDebugConfig.fromJson(reader); + } else if ("highAvailabilityEnabled".equals(fieldName)) { + deserializedTrinoCoordinator.highAvailabilityEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoCoordinator; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoDebugConfig.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoDebugConfig.java index 5a27b802831e4..2534a05a39424 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoDebugConfig.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoDebugConfig.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino debug configuration. */ @Fluent -public final class TrinoDebugConfig { +public final class TrinoDebugConfig implements JsonSerializable { /* * The flag that if enable debug or not. */ - @JsonProperty(value = "enable") private Boolean enable; /* * The debug port. */ - @JsonProperty(value = "port") private Integer port; /* * The flag that if suspend debug or not. */ - @JsonProperty(value = "suspend") private Boolean suspend; /** @@ -103,4 +104,46 @@ public TrinoDebugConfig withSuspend(Boolean suspend) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeBooleanField("suspend", this.suspend); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoDebugConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoDebugConfig 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 TrinoDebugConfig. + */ + public static TrinoDebugConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoDebugConfig deserializedTrinoDebugConfig = new TrinoDebugConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedTrinoDebugConfig.enable = reader.getNullable(JsonReader::getBoolean); + } else if ("port".equals(fieldName)) { + deserializedTrinoDebugConfig.port = reader.getNullable(JsonReader::getInt); + } else if ("suspend".equals(fieldName)) { + deserializedTrinoDebugConfig.suspend = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoDebugConfig; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoProfile.java index 24da05ec73971..4581008907578 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoProfile.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino Cluster profile. */ @Fluent -public final class TrinoProfile { +public final class TrinoProfile implements JsonSerializable { /* * Trino cluster catalog options. */ - @JsonProperty(value = "catalogOptions") private CatalogOptions catalogOptions; /* * Trino Coordinator. */ - @JsonProperty(value = "coordinator") private TrinoCoordinator coordinator; /* * Trino user plugins spec */ - @JsonProperty(value = "userPluginsSpec") private TrinoUserPlugins userPluginsSpec; /* * User telemetry */ - @JsonProperty(value = "userTelemetrySpec") private TrinoUserTelemetry userTelemetrySpec; /* * Trino worker. */ - @JsonProperty(value = "worker") private TrinoWorker worker; /** @@ -170,4 +169,52 @@ public void validate() { worker().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("catalogOptions", this.catalogOptions); + jsonWriter.writeJsonField("coordinator", this.coordinator); + jsonWriter.writeJsonField("userPluginsSpec", this.userPluginsSpec); + jsonWriter.writeJsonField("userTelemetrySpec", this.userTelemetrySpec); + jsonWriter.writeJsonField("worker", this.worker); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoProfile 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 TrinoProfile. + */ + public static TrinoProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoProfile deserializedTrinoProfile = new TrinoProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("catalogOptions".equals(fieldName)) { + deserializedTrinoProfile.catalogOptions = CatalogOptions.fromJson(reader); + } else if ("coordinator".equals(fieldName)) { + deserializedTrinoProfile.coordinator = TrinoCoordinator.fromJson(reader); + } else if ("userPluginsSpec".equals(fieldName)) { + deserializedTrinoProfile.userPluginsSpec = TrinoUserPlugins.fromJson(reader); + } else if ("userTelemetrySpec".equals(fieldName)) { + deserializedTrinoProfile.userTelemetrySpec = TrinoUserTelemetry.fromJson(reader); + } else if ("worker".equals(fieldName)) { + deserializedTrinoProfile.worker = TrinoWorker.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoProfile; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoTelemetryConfig.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoTelemetryConfig.java index ebd9c84e658eb..031314a636495 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoTelemetryConfig.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoTelemetryConfig.java @@ -5,37 +5,37 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino user telemetry definition. */ @Fluent -public final class TrinoTelemetryConfig { +public final class TrinoTelemetryConfig implements JsonSerializable { /* * Hive Catalog name used to mount external tables on the logs written by trino, if not specified there tables are * not created. */ - @JsonProperty(value = "hivecatalogName") private String hivecatalogName; /* * Schema of the above catalog to use, to mount query logs as external tables, if not specified tables will be * mounted under schema trinologs. */ - @JsonProperty(value = "hivecatalogSchema") private String hivecatalogSchema; /* * Retention period for query log table partitions, this doesn't have any affect on actual data. */ - @JsonProperty(value = "partitionRetentionInDays") private Integer partitionRetentionInDays; /* * Azure storage location of the blobs. */ - @JsonProperty(value = "path") private String path; /** @@ -89,8 +89,8 @@ public TrinoTelemetryConfig withHivecatalogSchema(String hivecatalogSchema) { } /** - * Get the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have - * any affect on actual data. + * Get the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have any + * affect on actual data. * * @return the partitionRetentionInDays value. */ @@ -99,8 +99,8 @@ public Integer partitionRetentionInDays() { } /** - * Set the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have - * any affect on actual data. + * Set the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have any + * affect on actual data. * * @param partitionRetentionInDays the partitionRetentionInDays value to set. * @return the TrinoTelemetryConfig object itself. @@ -137,4 +137,49 @@ public TrinoTelemetryConfig withPath(String path) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hivecatalogName", this.hivecatalogName); + jsonWriter.writeStringField("hivecatalogSchema", this.hivecatalogSchema); + jsonWriter.writeNumberField("partitionRetentionInDays", this.partitionRetentionInDays); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoTelemetryConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoTelemetryConfig 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 TrinoTelemetryConfig. + */ + public static TrinoTelemetryConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoTelemetryConfig deserializedTrinoTelemetryConfig = new TrinoTelemetryConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hivecatalogName".equals(fieldName)) { + deserializedTrinoTelemetryConfig.hivecatalogName = reader.getString(); + } else if ("hivecatalogSchema".equals(fieldName)) { + deserializedTrinoTelemetryConfig.hivecatalogSchema = reader.getString(); + } else if ("partitionRetentionInDays".equals(fieldName)) { + deserializedTrinoTelemetryConfig.partitionRetentionInDays = reader.getNullable(JsonReader::getInt); + } else if ("path".equals(fieldName)) { + deserializedTrinoTelemetryConfig.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoTelemetryConfig; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugin.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugin.java index 8cdf9a78d3bf1..0cec4ceed268f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugin.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugin.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino user plugin. */ @Fluent -public final class TrinoUserPlugin { +public final class TrinoUserPlugin implements JsonSerializable { /* * Denotes whether the plugin is active or not. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * This field maps to the sub-directory in trino plugins location, that will contain all the plugins under path. */ - @JsonProperty(value = "name") private String name; /* * Fully qualified path to the folder containing the plugins. */ - @JsonProperty(value = "path") private String path; /** @@ -105,4 +106,46 @@ public TrinoUserPlugin withPath(String path) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoUserPlugin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoUserPlugin 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 TrinoUserPlugin. + */ + public static TrinoUserPlugin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoUserPlugin deserializedTrinoUserPlugin = new TrinoUserPlugin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedTrinoUserPlugin.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedTrinoUserPlugin.name = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedTrinoUserPlugin.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoUserPlugin; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugins.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugins.java index c6ba94b8c17d2..b351ed9037285 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugins.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserPlugins.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Trino user plugins spec. */ @Fluent -public final class TrinoUserPlugins { +public final class TrinoUserPlugins implements JsonSerializable { /* * Trino user plugins. */ - @JsonProperty(value = "plugins") private List plugins; /** @@ -55,4 +58,41 @@ public void validate() { plugins().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("plugins", this.plugins, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoUserPlugins from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoUserPlugins 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 TrinoUserPlugins. + */ + public static TrinoUserPlugins fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoUserPlugins deserializedTrinoUserPlugins = new TrinoUserPlugins(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("plugins".equals(fieldName)) { + List plugins = reader.readArray(reader1 -> TrinoUserPlugin.fromJson(reader1)); + deserializedTrinoUserPlugins.plugins = plugins; + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoUserPlugins; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserTelemetry.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserTelemetry.java index aa08bea986513..8cb653c87297a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserTelemetry.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoUserTelemetry.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * User telemetry. */ @Fluent -public final class TrinoUserTelemetry { +public final class TrinoUserTelemetry implements JsonSerializable { /* * Trino user telemetry definition. */ - @JsonProperty(value = "storage") private TrinoTelemetryConfig storage; /** @@ -54,4 +57,40 @@ public void validate() { storage().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storage", this.storage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoUserTelemetry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoUserTelemetry 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 TrinoUserTelemetry. + */ + public static TrinoUserTelemetry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoUserTelemetry deserializedTrinoUserTelemetry = new TrinoUserTelemetry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storage".equals(fieldName)) { + deserializedTrinoUserTelemetry.storage = TrinoTelemetryConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoUserTelemetry; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoWorker.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoWorker.java index c1287d4f69e7d..5e062bb371088 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoWorker.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/TrinoWorker.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trino worker. */ @Fluent -public final class TrinoWorker { +public final class TrinoWorker implements JsonSerializable { /* * Trino debug configuration. */ - @JsonProperty(value = "debug") private TrinoDebugConfig debug; /** @@ -54,4 +57,40 @@ public void validate() { debug().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("debug", this.debug); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrinoWorker from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrinoWorker 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 TrinoWorker. + */ + public static TrinoWorker fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrinoWorker deserializedTrinoWorker = new TrinoWorker(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("debug".equals(fieldName)) { + deserializedTrinoWorker.debug = TrinoDebugConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrinoWorker; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Type.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Type.java new file mode 100644 index 0000000000000..fe6eb1cd3e58e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/Type.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the library. + */ +public final class Type extends ExpandableStringEnum { + /** + * Static value pypi for Type. + */ + public static final Type PYPI = fromString("pypi"); + + /** + * Static value maven for Type. + */ + public static final Type MAVEN = fromString("maven"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpdatableClusterProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpdatableClusterProfile.java index 5266f6455eba1..d5e3bcf175170 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpdatableClusterProfile.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpdatableClusterProfile.java @@ -5,69 +5,73 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Cluster resource patch properties. */ @Fluent -public final class UpdatableClusterProfile { +public final class UpdatableClusterProfile implements JsonSerializable { /* * The service configs profiles. */ - @JsonProperty(value = "serviceConfigsProfiles") private List serviceConfigsProfiles; /* * Ssh profile for the cluster. */ - @JsonProperty(value = "sshProfile") private SshProfile sshProfile; /* - * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with - * Autoscale. + * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. */ - @JsonProperty(value = "autoscaleProfile") private AutoscaleProfile autoscaleProfile; /* * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. */ - @JsonProperty(value = "authorizationProfile") private AuthorizationProfile authorizationProfile; /* * Cluster log analytics profile to enable or disable OMS agent for cluster. */ - @JsonProperty(value = "logAnalyticsProfile") private ClusterLogAnalyticsProfile logAnalyticsProfile; /* * Cluster Prometheus profile. */ - @JsonProperty(value = "prometheusProfile") private ClusterPrometheusProfile prometheusProfile; /* * Cluster Ranger plugin profile. */ - @JsonProperty(value = "rangerPluginProfile") private ClusterRangerPluginProfile rangerPluginProfile; /* * The ranger cluster profile. */ - @JsonProperty(value = "rangerProfile") private RangerProfile rangerProfile; /* * The script action profile list. */ - @JsonProperty(value = "scriptActionProfiles") private List scriptActionProfiles; + /* + * The cluster secret profile. + */ + private SecretsProfile secretsProfile; + + /* + * Trino Cluster profile. + */ + private TrinoProfile trinoProfile; + /** * Creates an instance of UpdatableClusterProfile class. */ @@ -259,6 +263,46 @@ public UpdatableClusterProfile withScriptActionProfiles(List e.validate()); } + if (secretsProfile() != null) { + secretsProfile().validate(); + } + if (trinoProfile() != null) { + trinoProfile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("serviceConfigsProfiles", this.serviceConfigsProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sshProfile", this.sshProfile); + jsonWriter.writeJsonField("autoscaleProfile", this.autoscaleProfile); + jsonWriter.writeJsonField("authorizationProfile", this.authorizationProfile); + jsonWriter.writeJsonField("logAnalyticsProfile", this.logAnalyticsProfile); + jsonWriter.writeJsonField("prometheusProfile", this.prometheusProfile); + jsonWriter.writeJsonField("rangerPluginProfile", this.rangerPluginProfile); + jsonWriter.writeJsonField("rangerProfile", this.rangerProfile); + jsonWriter.writeArrayField("scriptActionProfiles", this.scriptActionProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("secretsProfile", this.secretsProfile); + jsonWriter.writeJsonField("trinoProfile", this.trinoProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdatableClusterProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdatableClusterProfile 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 UpdatableClusterProfile. + */ + public static UpdatableClusterProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdatableClusterProfile deserializedUpdatableClusterProfile = new UpdatableClusterProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceConfigsProfiles".equals(fieldName)) { + List serviceConfigsProfiles + = reader.readArray(reader1 -> ClusterServiceConfigsProfile.fromJson(reader1)); + deserializedUpdatableClusterProfile.serviceConfigsProfiles = serviceConfigsProfiles; + } else if ("sshProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.sshProfile = SshProfile.fromJson(reader); + } else if ("autoscaleProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.autoscaleProfile = AutoscaleProfile.fromJson(reader); + } else if ("authorizationProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.authorizationProfile = AuthorizationProfile.fromJson(reader); + } else if ("logAnalyticsProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.logAnalyticsProfile + = ClusterLogAnalyticsProfile.fromJson(reader); + } else if ("prometheusProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.prometheusProfile = ClusterPrometheusProfile.fromJson(reader); + } else if ("rangerPluginProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.rangerPluginProfile + = ClusterRangerPluginProfile.fromJson(reader); + } else if ("rangerProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.rangerProfile = RangerProfile.fromJson(reader); + } else if ("scriptActionProfiles".equals(fieldName)) { + List scriptActionProfiles + = reader.readArray(reader1 -> ScriptActionProfile.fromJson(reader1)); + deserializedUpdatableClusterProfile.scriptActionProfiles = scriptActionProfiles; + } else if ("secretsProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.secretsProfile = SecretsProfile.fromJson(reader); + } else if ("trinoProfile".equals(fieldName)) { + deserializedUpdatableClusterProfile.trinoProfile = TrinoProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdatableClusterProfile; + }); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpgradeMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpgradeMode.java index 0bdafdf7ff8a4..06a242fc92b16 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpgradeMode.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/UpgradeMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.hdinsight.containers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public UpgradeMode() { * @param name a name to look for. * @return the corresponding UpgradeMode. */ - @JsonCreator public static UpgradeMode fromString(String name) { return fromString(name, UpgradeMode.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/WebConnectivityEndpoint.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/WebConnectivityEndpoint.java index 391c31a6d1393..252e39c2b5db1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/WebConnectivityEndpoint.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/com/azure/resourcemanager/hdinsight/containers/models/WebConnectivityEndpoint.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Web connectivity endpoint details. */ @Fluent -public class WebConnectivityEndpoint { +public class WebConnectivityEndpoint implements JsonSerializable { /* * Web connectivity endpoint. */ - @JsonProperty(value = "fqdn", required = true) private String fqdn; /* * Private web connectivity endpoint. This property will only be returned when enableInternalIngress is true. */ - @JsonProperty(value = "privateFqdn") private String privateFqdn; /** @@ -80,10 +82,50 @@ public WebConnectivityEndpoint withPrivateFqdn(String privateFqdn) { */ public void validate() { if (fqdn() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property fqdn in model WebConnectivityEndpoint")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property fqdn in model WebConnectivityEndpoint")); } } private static final ClientLogger LOGGER = new ClientLogger(WebConnectivityEndpoint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeStringField("privateFqdn", this.privateFqdn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebConnectivityEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebConnectivityEndpoint if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WebConnectivityEndpoint. + */ + public static WebConnectivityEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebConnectivityEndpoint deserializedWebConnectivityEndpoint = new WebConnectivityEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedWebConnectivityEndpoint.fqdn = reader.getString(); + } else if ("privateFqdn".equals(fieldName)) { + deserializedWebConnectivityEndpoint.privateFqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebConnectivityEndpoint; + }); + } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/module-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/module-info.java index 0aab3ce6ddadd..635310a1549f3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/module-info.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/java/module-info.java @@ -8,6 +8,6 @@ exports com.azure.resourcemanager.hdinsight.containers.fluent; exports com.azure.resourcemanager.hdinsight.containers.fluent.models; exports com.azure.resourcemanager.hdinsight.containers.models; - opens com.azure.resourcemanager.hdinsight.containers.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.hdinsight.containers.models to com.azure.core, com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.hdinsight.containers.fluent.models to com.azure.core; + opens com.azure.resourcemanager.hdinsight.containers.models to com.azure.core; +} \ No newline at end of file diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/proxy-config.json b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/proxy-config.json index 427b3cb1ec472..5dd1890bf09ee 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/proxy-config.json +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolsClientImpl$ClusterPoolsService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolAvailableUpgradesClientImpl$ClusterPoolAvailableUpgradesService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.ClustersClientImpl$ClustersService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.ClusterAvailableUpgradesClientImpl$ClusterAvailableUpgradesService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.ClusterJobsClientImpl$ClusterJobsService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.LocationsClientImpl$LocationsService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.AvailableClusterPoolVersionsClientImpl$AvailableClusterPoolVersionsService" ], [ "com.azure.resourcemanager.hdinsight.containers.implementation.AvailableClusterVersionsClientImpl$AvailableClusterVersionsService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.hdinsight.containers.implementation.AvailableClusterPoolVersionsClientImpl$AvailableClusterPoolVersionsService"],["com.azure.resourcemanager.hdinsight.containers.implementation.AvailableClusterVersionsClientImpl$AvailableClusterVersionsService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterAvailableUpgradesClientImpl$ClusterAvailableUpgradesService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterJobsClientImpl$ClusterJobsService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterLibrariesClientImpl$ClusterLibrariesService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolAvailableUpgradesClientImpl$ClusterPoolAvailableUpgradesService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolUpgradeHistoriesClientImpl$ClusterPoolUpgradeHistoriesService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterPoolsClientImpl$ClusterPoolsService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClusterUpgradeHistoriesClientImpl$ClusterUpgradeHistoriesService"],["com.azure.resourcemanager.hdinsight.containers.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.hdinsight.containers.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.hdinsight.containers.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/reflect-config.json b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/reflect-config.json index 9eda123515525..0637a088a01e8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/reflect-config.json +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hdinsight-containers/reflect-config.json @@ -1,746 +1 @@ -[ { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesClusterPoolProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolComputeProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesAksClusterProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.AksClusterProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.AksClusterProfileAksClusterAgentPoolIdentityProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.IdentityProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolNetworkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolLogAnalyticsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TagsObject", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgrade", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolAvailableUpgradeInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ComputeProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.NodeProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterComponentsItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.AuthorizationProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SecretsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SecretReference", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterServiceConfigsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterServiceConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterConfigFile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ConnectivityProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ConnectivityProfileWeb", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.WebConnectivityEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SshConnectivityEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAccessProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterLogAnalyticsProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterLogAnalyticsApplicationLogs", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPrometheusProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SshProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.AutoscaleProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ScheduleBasedConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.Schedule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.LoadBasedConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ScalingRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ComparisonRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterRangerPluginProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.KafkaProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.DiskStorageProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.KafkaConnectivityEndpoints", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.CatalogOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.HiveCatalogOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoCoordinator", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoDebugConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoUserPlugins", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoUserPlugin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoUserTelemetry", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoTelemetryConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.TrinoWorker", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkStorageProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ComputeResourceDefinition", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkCatalogOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkHiveCatalogOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkJobProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SparkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SparkMetastoreSpec", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SparkUserPlugins", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.SparkUserPlugin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpec", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpecDatabase", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerAuditSpec", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerUsersyncSpec", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ScriptActionProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgrade", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterAvailableUpgradeInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterResizeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPatch", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPatchProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.UpdatableClusterProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterJobInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterJobProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterJobList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ServiceConfigResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigResultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigListResultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ServiceConfigListResultValueEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.NameAvailabilityParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.NameAvailabilityResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewsResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterInstanceViewResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewResultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewPropertiesStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ServiceStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolVersionsListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolVersionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolVersionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterVersionsListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterVersionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterVersionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.FlinkJobProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeAksPatchUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeNodeOsUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeAksPatchUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeHotfixUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAksPatchVersionUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolNodeOsImageUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAksPatchVersionUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterHotfixUpgradeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ProvisioningStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.OutboundType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgradeType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.KeyVaultObjectType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ContentEncoding", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.AutoscaleType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ScheduleDay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ScaleActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ComparisonOperator", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.DataDiskType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.MetastoreDbConnectionAuthenticationMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.DeploymentMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.UpgradeMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.DbConnectionAuthenticationMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.RangerUsersyncMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradeType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.JobType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.Action", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.CurrentClusterPoolAksVersionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.CurrentClusterAksVersionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.hdinsight.containers.models.Severity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationSamples.java index 7b9f24d659e9f..51ecd75fbd243 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationSamples.java @@ -10,7 +10,7 @@ public final class AvailableClusterPoolVersionsListByLocationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListAvailableClusterPoolVersions.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationSamples.java index fbcdfbe2dc4fe..adbf4599359f1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationSamples.java @@ -10,7 +10,7 @@ public final class AvailableClusterVersionsListByLocationSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListAvailableClusterVersions.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListSamples.java index 9f541e78a616c..24e1dfa85a786 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListSamples.java @@ -10,7 +10,7 @@ public final class ClusterAvailableUpgradesListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterAvailableUpgrades.json */ /** @@ -20,7 +20,7 @@ public final class ClusterAvailableUpgradesListSamples { */ public static void getClusterAvailableUpgrade(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterAvailableUpgrades().list("hiloResourcegroup", "clusterpool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusterAvailableUpgrades() + .list("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListSamples.java index ef5a6a5730d99..d72ae88d6ac70 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListSamples.java @@ -10,7 +10,7 @@ public final class ClusterJobsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterJobs.json */ /** @@ -20,7 +20,7 @@ public final class ClusterJobsListSamples { */ public static void listClusterJobs(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterJobs().list("hiloResourcegroup", "clusterPool1", "cluster1", null, - com.azure.core.util.Context.NONE); + manager.clusterJobs() + .list("hiloResourcegroup", "clusterPool1", "cluster1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobSamples.java index 4db36bf91e475..ff05c679afa16 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobSamples.java @@ -16,7 +16,7 @@ public final class ClusterJobsRunJobSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * RunClusterJob.json */ /** @@ -32,7 +32,8 @@ public final class ClusterJobsRunJobSamples { .withProperties(new FlinkJobProperties().withJobName("flink-job-name") .withJobJarDirectory("abfs://flinkjob@hilosa.dfs.core.windows.net/jars") .withJarName("flink-sleep-job-0.0.1-SNAPSHOT.jar") - .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob").withAction(Action.START) + .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob") + .withAction(Action.START) .withFlinkConfiguration(mapOf("parallelism", "1", "savepoint.directory", "abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"))), com.azure.core.util.Context.NONE); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListSamples.java new file mode 100644 index 0000000000000..ad87e0462edc2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.resourcemanager.hdinsight.containers.models.Category; + +/** + * Samples for ClusterLibraries List. + */ +public final class ClusterLibrariesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListPredefinedClusterLibraries.json + */ + /** + * Sample code: ListPredefinedClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void listPredefinedClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .list("hiloResourceGroup", "clusterPool", "cluster", Category.PREDEFINED, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListUserCustomClusterLibraries.json + */ + /** + * Sample code: ListUserCustomClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void listUserCustomClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .list("hiloResourceGroup", "clusterPool", "cluster", Category.CUSTOM, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesManageLibrariesSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesManageLibrariesSamples.java new file mode 100644 index 0000000000000..c523307de4cc1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesManageLibrariesSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperationProperties; +import com.azure.resourcemanager.hdinsight.containers.models.LibraryManagementAction; +import com.azure.resourcemanager.hdinsight.containers.models.MavenLibraryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.PyPiLibraryProperties; +import java.util.Arrays; + +/** + * Samples for ClusterLibraries ManageLibraries. + */ +public final class ClusterLibrariesManageLibrariesSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * UninstallExistingClusterLibraries.json + */ + /** + * Sample code: UninstallExistingClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void uninstallExistingClusterLibraries( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .manageLibraries("hiloResourceGroup", "clusterPool", "cluster", + new ClusterLibraryManagementOperation().withProperties(new ClusterLibraryManagementOperationProperties() + .withAction(LibraryManagementAction.UNINSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner().withProperties(new PyPiLibraryProperties().withName("tensorflow")), + new ClusterLibraryInner() + .withProperties(new MavenLibraryProperties().withGroupId("org.apache.flink") + .withName("flink-connector-hudi"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * InstallNewClusterLibraries.json + */ + /** + * Sample code: InstallNewClusterLibraries. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void + installNewClusterLibraries(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterLibraries() + .manageLibraries("hiloResourceGroup", "clusterPool", "cluster", + new ClusterLibraryManagementOperation().withProperties( + new ClusterLibraryManagementOperationProperties().withAction(LibraryManagementAction.INSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner() + .withProperties(new PyPiLibraryProperties().withRemarks("PyPi packages.") + .withName("requests") + .withVersion("2.31.0")), + new ClusterLibraryInner() + .withProperties(new MavenLibraryProperties().withRemarks("Maven packages.") + .withGroupId("org.apache.flink") + .withName("flink-connector-kafka") + .withVersion("3.0.2-1.18"))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListSamples.java index c7c0ae7aa908b..99f5fa15e754f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListSamples.java @@ -10,7 +10,7 @@ public final class ClusterPoolAvailableUpgradesListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPoolAvailableUpgrades.json */ /** @@ -20,7 +20,7 @@ public final class ClusterPoolAvailableUpgradesListSamples { */ public static void getClusterPoolAvailableUpgrade( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPoolAvailableUpgrades().list("hiloResourcegroup", "clusterpool1", - com.azure.core.util.Context.NONE); + manager.clusterPoolAvailableUpgrades() + .list("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListSamples.java new file mode 100644 index 0000000000000..a372d0015bacc --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListSamples.java @@ -0,0 +1,26 @@ +// 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.containers.generated; + +/** + * Samples for ClusterPoolUpgradeHistories List. + */ +public final class ClusterPoolUpgradeHistoriesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListClusterPoolUpgradeHistory.json + */ + /** + * Sample code: ClusterPoolUpgradeHistoriesListResult. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void clusterPoolUpgradeHistoriesListResult( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterPoolUpgradeHistories() + .list("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateSamples.java index 6beae2cf61c7a..60d91fa76cf15 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateSamples.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; +import java.util.Arrays; /** * Samples for ClusterPools CreateOrUpdate. @@ -16,7 +17,7 @@ public final class ClusterPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPoolWithPrivateAks.json */ /** @@ -26,12 +27,15 @@ public final class ClusterPoolsCreateOrUpdateSamples { */ public static void clusterPoolPutWithPrivateAks( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2")) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId( "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1") .withEnablePrivateApiServer(true))) @@ -40,7 +44,7 @@ public static void clusterPoolPutWithPrivateAks( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPoolWithUDRAks.json */ /** @@ -50,12 +54,15 @@ public static void clusterPoolPutWithPrivateAks( */ public static void clusterPoolPutWithUDRAks(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2")) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId( "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1") .withOutboundType(OutboundType.USER_DEFINED_ROUTING))) @@ -64,7 +71,7 @@ public static void clusterPoolPutWithPrivateAks( /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateClusterPool.json */ /** @@ -74,12 +81,15 @@ public static void clusterPoolPutWithPrivateAks( */ public static void clusterPoolPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().define("clusterpool1").withRegion("West US 2") + manager.clusterPools() + .define("clusterpool1") + .withRegion("West US 2") .withExistingResourceGroup("hiloResourcegroup") .withProperties(new ClusterPoolResourceProperties() .withClusterPoolProfile( new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2") + .withAvailabilityZones(Arrays.asList("1", "2", "3")))) .create(); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteSamples.java index 20865c63e778d..231ee208eaf0a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ClusterPoolsDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * DeleteClusterPool.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupSamples.java index 7aee99aab181f..4ac9efde2632c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClusterPoolsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetClusterPool.json */ /** @@ -20,7 +20,7 @@ public final class ClusterPoolsGetByResourceGroupSamples { */ public static void clusterPoolGet(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", - com.azure.core.util.Context.NONE); + manager.clusterPools() + .getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupSamples.java index 86020ecbd90e9..29d3cc5e69f9e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClusterPoolsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPools.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListSamples.java index 3363a698107ed..411122f124e9d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListSamples.java @@ -10,7 +10,7 @@ public final class ClusterPoolsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterPoolsSubscription.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpdateTagsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpdateTagsSamples.java index 3db1f4d3b57fc..858039fe138a4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpdateTagsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpdateTagsSamples.java @@ -14,7 +14,7 @@ public final class ClusterPoolsUpdateTagsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchClusterPool.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeSamples.java index 77a0545a04bea..9a0673de93571 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeSamples.java @@ -14,7 +14,7 @@ public final class ClusterPoolsUpgradeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeNodeOsForClusterPool.json */ /** @@ -24,14 +24,15 @@ public final class ClusterPoolsUpgradeSamples { */ public static void clusterPoolsUpgradeNodeOs(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().upgrade("hiloResourcegroup", "clusterpool1", - new ClusterPoolUpgrade().withProperties(new ClusterPoolNodeOsImageUpdateProperties()), - com.azure.core.util.Context.NONE); + manager.clusterPools() + .upgrade("hiloResourcegroup", "clusterpool1", + new ClusterPoolUpgrade().withProperties(new ClusterPoolNodeOsImageUpdateProperties()), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeAKSPatchVersionForClusterPool.json */ /** @@ -41,9 +42,11 @@ public final class ClusterPoolsUpgradeSamples { */ public static void clusterPoolsUpgradeAKSPatchVersion( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusterPools().upgrade("hiloResourcegroup", "clusterpool1", - new ClusterPoolUpgrade().withProperties(new ClusterPoolAksPatchVersionUpgradeProperties() - .withUpgradeClusterPool(true).withUpgradeAllClusterNodes(false)), - com.azure.core.util.Context.NONE); + manager.clusterPools() + .upgrade("hiloResourcegroup", "clusterpool1", + new ClusterPoolUpgrade() + .withProperties(new ClusterPoolAksPatchVersionUpgradeProperties().withUpgradeClusterPool(true) + .withUpgradeAllClusterNodes(false)), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListSamples.java new file mode 100644 index 0000000000000..df67d85b51300 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListSamples.java @@ -0,0 +1,26 @@ +// 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.containers.generated; + +/** + * Samples for ClusterUpgradeHistories List. + */ +public final class ClusterUpgradeHistoriesListSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ListClusterUpgradeHistory.json + */ + /** + * Sample code: ClusterUpgradeHistoriesListResult. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void clusterUpgradeHistoriesListResult( + com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusterUpgradeHistories() + .list("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersCreateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersCreateSamples.java index 0eacb8cda6ebd..220758569bd81 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersCreateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersCreateSamples.java @@ -16,8 +16,10 @@ import com.azure.resourcemanager.hdinsight.containers.models.ComparisonOperator; import com.azure.resourcemanager.hdinsight.containers.models.ComparisonRule; import com.azure.resourcemanager.hdinsight.containers.models.ComputeProfile; -import com.azure.resourcemanager.hdinsight.containers.models.IdentityProfile; import com.azure.resourcemanager.hdinsight.containers.models.LoadBasedConfig; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityProfile; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentitySpec; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityType; import com.azure.resourcemanager.hdinsight.containers.models.NodeProfile; import com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpec; import com.azure.resourcemanager.hdinsight.containers.models.RangerAdminSpecDatabase; @@ -43,7 +45,7 @@ public final class ClustersCreateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateSparkCluster.json */ /** @@ -53,22 +55,28 @@ public final class ClustersCreateSamples { */ public static void hDInsightSparkClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("spark") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) .withServiceConfigsProfiles(Arrays.asList( - new ClusterServiceConfigsProfile().withServiceName("spark-service").withConfigs( - Arrays.asList(new ClusterServiceConfig() - .withComponent("spark-config") + new ClusterServiceConfigsProfile().withServiceName("spark-service") + .withConfigs(Arrays.asList(new ClusterServiceConfig().withComponent("spark-config") .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("spark-defaults.conf") .withValues(mapOf("spark.eventLog.enabled", "true")))))), new ClusterServiceConfigsProfile().withServiceName("yarn-service") @@ -81,13 +89,14 @@ public final class ClustersCreateSamples { "storage.name", "teststorage", "storage.protocol", "wasb")), new ClusterConfigFile().withFileName("yarn-site.xml") .withValues(mapOf("yarn.webapp.ui2.enable", "false")))))))) - .withSshProfile(new SshProfile().withCount(2)).withSparkProfile(new SparkProfile()))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_D3_v2")) + .withSparkProfile(new SparkProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateSparkClusterWithInternalIngress.json */ /** @@ -97,22 +106,28 @@ public final class ClustersCreateSamples { */ public static void hDInsightSparkClusterPutWithInternalIngress( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("spark") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) .withServiceConfigsProfiles(Arrays.asList( - new ClusterServiceConfigsProfile().withServiceName("spark-service").withConfigs( - Arrays.asList(new ClusterServiceConfig() - .withComponent("spark-config") + new ClusterServiceConfigsProfile().withServiceName("spark-service") + .withConfigs(Arrays.asList(new ClusterServiceConfig().withComponent("spark-config") .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("spark-defaults.conf") .withValues(mapOf("spark.eventLog.enabled", "true")))))), new ClusterServiceConfigsProfile().withServiceName("yarn-service") @@ -126,13 +141,14 @@ public static void hDInsightSparkClusterPutWithInternalIngress( new ClusterConfigFile().withFileName("yarn-site.xml") .withValues(mapOf("yarn.webapp.ui2.enable", "false")))))))) .withClusterAccessProfile(new ClusterAccessProfile().withEnableInternalIngress(true)) - .withSshProfile(new SshProfile().withCount(2)).withSparkProfile(new SparkProfile()))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_D3_v2")) + .withSparkProfile(new SparkProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateAutoscaleCluster.json */ /** @@ -142,48 +158,62 @@ public static void hDInsightSparkClusterPutWithInternalIngress( */ public static void hDInsightClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("Trino") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("Head").withVmSize("Standard_E8as_v5").withCount(2), - new NodeProfile().withType("Worker").withVmSize("Standard_E8as_v5").withCount(3)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("1.0.6").withOssVersion("0.410.0") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("Head").withVmSize("Standard_E8as_v5").withCount(2), + new NodeProfile().withType("Worker").withVmSize("Standard_E8as_v5").withCount(3))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("1.0.6") + .withOssVersion("0.410.0") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) - .withSshProfile(new SshProfile().withCount(2)) - .withAutoscaleProfile( - new AutoscaleProfile().withEnabled(true).withGracefulDecommissionTimeout(3600) - .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) - .withScheduleBasedConfig(new ScheduleBasedConfig() - .withTimeZone("Cen. Australia Standard Time").withDefaultCount(10) - .withSchedules(Arrays.asList( - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(20) - .withDays(Arrays.asList(ScheduleDay.MONDAY)), - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(25) - .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) - .withLoadBasedConfig(new LoadBasedConfig().withMinNodes(10).withMaxNodes(20) - .withPollInterval(60).withCooldownPeriod(300) - .withScalingRules(Arrays.asList( - new ScalingRule().withActionType(ScaleActionType.SCALEUP).withEvaluationCount(3) - .withScalingMetric("cpu") - .withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.GREATER_THAN).withThreshold(90f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(3) - .withScalingMetric("cpu") - .withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.LESS_THAN).withThreshold(20f)))))) + .withSshProfile(new SshProfile().withCount(2).withVmSize("Standard_E8as_v5")) + .withAutoscaleProfile(new AutoscaleProfile().withEnabled(true) + .withGracefulDecommissionTimeout(3600) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig(new ScheduleBasedConfig().withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(10) + .withSchedules(Arrays.asList( + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(20) + .withDays(Arrays.asList(ScheduleDay.MONDAY)), + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(25) + .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) + .withLoadBasedConfig(new LoadBasedConfig().withMinNodes(10) + .withMaxNodes(20) + .withPollInterval(60) + .withCooldownPeriod(300) + .withScalingRules(Arrays.asList(new ScalingRule().withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN) + .withThreshold(90f)), + new ScalingRule().withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(20f)))))) .withTrinoProfile(new TrinoProfile()))) .create(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * CreateRangerCluster.json */ /** @@ -193,22 +223,32 @@ public static void hDInsightSparkClusterPutWithInternalIngress( */ public static void hDInsightRangerClusterPut(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().define("cluster1").withRegion("West US 2") + manager.clusters() + .define("cluster1") + .withRegion("West US 2") .withExistingClusterpool("hiloResourcegroup", "clusterpool1") .withProperties(new ClusterResourceProperties().withClusterType("ranger") - .withComputeProfile(new ComputeProfile().withNodes( - Arrays.asList(new NodeProfile().withType("head").withVmSize("Standard_D3_v2").withCount(2)))) - .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1").withOssVersion("2.2.3") - .withIdentityProfile(new IdentityProfile().withMsiResourceId( - "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") - .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") - .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withComputeProfile(new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("head").withVmSize("Standard_D3_v2").withCount(2))) + .withAvailabilityZones(Arrays.asList("1", "2", "3"))) + .withClusterProfile(new ClusterProfile().withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withManagedIdentityProfile(new ManagedIdentityProfile() + .withIdentityList(Arrays.asList(new ManagedIdentitySpec().withType(ManagedIdentityType.CLUSTER) + .withResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withObjectId("40491351-c240-4042-91e0-f644a1d2b441")))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) - .withRangerProfile(new RangerProfile().withRangerAdmin(new RangerAdminSpec() - .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) - .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") - .withName("testdb").withPasswordSecretRef("fakeTokenPlaceholder").withUsername("admin"))) + .withRangerProfile(new RangerProfile() + .withRangerAdmin(new RangerAdminSpec() + .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) + .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") + .withName("testdb") + .withPasswordSecretRef("fakeTokenPlaceholder") + .withUsername("admin"))) .withRangerAudit(new RangerAuditSpec() .withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteSamples.java index 16aadfaab3943..6d7757fa3a04d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteSamples.java @@ -10,7 +10,7 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * DeleteCluster.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewSamples.java index 468cb8cda957d..d2391a16c400c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetInstanceViewSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetClusterInstanceView.json */ /** @@ -20,7 +20,7 @@ public final class ClustersGetInstanceViewSamples { */ public static void hDInsightClusterGetInstanceView( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().getInstanceViewWithResponse("rg1", "clusterPool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusters() + .getInstanceViewWithResponse("rg1", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetSamples.java index 321f0204bdb6e..2965d2c9931e4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetCluster.json */ /** @@ -20,7 +20,7 @@ public final class ClustersGetSamples { */ public static void hDInsightClusterGet(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", - com.azure.core.util.Context.NONE); + manager.clusters() + .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListByClusterPoolNameSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListByClusterPoolNameSamples.java index 8f1b1983a2081..5ec2ca6da7c59 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListByClusterPoolNameSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListByClusterPoolNameSamples.java @@ -10,7 +10,7 @@ public final class ClustersListByClusterPoolNameSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClustersByClusterPoolName.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsSamples.java index 5c5926bab597b..875a721e9f090 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsSamples.java @@ -10,7 +10,7 @@ public final class ClustersListInstanceViewsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterInstanceViews.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListServiceConfigsSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListServiceConfigsSamples.java index ac0eca5a61150..6ef3a74ffccc8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListServiceConfigsSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListServiceConfigsSamples.java @@ -10,7 +10,7 @@ public final class ClustersListServiceConfigsSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ListClusterServiceConfigs.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersResizeSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersResizeSamples.java index b5acac75f18a7..24afa34a6c98c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersResizeSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersResizeSamples.java @@ -13,7 +13,7 @@ public final class ClustersResizeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * ResizeCluster.json */ /** @@ -23,9 +23,10 @@ public final class ClustersResizeSamples { */ public static void hDInsightClusterResize(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().resize( - "hiloResourcegroup", "clusterpool1", "cluster1", new ClusterResizeData().withLocation("West US 2") - .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(5)), - com.azure.core.util.Context.NONE); + manager.clusters() + .resize("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterResizeData().withLocation("West US 2") + .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(5)), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpdateSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpdateSamples.java index af5272b3b6cf8..ecf1add48a82e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpdateSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpdateSamples.java @@ -35,7 +35,7 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchRangerCluster.json */ /** @@ -48,25 +48,28 @@ public static void hDInsightRangerClusterPatchTags( Cluster resource = manager.clusters() .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withProperties(new ClusterPatchProperties() - .withClusterProfile(new UpdatableClusterProfile().withRangerProfile(new RangerProfile() - .withRangerAdmin( - new RangerAdminSpec().withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) + resource.update() + .withProperties(new ClusterPatchProperties() + .withClusterProfile(new UpdatableClusterProfile().withRangerProfile(new RangerProfile() + .withRangerAdmin(new RangerAdminSpec() + .withAdmins(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")) .withDatabase(new RangerAdminSpecDatabase().withHost("testsqlserver.database.windows.net") - .withName("testdb").withPasswordSecretRef("fakeTokenPlaceholder").withUsername("admin"))) - .withRangerAudit( - new RangerAuditSpec().withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) - .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) - .withGroups( - Arrays.asList("0a53828f-36c9-44c3-be3d-99a7fce977ad", "13be6971-79db-4f33-9d41-b25589ca25ac")) - .withMode(RangerUsersyncMode.AUTOMATIC) - .withUsers(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")))))) + .withName("testdb") + .withPasswordSecretRef("fakeTokenPlaceholder") + .withUsername("admin"))) + .withRangerAudit( + new RangerAuditSpec().withStorageAccount("https://teststorage.blob.core.windows.net/testblob")) + .withRangerUsersync(new RangerUsersyncSpec().withEnabled(true) + .withGroups(Arrays.asList("0a53828f-36c9-44c3-be3d-99a7fce977ad", + "13be6971-79db-4f33-9d41-b25589ca25ac")) + .withMode(RangerUsersyncMode.AUTOMATIC) + .withUsers(Arrays.asList("testuser1@contoso.com", "testuser2@contoso.com")))))) .apply(); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * PatchCluster.json */ /** @@ -92,48 +95,55 @@ public static void hDInsightRangerClusterPatchTags( Arrays .asList( new ClusterServiceConfig().withComponent("TestComp1") - .withFiles(Arrays.asList( - new ClusterConfigFile().withFileName("TestFile1") - .withValues(mapOf("Test.config.1", "1", - "Test.config.2", "2")), - new ClusterConfigFile().withFileName("TestFile2") - .withValues(mapOf("Test.config.3", "3", - "Test.config.4", "4")))), + .withFiles( + Arrays.asList( + new ClusterConfigFile().withFileName("TestFile1") + .withValues(mapOf("Test.config.1", "1", + "Test.config.2", "2")), + new ClusterConfigFile().withFileName("TestFile2") + .withValues(mapOf("Test.config.3", "3", + "Test.config.4", "4")))), new ClusterServiceConfig().withComponent("TestComp2") - .withFiles(Arrays.asList( - new ClusterConfigFile() - .withFileName("TestFile3") - .withContent("TestContent").withPath("TestPath"), - new ClusterConfigFile() - .withFileName("TestFile4") - .withValues(mapOf("Test.config.7", "7", - "Test.config.8", "8")))))), + .withFiles(Arrays + .asList( + new ClusterConfigFile().withFileName("TestFile3") + .withContent("TestContent") + .withPath("TestPath"), + new ClusterConfigFile() + .withFileName("TestFile4") + .withValues(mapOf("Test.config.7", "7", + "Test.config.8", "8")))))), new ClusterServiceConfigsProfile().withServiceName("TestService2") - .withConfigs(Arrays - .asList(new ClusterServiceConfig().withComponent("TestComp3").withFiles( - Arrays.asList(new ClusterConfigFile().withFileName("TestFile5") - .withValues(mapOf("Test.config.9", "9")))))))) - .withSshProfile( - new SshProfile().withCount(2)) + .withConfigs( + Arrays + .asList(new ClusterServiceConfig().withComponent("TestComp3") + .withFiles(Arrays + .asList(new ClusterConfigFile().withFileName("TestFile5") + .withValues(mapOf("Test.config.9", "9")))))))) + .withSshProfile(new SshProfile().withCount(2)) .withAutoscaleProfile( - new AutoscaleProfile().withEnabled(true).withGracefulDecommissionTimeout(-1) - .withAutoscaleType(AutoscaleType.SCHEDULE_BASED).withScheduleBasedConfig( - new ScheduleBasedConfig().withTimeZone("Cen. Australia Standard Time") - .withDefaultCount( - 3) - .withSchedules(Arrays.asList( - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(3) - .withDays(Arrays - .asList(ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), - new Schedule().withStartTime("00:00").withEndTime("12:00").withCount(3) - .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) + new AutoscaleProfile().withEnabled(true) + .withGracefulDecommissionTimeout(-1) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig(new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(3) + .withSchedules(Arrays.asList( + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays + .asList(ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), + new Schedule().withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) .withAuthorizationProfile( new AuthorizationProfile().withUserIds(Arrays.asList("Testuser1", "Testuser2"))) - .withLogAnalyticsProfile( - new ClusterLogAnalyticsProfile().withEnabled(true) - .withApplicationLogs(new ClusterLogAnalyticsApplicationLogs() - .withStdOutEnabled(true).withStdErrorEnabled(true)) - .withMetricsEnabled(true)))) + .withLogAnalyticsProfile(new ClusterLogAnalyticsProfile().withEnabled(true) + .withApplicationLogs(new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(true) + .withStdErrorEnabled(true)) + .withMetricsEnabled(true)))) .apply(); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeManualRollbackSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeManualRollbackSamples.java new file mode 100644 index 0000000000000..15333e1cf9b2f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeManualRollbackSamples.java @@ -0,0 +1,32 @@ +// 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.containers.generated; + +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollbackProperties; + +/** + * Samples for Clusters UpgradeManualRollback. + */ +public final class ClustersUpgradeManualRollbackSamples { + /* + * x-ms-original-file: + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ + * ClusterUpgradeRollback.json + */ + /** + * Sample code: ClusterUpgradeRollback. + * + * @param manager Entry point to HDInsightContainersManager. + */ + public static void + clusterUpgradeRollback(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { + manager.clusters() + .upgradeManualRollback("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgradeRollback().withProperties(new ClusterUpgradeRollbackProperties().withUpgradeHistory( + "/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/clusters/cluster1/upgradeHistories/01_11_2024_02_35_03_AM-HotfixUpgrade")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeSamples.java index 284d9bb8f9c09..a25200d31de30 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersUpgradeSamples.java @@ -14,7 +14,7 @@ public final class ClustersUpgradeSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeAKSPatchVersionForCluster.json */ /** @@ -24,14 +24,15 @@ public final class ClustersUpgradeSamples { */ public static void clustersUpgradeAKSPatchVersion( com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().upgrade("hiloResourcegroup", "clusterpool1", "cluster1", - new ClusterUpgrade().withProperties(new ClusterAksPatchVersionUpgradeProperties()), - com.azure.core.util.Context.NONE); + manager.clusters() + .upgrade("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgrade().withProperties(new ClusterAksPatchVersionUpgradeProperties()), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * UpgradeHotfixForCluster.json */ /** @@ -41,9 +42,12 @@ public static void clustersUpgradeAKSPatchVersion( */ public static void clustersUpgradeHotfix(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { - manager.clusters().upgrade("hiloResourcegroup", "clusterpool1", "cluster1", - new ClusterUpgrade().withProperties(new ClusterHotfixUpgradeProperties().withTargetOssVersion("1.16.0") - .withTargetClusterVersion("1.0.6").withTargetBuildNumber("3").withComponentName("historyserver")), - com.azure.core.util.Context.NONE); + manager.clusters() + .upgrade("hiloResourcegroup", "clusterpool1", "cluster1", + new ClusterUpgrade().withProperties(new ClusterHotfixUpgradeProperties().withTargetOssVersion("1.16.0") + .withTargetClusterVersion("1.0.6") + .withTargetBuildNumber("3") + .withComponentName("historyserver")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilitySamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilitySamples.java index c84b408b6a2f6..36d6e4d0aace9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilitySamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilitySamples.java @@ -12,7 +12,7 @@ public final class LocationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * LocationsNameAvailability.json */ /** @@ -23,8 +23,9 @@ public final class LocationsCheckNameAvailabilitySamples { public static void locationsNameAvailability(com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager manager) { manager.locations() - .checkNameAvailabilityWithResponse("southeastasia", new NameAvailabilityParameters() - .withName("contosemember1").withType("Microsoft.HDInsight/clusterPools/clusters"), + .checkNameAvailabilityWithResponse("southeastasia", + new NameAvailabilityParameters().withName("contosemember1") + .withType("Microsoft.HDInsight/clusterPools/clusters"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListSamples.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListSamples.java index 020f07d6fb9af..dc70d688ca984 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListSamples.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/samples/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-11-01-preview/examples/ + * specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ * GetOperations.json */ /** diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileAksClusterAgentPoolIdentityProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileAksClusterAgentPoolIdentityProfileTests.java index 53e7935fc5800..d59d962a8dde2 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileAksClusterAgentPoolIdentityProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileAksClusterAgentPoolIdentityProfileTests.java @@ -11,22 +11,23 @@ public final class AksClusterProfileAksClusterAgentPoolIdentityProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AksClusterProfileAksClusterAgentPoolIdentityProfile model = BinaryData.fromString( - "{\"msiResourceId\":\"ctazakljlahbcryf\",\"msiClientId\":\"dfdosygexp\",\"msiObjectId\":\"ojakhmsbzjhcrze\"}") - .toObject(AksClusterProfileAksClusterAgentPoolIdentityProfile.class); - Assertions.assertEquals("ctazakljlahbcryf", model.msiResourceId()); - Assertions.assertEquals("dfdosygexp", model.msiClientId()); - Assertions.assertEquals("ojakhmsbzjhcrze", model.msiObjectId()); + AksClusterProfileAksClusterAgentPoolIdentityProfile model + = BinaryData.fromString("{\"msiResourceId\":\"jfm\",\"msiClientId\":\"pee\",\"msiObjectId\":\"vmgxsab\"}") + .toObject(AksClusterProfileAksClusterAgentPoolIdentityProfile.class); + Assertions.assertEquals("jfm", model.msiResourceId()); + Assertions.assertEquals("pee", model.msiClientId()); + Assertions.assertEquals("vmgxsab", model.msiObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AksClusterProfileAksClusterAgentPoolIdentityProfile model - = new AksClusterProfileAksClusterAgentPoolIdentityProfile().withMsiResourceId("ctazakljlahbcryf") - .withMsiClientId("dfdosygexp").withMsiObjectId("ojakhmsbzjhcrze"); + = new AksClusterProfileAksClusterAgentPoolIdentityProfile().withMsiResourceId("jfm") + .withMsiClientId("pee") + .withMsiObjectId("vmgxsab"); model = BinaryData.fromObject(model).toObject(AksClusterProfileAksClusterAgentPoolIdentityProfile.class); - Assertions.assertEquals("ctazakljlahbcryf", model.msiResourceId()); - Assertions.assertEquals("dfdosygexp", model.msiClientId()); - Assertions.assertEquals("ojakhmsbzjhcrze", model.msiObjectId()); + Assertions.assertEquals("jfm", model.msiResourceId()); + Assertions.assertEquals("pee", model.msiClientId()); + Assertions.assertEquals("vmgxsab", model.msiObjectId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileTests.java index 679d9187ef348..f33376ce009a9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AksClusterProfileTests.java @@ -13,23 +13,25 @@ public final class AksClusterProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AksClusterProfile model = BinaryData.fromString( - "{\"aksClusterResourceId\":\"wmfdatscmdvpjhul\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"uvm\",\"msiClientId\":\"jozkrwfndiod\",\"msiObjectId\":\"pslwejdpvw\"},\"aksVersion\":\"oqpsoa\"}") + "{\"aksClusterResourceId\":\"lxxwrljdouskc\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"kocrcjdkwtnhx\",\"msiClientId\":\"njbiksqrglssain\",\"msiObjectId\":\"p\"},\"aksVersion\":\"nzl\"}") .toObject(AksClusterProfile.class); - Assertions.assertEquals("wmfdatscmdvpjhul", model.aksClusterResourceId()); - Assertions.assertEquals("uvm", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); - Assertions.assertEquals("jozkrwfndiod", model.aksClusterAgentPoolIdentityProfile().msiClientId()); - Assertions.assertEquals("pslwejdpvw", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); + Assertions.assertEquals("lxxwrljdouskc", model.aksClusterResourceId()); + Assertions.assertEquals("kocrcjdkwtnhx", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); + Assertions.assertEquals("njbiksqrglssain", model.aksClusterAgentPoolIdentityProfile().msiClientId()); + Assertions.assertEquals("p", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AksClusterProfile model = new AksClusterProfile().withAksClusterResourceId("wmfdatscmdvpjhul") - .withAksClusterAgentPoolIdentityProfile(new AksClusterProfileAksClusterAgentPoolIdentityProfile() - .withMsiResourceId("uvm").withMsiClientId("jozkrwfndiod").withMsiObjectId("pslwejdpvw")); + AksClusterProfile model = new AksClusterProfile().withAksClusterResourceId("lxxwrljdouskc") + .withAksClusterAgentPoolIdentityProfile( + new AksClusterProfileAksClusterAgentPoolIdentityProfile().withMsiResourceId("kocrcjdkwtnhx") + .withMsiClientId("njbiksqrglssain") + .withMsiObjectId("p")); model = BinaryData.fromObject(model).toObject(AksClusterProfile.class); - Assertions.assertEquals("wmfdatscmdvpjhul", model.aksClusterResourceId()); - Assertions.assertEquals("uvm", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); - Assertions.assertEquals("jozkrwfndiod", model.aksClusterAgentPoolIdentityProfile().msiClientId()); - Assertions.assertEquals("pslwejdpvw", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); + Assertions.assertEquals("lxxwrljdouskc", model.aksClusterResourceId()); + Assertions.assertEquals("kocrcjdkwtnhx", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); + Assertions.assertEquals("njbiksqrglssain", model.aksClusterAgentPoolIdentityProfile().msiClientId()); + Assertions.assertEquals("p", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AuthorizationProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AuthorizationProfileTests.java index 2662ee183dcb3..edbc4d7efe56b 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AuthorizationProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AuthorizationProfileTests.java @@ -12,20 +12,21 @@ public final class AuthorizationProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AuthorizationProfile model = BinaryData.fromString( - "{\"userIds\":[\"eo\",\"lokeyy\",\"enjbdlwtgrhp\",\"jp\"],\"groupIds\":[\"asxazjpqyegualhb\",\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"]}") + AuthorizationProfile model = BinaryData + .fromString( + "{\"userIds\":[\"clha\",\"xdbabphlwr\",\"lfktsths\",\"cocmnyyaztt\"],\"groupIds\":[\"wrqpue\"]}") .toObject(AuthorizationProfile.class); - Assertions.assertEquals("eo", model.userIds().get(0)); - Assertions.assertEquals("asxazjpqyegualhb", model.groupIds().get(0)); + Assertions.assertEquals("clha", model.userIds().get(0)); + Assertions.assertEquals("wrqpue", model.groupIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AuthorizationProfile model - = new AuthorizationProfile().withUserIds(Arrays.asList("eo", "lokeyy", "enjbdlwtgrhp", "jp")) - .withGroupIds(Arrays.asList("asxazjpqyegualhb", "xhejjzzvdud", "wdslfhotwmcy", "pwlbjnpg")); + = new AuthorizationProfile().withUserIds(Arrays.asList("clha", "xdbabphlwr", "lfktsths", "cocmnyyaztt")) + .withGroupIds(Arrays.asList("wrqpue")); model = BinaryData.fromObject(model).toObject(AuthorizationProfile.class); - Assertions.assertEquals("eo", model.userIds().get(0)); - Assertions.assertEquals("asxazjpqyegualhb", model.groupIds().get(0)); + Assertions.assertEquals("clha", model.userIds().get(0)); + Assertions.assertEquals("wrqpue", model.groupIds().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AutoscaleProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AutoscaleProfileTests.java index d232657a9712f..211544a46c1af 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AutoscaleProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AutoscaleProfileTests.java @@ -22,75 +22,84 @@ public final class AutoscaleProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutoscaleProfile model = BinaryData.fromString( - "{\"enabled\":true,\"gracefulDecommissionTimeout\":1139583555,\"autoscaleType\":\"LoadBased\",\"scheduleBasedConfig\":{\"timeZone\":\"rp\",\"defaultCount\":468707866,\"schedules\":[{\"startTime\":\"pcyvahfnljkyqx\",\"endTime\":\"vuujq\",\"count\":2065726481,\"days\":[\"Tuesday\",\"Wednesday\"]},{\"startTime\":\"gjljyoxgvc\",\"endTime\":\"tbgsncghkj\",\"count\":2112571485,\"days\":[\"Monday\"]},{\"startTime\":\"hbijhtxfvgxb\",\"endTime\":\"smx\",\"count\":455021190,\"days\":[\"Monday\",\"Monday\"]}]},\"loadBasedConfig\":{\"minNodes\":288392251,\"maxNodes\":1083472425,\"pollInterval\":1534633799,\"cooldownPeriod\":1976417253,\"scalingRules\":[{\"actionType\":\"scaleup\",\"evaluationCount\":1209438571,\"scalingMetric\":\"qkkrb\",\"comparisonRule\":{\"operator\":\"lessThanOrEqual\",\"threshold\":27.269817}},{\"actionType\":\"scaledown\",\"evaluationCount\":525812320,\"scalingMetric\":\"riwflzlfb\",\"comparisonRule\":{\"operator\":\"lessThan\",\"threshold\":13.955718}},{\"actionType\":\"scaledown\",\"evaluationCount\":1728715445,\"scalingMetric\":\"ycispnqzahmgkb\",\"comparisonRule\":{\"operator\":\"greaterThanOrEqual\",\"threshold\":63.211567}}]}}") + "{\"enabled\":false,\"gracefulDecommissionTimeout\":855265021,\"autoscaleType\":\"LoadBased\",\"scheduleBasedConfig\":{\"timeZone\":\"zvszj\",\"defaultCount\":928593835,\"schedules\":[{\"startTime\":\"vjfdx\",\"endTime\":\"ivetvtcq\",\"count\":928990245,\"days\":[\"Friday\"]},{\"startTime\":\"oqmcbxvwvxyslq\",\"endTime\":\"hsfxoblytkb\",\"count\":857226054,\"days\":[\"Monday\"]},{\"startTime\":\"wwwfbkr\",\"endTime\":\"rn\",\"count\":309197108,\"days\":[\"Saturday\",\"Wednesday\",\"Tuesday\"]}]},\"loadBasedConfig\":{\"minNodes\":925506689,\"maxNodes\":475216783,\"pollInterval\":1216343785,\"cooldownPeriod\":1861824237,\"scalingRules\":[{\"actionType\":\"scaledown\",\"evaluationCount\":249445305,\"scalingMetric\":\"asrru\",\"comparisonRule\":{\"operator\":\"lessThan\",\"threshold\":94.09205}},{\"actionType\":\"scaledown\",\"evaluationCount\":1393923794,\"scalingMetric\":\"qfsubcgjbirx\",\"comparisonRule\":{\"operator\":\"lessThan\",\"threshold\":79.85491}}]}}") .toObject(AutoscaleProfile.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1139583555, model.gracefulDecommissionTimeout()); + Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals(855265021, model.gracefulDecommissionTimeout()); Assertions.assertEquals(AutoscaleType.LOAD_BASED, model.autoscaleType()); - Assertions.assertEquals("rp", model.scheduleBasedConfig().timeZone()); - Assertions.assertEquals(468707866, model.scheduleBasedConfig().defaultCount()); - Assertions.assertEquals("pcyvahfnljkyqx", model.scheduleBasedConfig().schedules().get(0).startTime()); - Assertions.assertEquals("vuujq", model.scheduleBasedConfig().schedules().get(0).endTime()); - Assertions.assertEquals(2065726481, model.scheduleBasedConfig().schedules().get(0).count()); - Assertions.assertEquals(ScheduleDay.TUESDAY, model.scheduleBasedConfig().schedules().get(0).days().get(0)); - Assertions.assertEquals(288392251, model.loadBasedConfig().minNodes()); - Assertions.assertEquals(1083472425, model.loadBasedConfig().maxNodes()); - Assertions.assertEquals(1534633799, model.loadBasedConfig().pollInterval()); - Assertions.assertEquals(1976417253, model.loadBasedConfig().cooldownPeriod()); - Assertions.assertEquals(ScaleActionType.SCALEUP, model.loadBasedConfig().scalingRules().get(0).actionType()); - Assertions.assertEquals(1209438571, model.loadBasedConfig().scalingRules().get(0).evaluationCount()); - Assertions.assertEquals("qkkrb", model.loadBasedConfig().scalingRules().get(0).scalingMetric()); - Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, + Assertions.assertEquals("zvszj", model.scheduleBasedConfig().timeZone()); + Assertions.assertEquals(928593835, model.scheduleBasedConfig().defaultCount()); + Assertions.assertEquals("vjfdx", model.scheduleBasedConfig().schedules().get(0).startTime()); + Assertions.assertEquals("ivetvtcq", model.scheduleBasedConfig().schedules().get(0).endTime()); + Assertions.assertEquals(928990245, model.scheduleBasedConfig().schedules().get(0).count()); + Assertions.assertEquals(ScheduleDay.FRIDAY, model.scheduleBasedConfig().schedules().get(0).days().get(0)); + Assertions.assertEquals(925506689, model.loadBasedConfig().minNodes()); + Assertions.assertEquals(475216783, model.loadBasedConfig().maxNodes()); + Assertions.assertEquals(1216343785, model.loadBasedConfig().pollInterval()); + Assertions.assertEquals(1861824237, model.loadBasedConfig().cooldownPeriod()); + Assertions.assertEquals(ScaleActionType.SCALEDOWN, model.loadBasedConfig().scalingRules().get(0).actionType()); + Assertions.assertEquals(249445305, model.loadBasedConfig().scalingRules().get(0).evaluationCount()); + Assertions.assertEquals("asrru", model.loadBasedConfig().scalingRules().get(0).scalingMetric()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.loadBasedConfig().scalingRules().get(0).comparisonRule().operator()); - Assertions.assertEquals(27.269817f, model.loadBasedConfig().scalingRules().get(0).comparisonRule().threshold()); + Assertions.assertEquals(94.09205f, model.loadBasedConfig().scalingRules().get(0).comparisonRule().threshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutoscaleProfile model = new AutoscaleProfile().withEnabled(true).withGracefulDecommissionTimeout(1139583555) + AutoscaleProfile model = new AutoscaleProfile().withEnabled(false) + .withGracefulDecommissionTimeout(855265021) .withAutoscaleType(AutoscaleType.LOAD_BASED) - .withScheduleBasedConfig(new ScheduleBasedConfig().withTimeZone("rp").withDefaultCount(468707866) + .withScheduleBasedConfig(new ScheduleBasedConfig().withTimeZone("zvszj") + .withDefaultCount(928593835) .withSchedules(Arrays.asList( - new Schedule().withStartTime("pcyvahfnljkyqx").withEndTime("vuujq").withCount(2065726481) - .withDays(Arrays.asList(ScheduleDay.TUESDAY, ScheduleDay.WEDNESDAY)), - new Schedule().withStartTime("gjljyoxgvc").withEndTime("tbgsncghkj").withCount(2112571485) + new Schedule().withStartTime("vjfdx") + .withEndTime("ivetvtcq") + .withCount(928990245) + .withDays(Arrays.asList(ScheduleDay.FRIDAY)), + new Schedule().withStartTime("oqmcbxvwvxyslq") + .withEndTime("hsfxoblytkb") + .withCount(857226054) .withDays(Arrays.asList(ScheduleDay.MONDAY)), - new Schedule().withStartTime("hbijhtxfvgxb").withEndTime("smx").withCount(455021190) - .withDays(Arrays.asList(ScheduleDay.MONDAY, ScheduleDay.MONDAY))))) + new Schedule().withStartTime("wwwfbkr") + .withEndTime("rn") + .withCount(309197108) + .withDays(Arrays.asList(ScheduleDay.SATURDAY, ScheduleDay.WEDNESDAY, ScheduleDay.TUESDAY))))) .withLoadBasedConfig( - new LoadBasedConfig().withMinNodes(288392251).withMaxNodes(1083472425).withPollInterval(1534633799) - .withCooldownPeriod(1976417253).withScalingRules( - Arrays.asList( - new ScalingRule().withActionType(ScaleActionType.SCALEUP).withEvaluationCount(1209438571) - .withScalingMetric("qkkrb").withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.LESS_THAN_OR_EQUAL).withThreshold(27.269817f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(525812320) - .withScalingMetric("riwflzlfb") - .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN) - .withThreshold(13.955718f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(1728715445) - .withScalingMetric("ycispnqzahmgkb").withComparisonRule( - new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN_OR_EQUAL) - .withThreshold(63.211567f))))); + new LoadBasedConfig().withMinNodes(925506689) + .withMaxNodes(475216783) + .withPollInterval(1216343785) + .withCooldownPeriod(1861824237) + .withScalingRules(Arrays.asList( + new ScalingRule().withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(249445305) + .withScalingMetric("asrru") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(94.09205f)), + new ScalingRule().withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(1393923794) + .withScalingMetric("qfsubcgjbirx") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(79.85491f))))); model = BinaryData.fromObject(model).toObject(AutoscaleProfile.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1139583555, model.gracefulDecommissionTimeout()); + Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals(855265021, model.gracefulDecommissionTimeout()); Assertions.assertEquals(AutoscaleType.LOAD_BASED, model.autoscaleType()); - Assertions.assertEquals("rp", model.scheduleBasedConfig().timeZone()); - Assertions.assertEquals(468707866, model.scheduleBasedConfig().defaultCount()); - Assertions.assertEquals("pcyvahfnljkyqx", model.scheduleBasedConfig().schedules().get(0).startTime()); - Assertions.assertEquals("vuujq", model.scheduleBasedConfig().schedules().get(0).endTime()); - Assertions.assertEquals(2065726481, model.scheduleBasedConfig().schedules().get(0).count()); - Assertions.assertEquals(ScheduleDay.TUESDAY, model.scheduleBasedConfig().schedules().get(0).days().get(0)); - Assertions.assertEquals(288392251, model.loadBasedConfig().minNodes()); - Assertions.assertEquals(1083472425, model.loadBasedConfig().maxNodes()); - Assertions.assertEquals(1534633799, model.loadBasedConfig().pollInterval()); - Assertions.assertEquals(1976417253, model.loadBasedConfig().cooldownPeriod()); - Assertions.assertEquals(ScaleActionType.SCALEUP, model.loadBasedConfig().scalingRules().get(0).actionType()); - Assertions.assertEquals(1209438571, model.loadBasedConfig().scalingRules().get(0).evaluationCount()); - Assertions.assertEquals("qkkrb", model.loadBasedConfig().scalingRules().get(0).scalingMetric()); - Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, + Assertions.assertEquals("zvszj", model.scheduleBasedConfig().timeZone()); + Assertions.assertEquals(928593835, model.scheduleBasedConfig().defaultCount()); + Assertions.assertEquals("vjfdx", model.scheduleBasedConfig().schedules().get(0).startTime()); + Assertions.assertEquals("ivetvtcq", model.scheduleBasedConfig().schedules().get(0).endTime()); + Assertions.assertEquals(928990245, model.scheduleBasedConfig().schedules().get(0).count()); + Assertions.assertEquals(ScheduleDay.FRIDAY, model.scheduleBasedConfig().schedules().get(0).days().get(0)); + Assertions.assertEquals(925506689, model.loadBasedConfig().minNodes()); + Assertions.assertEquals(475216783, model.loadBasedConfig().maxNodes()); + Assertions.assertEquals(1216343785, model.loadBasedConfig().pollInterval()); + Assertions.assertEquals(1861824237, model.loadBasedConfig().cooldownPeriod()); + Assertions.assertEquals(ScaleActionType.SCALEDOWN, model.loadBasedConfig().scalingRules().get(0).actionType()); + Assertions.assertEquals(249445305, model.loadBasedConfig().scalingRules().get(0).evaluationCount()); + Assertions.assertEquals("asrru", model.loadBasedConfig().scalingRules().get(0).scalingMetric()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.loadBasedConfig().scalingRules().get(0).comparisonRule().operator()); - Assertions.assertEquals(27.269817f, model.loadBasedConfig().scalingRules().get(0).comparisonRule().threshold()); + Assertions.assertEquals(94.09205f, model.loadBasedConfig().scalingRules().get(0).comparisonRule().threshold()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationMockTests.java index d72497cc52b51..880f91222f785 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterPoolVersionsListByLocationMockTests.java @@ -6,54 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolVersion; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class AvailableClusterPoolVersionsListByLocationMockTests { @Test public void testListByLocation() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"clusterPoolVersion\":\"iftxfkf\",\"aksVersion\":\"gpr\",\"isPreview\":true},\"id\":\"llu\",\"name\":\"biqtgdq\",\"type\":\"hm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"clusterPoolVersion\":\"hxkumasjcaacfdmm\",\"aksVersion\":\"ugmehqepvufhbze\",\"isPreview\":true},\"id\":\"oqhnlb\",\"name\":\"nbldxeaclgschori\",\"type\":\"krsrrmoucs\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.availableClusterPoolVersions().listByLocation("idltugsresmkss", com.azure.core.util.Context.NONE); + = manager.availableClusterPoolVersions().listByLocation("fppdbwnu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("iftxfkf", response.iterator().next().properties().clusterPoolVersion()); - Assertions.assertEquals("gpr", response.iterator().next().properties().aksVersion()); + Assertions.assertEquals("hxkumasjcaacfdmm", response.iterator().next().properties().clusterPoolVersion()); + Assertions.assertEquals("ugmehqepvufhbze", response.iterator().next().properties().aksVersion()); Assertions.assertEquals(true, response.iterator().next().properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationMockTests.java index 0823eadc89b1f..e85acbb03545c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/AvailableClusterVersionsListByLocationMockTests.java @@ -6,56 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterVersion; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class AvailableClusterVersionsListByLocationMockTests { @Test public void testListByLocation() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"clusterType\":\"libph\",\"clusterVersion\":\"zmizakakan\",\"ossVersion\":\"p\",\"clusterPoolVersion\":\"jzhajoy\",\"isPreview\":true,\"components\":[{\"name\":\"oyxprimr\",\"version\":\"pteecjme\"},{\"name\":\"ls\",\"version\":\"asylwx\"},{\"name\":\"aumweoohguufu\",\"version\":\"oyjathwtzol\"}]},\"id\":\"emwmdxmebwjs\",\"name\":\"jpahlxvea\",\"type\":\"f\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"clusterType\":\"eolhbhlvbmx\",\"clusterVersion\":\"ibsxtkcud\",\"ossVersion\":\"sfar\",\"clusterPoolVersion\":\"iowl\",\"isPreview\":false,\"components\":[{\"name\":\"vwgf\",\"version\":\"mhqykizmdksa\"},{\"name\":\"fcluqvo\",\"version\":\"ycjimryvwgcwwpbm\"}]},\"id\":\"w\",\"name\":\"sydsxwefohe\",\"type\":\"bvopwndyqle\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.availableClusterVersions().listByLocation("wsldrizetpwbr", com.azure.core.util.Context.NONE); + = manager.availableClusterVersions().listByLocation("fldpuviyfc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("libph", response.iterator().next().properties().clusterType()); - Assertions.assertEquals("zmizakakan", response.iterator().next().properties().clusterVersion()); - Assertions.assertEquals("p", response.iterator().next().properties().ossVersion()); - Assertions.assertEquals("jzhajoy", response.iterator().next().properties().clusterPoolVersion()); - Assertions.assertEquals(true, response.iterator().next().properties().isPreview()); + Assertions.assertEquals("eolhbhlvbmx", response.iterator().next().properties().clusterType()); + Assertions.assertEquals("ibsxtkcud", response.iterator().next().properties().clusterVersion()); + Assertions.assertEquals("sfar", response.iterator().next().properties().ossVersion()); + Assertions.assertEquals("iowl", response.iterator().next().properties().clusterPoolVersion()); + Assertions.assertEquals(false, response.iterator().next().properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAccessProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAccessProfileTests.java index 5111d9fd9e50a..077c488fc9e74 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAccessProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAccessProfileTests.java @@ -12,7 +12,7 @@ public final class ClusterAccessProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterAccessProfile model - = BinaryData.fromString("{\"enableInternalIngress\":true,\"privateLinkServiceId\":\"ivfsnk\"}") + = BinaryData.fromString("{\"enableInternalIngress\":true,\"privateLinkServiceId\":\"bkdmo\"}") .toObject(ClusterAccessProfile.class); Assertions.assertEquals(true, model.enableInternalIngress()); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAksPatchUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAksPatchUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..57eadb2e347b5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAksPatchUpgradeHistoryPropertiesTests.java @@ -0,0 +1,37 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterAksPatchUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterAksPatchUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterAksPatchUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"AKSPatchUpgrade\",\"originalVersion\":\"wnpjhlfzswpchwa\",\"newVersion\":\"bousn\",\"utcTime\":\"epgfew\",\"upgradeResult\":\"Succeed\"}") + .toObject(ClusterAksPatchUpgradeHistoryProperties.class); + Assertions.assertEquals("epgfew", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("wnpjhlfzswpchwa", model.originalVersion()); + Assertions.assertEquals("bousn", model.newVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterAksPatchUpgradeHistoryProperties model + = new ClusterAksPatchUpgradeHistoryProperties().withUtcTime("epgfew") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.SUCCEED) + .withOriginalVersion("wnpjhlfzswpchwa") + .withNewVersion("bousn"); + model = BinaryData.fromObject(model).toObject(ClusterAksPatchUpgradeHistoryProperties.class); + Assertions.assertEquals("epgfew", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("wnpjhlfzswpchwa", model.originalVersion()); + Assertions.assertEquals("bousn", model.newVersion()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableInPlaceUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableInPlaceUpgradePropertiesTests.java new file mode 100644 index 0000000000000..9382ee631b12c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableInPlaceUpgradePropertiesTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableInPlaceUpgradeProperties; +import com.azure.resourcemanager.hdinsight.containers.models.Severity; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ClusterAvailableInPlaceUpgradePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterAvailableInPlaceUpgradeProperties model = BinaryData.fromString( + "{\"upgradeType\":\"ClusterAvailableInPlaceUpgradeProperties\",\"description\":\"z\",\"sourceOssVersion\":\"rjvpglydzgkrvqee\",\"sourceClusterVersion\":\"oepry\",\"sourceBuildNumber\":\"nwy\",\"targetOssVersion\":\"zdmovzv\",\"targetClusterVersion\":\"aawzqadfl\",\"targetBuildNumber\":\"ur\",\"componentName\":\"laecxndticok\",\"severity\":\"high\",\"extendedProperties\":\"lqtmldgxob\",\"createdTime\":\"2021-09-19T17:45:42Z\"}") + .toObject(ClusterAvailableInPlaceUpgradeProperties.class); + Assertions.assertEquals("z", model.description()); + Assertions.assertEquals("rjvpglydzgkrvqee", model.sourceOssVersion()); + Assertions.assertEquals("oepry", model.sourceClusterVersion()); + Assertions.assertEquals("nwy", model.sourceBuildNumber()); + Assertions.assertEquals("zdmovzv", model.targetOssVersion()); + Assertions.assertEquals("aawzqadfl", model.targetClusterVersion()); + Assertions.assertEquals("ur", model.targetBuildNumber()); + Assertions.assertEquals("laecxndticok", model.componentName()); + Assertions.assertEquals(Severity.HIGH, model.severity()); + Assertions.assertEquals("lqtmldgxob", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T17:45:42Z"), model.createdTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterAvailableInPlaceUpgradeProperties model + = new ClusterAvailableInPlaceUpgradeProperties().withDescription("z") + .withSourceOssVersion("rjvpglydzgkrvqee") + .withSourceClusterVersion("oepry") + .withSourceBuildNumber("nwy") + .withTargetOssVersion("zdmovzv") + .withTargetClusterVersion("aawzqadfl") + .withTargetBuildNumber("ur") + .withComponentName("laecxndticok") + .withSeverity(Severity.HIGH) + .withExtendedProperties("lqtmldgxob") + .withCreatedTime(OffsetDateTime.parse("2021-09-19T17:45:42Z")); + model = BinaryData.fromObject(model).toObject(ClusterAvailableInPlaceUpgradeProperties.class); + Assertions.assertEquals("z", model.description()); + Assertions.assertEquals("rjvpglydzgkrvqee", model.sourceOssVersion()); + Assertions.assertEquals("oepry", model.sourceClusterVersion()); + Assertions.assertEquals("nwy", model.sourceBuildNumber()); + Assertions.assertEquals("zdmovzv", model.targetOssVersion()); + Assertions.assertEquals("aawzqadfl", model.targetClusterVersion()); + Assertions.assertEquals("ur", model.targetBuildNumber()); + Assertions.assertEquals("laecxndticok", model.componentName()); + Assertions.assertEquals(Severity.HIGH, model.severity()); + Assertions.assertEquals("lqtmldgxob", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T17:45:42Z"), model.createdTime()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeAksPatchUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeAksPatchUpgradePropertiesTests.java index 248bf826171e4..7410ca871b435 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeAksPatchUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeAksPatchUpgradePropertiesTests.java @@ -13,21 +13,22 @@ public final class ClusterAvailableUpgradeAksPatchUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterAvailableUpgradeAksPatchUpgradeProperties model = BinaryData.fromString( - "{\"upgradeType\":\"AKSPatchUpgrade\",\"currentVersion\":\"fffiak\",\"currentVersionStatus\":\"Deprecated\",\"latestVersion\":\"qmt\"}") + "{\"upgradeType\":\"AKSPatchUpgrade\",\"currentVersion\":\"slevufuztc\",\"currentVersionStatus\":\"Supported\",\"latestVersion\":\"jtqedcgzulwmm\"}") .toObject(ClusterAvailableUpgradeAksPatchUpgradeProperties.class); - Assertions.assertEquals("fffiak", model.currentVersion()); - Assertions.assertEquals(CurrentClusterAksVersionStatus.DEPRECATED, model.currentVersionStatus()); - Assertions.assertEquals("qmt", model.latestVersion()); + Assertions.assertEquals("slevufuztc", model.currentVersion()); + Assertions.assertEquals(CurrentClusterAksVersionStatus.SUPPORTED, model.currentVersionStatus()); + Assertions.assertEquals("jtqedcgzulwmm", model.latestVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterAvailableUpgradeAksPatchUpgradeProperties model - = new ClusterAvailableUpgradeAksPatchUpgradeProperties().withCurrentVersion("fffiak") - .withCurrentVersionStatus(CurrentClusterAksVersionStatus.DEPRECATED).withLatestVersion("qmt"); + = new ClusterAvailableUpgradeAksPatchUpgradeProperties().withCurrentVersion("slevufuztc") + .withCurrentVersionStatus(CurrentClusterAksVersionStatus.SUPPORTED) + .withLatestVersion("jtqedcgzulwmm"); model = BinaryData.fromObject(model).toObject(ClusterAvailableUpgradeAksPatchUpgradeProperties.class); - Assertions.assertEquals("fffiak", model.currentVersion()); - Assertions.assertEquals(CurrentClusterAksVersionStatus.DEPRECATED, model.currentVersionStatus()); - Assertions.assertEquals("qmt", model.latestVersion()); + Assertions.assertEquals("slevufuztc", model.currentVersion()); + Assertions.assertEquals(CurrentClusterAksVersionStatus.SUPPORTED, model.currentVersionStatus()); + Assertions.assertEquals("jtqedcgzulwmm", model.latestVersion()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeHotfixUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeHotfixUpgradePropertiesTests.java index 653477a3b0f9e..2e506fa14a0fe 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeHotfixUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeHotfixUpgradePropertiesTests.java @@ -14,39 +14,46 @@ public final class ClusterAvailableUpgradeHotfixUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterAvailableUpgradeHotfixUpgradeProperties model = BinaryData.fromString( - "{\"upgradeType\":\"HotfixUpgrade\",\"description\":\"ltmm\",\"sourceOssVersion\":\"hyeozphvwau\",\"sourceClusterVersion\":\"ncyg\",\"sourceBuildNumber\":\"kvi\",\"targetOssVersion\":\"dscwxqupevzhf\",\"targetClusterVersion\":\"otxhojujby\",\"targetBuildNumber\":\"lmcuvhixb\",\"componentName\":\"yfwnylr\",\"severity\":\"low\",\"extendedProperties\":\"sttp\",\"createdTime\":\"2021-06-29T07:31:54Z\"}") + "{\"upgradeType\":\"HotfixUpgrade\",\"description\":\"lnpkciay\",\"sourceOssVersion\":\"iykhy\",\"sourceClusterVersion\":\"fvjlboxqvkjlmx\",\"sourceBuildNumber\":\"mdy\",\"targetOssVersion\":\"dwdigumb\",\"targetClusterVersion\":\"aauzzptjazysd\",\"targetBuildNumber\":\"ezwwv\",\"componentName\":\"qyuvvfonkp\",\"severity\":\"medium\",\"extendedProperties\":\"ikvylauya\",\"createdTime\":\"2021-08-12T09:12:49Z\"}") .toObject(ClusterAvailableUpgradeHotfixUpgradeProperties.class); - Assertions.assertEquals("ltmm", model.description()); - Assertions.assertEquals("hyeozphvwau", model.sourceOssVersion()); - Assertions.assertEquals("ncyg", model.sourceClusterVersion()); - Assertions.assertEquals("kvi", model.sourceBuildNumber()); - Assertions.assertEquals("dscwxqupevzhf", model.targetOssVersion()); - Assertions.assertEquals("otxhojujby", model.targetClusterVersion()); - Assertions.assertEquals("lmcuvhixb", model.targetBuildNumber()); - Assertions.assertEquals("yfwnylr", model.componentName()); - Assertions.assertEquals(Severity.LOW, model.severity()); - Assertions.assertEquals("sttp", model.extendedProperties()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T07:31:54Z"), model.createdTime()); + Assertions.assertEquals("lnpkciay", model.description()); + Assertions.assertEquals("iykhy", model.sourceOssVersion()); + Assertions.assertEquals("fvjlboxqvkjlmx", model.sourceClusterVersion()); + Assertions.assertEquals("mdy", model.sourceBuildNumber()); + Assertions.assertEquals("dwdigumb", model.targetOssVersion()); + Assertions.assertEquals("aauzzptjazysd", model.targetClusterVersion()); + Assertions.assertEquals("ezwwv", model.targetBuildNumber()); + Assertions.assertEquals("qyuvvfonkp", model.componentName()); + Assertions.assertEquals(Severity.MEDIUM, model.severity()); + Assertions.assertEquals("ikvylauya", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T09:12:49Z"), model.createdTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterAvailableUpgradeHotfixUpgradeProperties model = new ClusterAvailableUpgradeHotfixUpgradeProperties() - .withDescription("ltmm").withSourceOssVersion("hyeozphvwau").withSourceClusterVersion("ncyg") - .withSourceBuildNumber("kvi").withTargetOssVersion("dscwxqupevzhf").withTargetClusterVersion("otxhojujby") - .withTargetBuildNumber("lmcuvhixb").withComponentName("yfwnylr").withSeverity(Severity.LOW) - .withExtendedProperties("sttp").withCreatedTime(OffsetDateTime.parse("2021-06-29T07:31:54Z")); + ClusterAvailableUpgradeHotfixUpgradeProperties model + = new ClusterAvailableUpgradeHotfixUpgradeProperties().withDescription("lnpkciay") + .withSourceOssVersion("iykhy") + .withSourceClusterVersion("fvjlboxqvkjlmx") + .withSourceBuildNumber("mdy") + .withTargetOssVersion("dwdigumb") + .withTargetClusterVersion("aauzzptjazysd") + .withTargetBuildNumber("ezwwv") + .withComponentName("qyuvvfonkp") + .withSeverity(Severity.MEDIUM) + .withExtendedProperties("ikvylauya") + .withCreatedTime(OffsetDateTime.parse("2021-08-12T09:12:49Z")); model = BinaryData.fromObject(model).toObject(ClusterAvailableUpgradeHotfixUpgradeProperties.class); - Assertions.assertEquals("ltmm", model.description()); - Assertions.assertEquals("hyeozphvwau", model.sourceOssVersion()); - Assertions.assertEquals("ncyg", model.sourceClusterVersion()); - Assertions.assertEquals("kvi", model.sourceBuildNumber()); - Assertions.assertEquals("dscwxqupevzhf", model.targetOssVersion()); - Assertions.assertEquals("otxhojujby", model.targetClusterVersion()); - Assertions.assertEquals("lmcuvhixb", model.targetBuildNumber()); - Assertions.assertEquals("yfwnylr", model.componentName()); - Assertions.assertEquals(Severity.LOW, model.severity()); - Assertions.assertEquals("sttp", model.extendedProperties()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T07:31:54Z"), model.createdTime()); + Assertions.assertEquals("lnpkciay", model.description()); + Assertions.assertEquals("iykhy", model.sourceOssVersion()); + Assertions.assertEquals("fvjlboxqvkjlmx", model.sourceClusterVersion()); + Assertions.assertEquals("mdy", model.sourceBuildNumber()); + Assertions.assertEquals("dwdigumb", model.targetOssVersion()); + Assertions.assertEquals("aauzzptjazysd", model.targetClusterVersion()); + Assertions.assertEquals("ezwwv", model.targetBuildNumber()); + Assertions.assertEquals("qyuvvfonkp", model.componentName()); + Assertions.assertEquals(Severity.MEDIUM, model.severity()); + Assertions.assertEquals("ikvylauya", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T09:12:49Z"), model.createdTime()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeInnerTests.java index d90a32f666ea3..817c2bfa86bf5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeInnerTests.java @@ -12,7 +12,7 @@ public final class ClusterAvailableUpgradeInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterAvailableUpgradeInner model = BinaryData.fromString( - "{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"qcslyjpkiid\",\"name\":\"yexz\",\"type\":\"eli\"}") + "{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"lqiyntorzihl\",\"name\":\"osjswsr\",\"type\":\"slyzrpzbchckqq\"}") .toObject(ClusterAvailableUpgradeInner.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeListTests.java index 89ad29ef38d60..af3abdd45380d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeListTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradeListTests.java @@ -15,9 +15,9 @@ public final class ClusterAvailableUpgradeListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterAvailableUpgradeList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"zovawjvz\",\"name\":\"nluthnnp\",\"type\":\"nxipeil\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"uaejxdultsk\",\"name\":\"bbtdzumvee\",\"type\":\"gpw\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"hkfpbs\",\"name\":\"yofd\",\"type\":\"luu\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"touwaboekqv\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}],\"nextLink\":\"xyawj\"}") + "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"dyh\",\"name\":\"pkkpw\",\"type\":\"reqnovvqfov\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"ywsuwsy\",\"name\":\"s\",\"type\":\"dsytgadgvr\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"en\",\"name\":\"qnzarrwl\",\"type\":\"uu\"},{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"qkacewii\",\"name\":\"fpubjibwwi\",\"type\":\"tohqkvpuvksgp\"}],\"nextLink\":\"aknynfsynljphuop\"}") .toObject(ClusterAvailableUpgradeList.class); - Assertions.assertEquals("xyawj", model.nextLink()); + Assertions.assertEquals("aknynfsynljphuop", model.nextLink()); } @org.junit.jupiter.api.Test @@ -28,8 +28,8 @@ public void testSerialize() throws Exception { new ClusterAvailableUpgradeInner().withProperties(new ClusterAvailableUpgradeProperties()), new ClusterAvailableUpgradeInner().withProperties(new ClusterAvailableUpgradeProperties()), new ClusterAvailableUpgradeInner().withProperties(new ClusterAvailableUpgradeProperties()))) - .withNextLink("xyawj"); + .withNextLink("aknynfsynljphuop"); model = BinaryData.fromObject(model).toObject(ClusterAvailableUpgradeList.class); - Assertions.assertEquals("xyawj", model.nextLink()); + Assertions.assertEquals("aknynfsynljphuop", model.nextLink()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradePatchVersionUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradePatchVersionUpgradePropertiesTests.java new file mode 100644 index 0000000000000..3039ba2219291 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradePatchVersionUpgradePropertiesTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgradePatchVersionUpgradeProperties; +import com.azure.resourcemanager.hdinsight.containers.models.Severity; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ClusterAvailableUpgradePatchVersionUpgradePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterAvailableUpgradePatchVersionUpgradeProperties model = BinaryData.fromString( + "{\"upgradeType\":\"PatchVersionUpgrade\",\"description\":\"mncsttijfybvp\",\"sourceOssVersion\":\"krsgsgb\",\"sourceClusterVersion\":\"uzqgnjdgkynsc\",\"sourceBuildNumber\":\"qhzvhxnkomt\",\"targetOssVersion\":\"bo\",\"targetClusterVersion\":\"pnvdxz\",\"targetBuildNumber\":\"ihfrbbcevqa\",\"componentName\":\"ltd\",\"severity\":\"medium\",\"extendedProperties\":\"qojpy\",\"createdTime\":\"2021-02-26T15:30:37Z\"}") + .toObject(ClusterAvailableUpgradePatchVersionUpgradeProperties.class); + Assertions.assertEquals("mncsttijfybvp", model.description()); + Assertions.assertEquals("krsgsgb", model.sourceOssVersion()); + Assertions.assertEquals("uzqgnjdgkynsc", model.sourceClusterVersion()); + Assertions.assertEquals("qhzvhxnkomt", model.sourceBuildNumber()); + Assertions.assertEquals("bo", model.targetOssVersion()); + Assertions.assertEquals("pnvdxz", model.targetClusterVersion()); + Assertions.assertEquals("ihfrbbcevqa", model.targetBuildNumber()); + Assertions.assertEquals("ltd", model.componentName()); + Assertions.assertEquals(Severity.MEDIUM, model.severity()); + Assertions.assertEquals("qojpy", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T15:30:37Z"), model.createdTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterAvailableUpgradePatchVersionUpgradeProperties model + = new ClusterAvailableUpgradePatchVersionUpgradeProperties().withDescription("mncsttijfybvp") + .withSourceOssVersion("krsgsgb") + .withSourceClusterVersion("uzqgnjdgkynsc") + .withSourceBuildNumber("qhzvhxnkomt") + .withTargetOssVersion("bo") + .withTargetClusterVersion("pnvdxz") + .withTargetBuildNumber("ihfrbbcevqa") + .withComponentName("ltd") + .withSeverity(Severity.MEDIUM) + .withExtendedProperties("qojpy") + .withCreatedTime(OffsetDateTime.parse("2021-02-26T15:30:37Z")); + model = BinaryData.fromObject(model).toObject(ClusterAvailableUpgradePatchVersionUpgradeProperties.class); + Assertions.assertEquals("mncsttijfybvp", model.description()); + Assertions.assertEquals("krsgsgb", model.sourceOssVersion()); + Assertions.assertEquals("uzqgnjdgkynsc", model.sourceClusterVersion()); + Assertions.assertEquals("qhzvhxnkomt", model.sourceBuildNumber()); + Assertions.assertEquals("bo", model.targetOssVersion()); + Assertions.assertEquals("pnvdxz", model.targetClusterVersion()); + Assertions.assertEquals("ihfrbbcevqa", model.targetBuildNumber()); + Assertions.assertEquals("ltd", model.componentName()); + Assertions.assertEquals(Severity.MEDIUM, model.severity()); + Assertions.assertEquals("qojpy", model.extendedProperties()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T15:30:37Z"), model.createdTime()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListMockTests.java index 31060b53871aa..2d8b8b7464620 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterAvailableUpgradesListMockTests.java @@ -6,50 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterAvailableUpgrade; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterAvailableUpgradesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"tzeexav\",\"name\":\"xtfglecdmdqb\",\"type\":\"pypqtgsfj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterAvailableUpgradeProperties\"},\"id\":\"dbhfhp\",\"name\":\"paz\",\"type\":\"zoyw\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.clusterAvailableUpgrades().list("xtxsuwprtujw", - "awddjibab", "vit", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.clusterAvailableUpgrades().list("zjcpeogk", "nmg", "ro", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterComponentsItemTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterComponentsItemTests.java index 930b0e9e2595b..bdd7c30b2088e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterComponentsItemTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterComponentsItemTests.java @@ -11,17 +11,17 @@ public final class ClusterComponentsItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterComponentsItem model = BinaryData.fromString("{\"name\":\"hcbonqvpkvlr\",\"version\":\"jease\"}") + ClusterComponentsItem model = BinaryData.fromString("{\"name\":\"ispnqzahmgkbrp\",\"version\":\"dhibnuq\"}") .toObject(ClusterComponentsItem.class); - Assertions.assertEquals("hcbonqvpkvlr", model.name()); - Assertions.assertEquals("jease", model.version()); + Assertions.assertEquals("ispnqzahmgkbrp", model.name()); + Assertions.assertEquals("dhibnuq", model.version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterComponentsItem model = new ClusterComponentsItem().withName("hcbonqvpkvlr").withVersion("jease"); + ClusterComponentsItem model = new ClusterComponentsItem().withName("ispnqzahmgkbrp").withVersion("dhibnuq"); model = BinaryData.fromObject(model).toObject(ClusterComponentsItem.class); - Assertions.assertEquals("hcbonqvpkvlr", model.name()); - Assertions.assertEquals("jease", model.version()); + Assertions.assertEquals("ispnqzahmgkbrp", model.name()); + Assertions.assertEquals("dhibnuq", model.version()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterConfigFileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterConfigFileTests.java index 446db450c92de..ead287a6c7d11 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterConfigFileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterConfigFileTests.java @@ -15,26 +15,28 @@ public final class ClusterConfigFileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterConfigFile model = BinaryData.fromString( - "{\"fileName\":\"iukbldngkpoci\",\"content\":\"z\",\"encoding\":\"Base64\",\"path\":\"gukgjnpiucgygevq\",\"values\":{\"rbpizc\":\"yp\",\"j\":\"r\",\"yhxdeoejzicwi\":\"dpydn\",\"bkh\":\"sjttgzfbish\"}}") + "{\"fileName\":\"ttouwaboekqvkel\",\"content\":\"mvb\",\"encoding\":\"None\",\"path\":\"sflhhca\",\"values\":{\"yjpkiidzyexz\":\"jixisxyawjoyaqcs\"}}") .toObject(ClusterConfigFile.class); - Assertions.assertEquals("iukbldngkpoci", model.fileName()); - Assertions.assertEquals("z", model.content()); - Assertions.assertEquals(ContentEncoding.BASE64, model.encoding()); - Assertions.assertEquals("gukgjnpiucgygevq", model.path()); - Assertions.assertEquals("yp", model.values().get("rbpizc")); + Assertions.assertEquals("ttouwaboekqvkel", model.fileName()); + Assertions.assertEquals("mvb", model.content()); + Assertions.assertEquals(ContentEncoding.NONE, model.encoding()); + Assertions.assertEquals("sflhhca", model.path()); + Assertions.assertEquals("jixisxyawjoyaqcs", model.values().get("yjpkiidzyexz")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterConfigFile model = new ClusterConfigFile().withFileName("iukbldngkpoci").withContent("z") - .withEncoding(ContentEncoding.BASE64).withPath("gukgjnpiucgygevq") - .withValues(mapOf("rbpizc", "yp", "j", "r", "yhxdeoejzicwi", "dpydn", "bkh", "sjttgzfbish")); + ClusterConfigFile model = new ClusterConfigFile().withFileName("ttouwaboekqvkel") + .withContent("mvb") + .withEncoding(ContentEncoding.NONE) + .withPath("sflhhca") + .withValues(mapOf("yjpkiidzyexz", "jixisxyawjoyaqcs")); model = BinaryData.fromObject(model).toObject(ClusterConfigFile.class); - Assertions.assertEquals("iukbldngkpoci", model.fileName()); - Assertions.assertEquals("z", model.content()); - Assertions.assertEquals(ContentEncoding.BASE64, model.encoding()); - Assertions.assertEquals("gukgjnpiucgygevq", model.path()); - Assertions.assertEquals("yp", model.values().get("rbpizc")); + Assertions.assertEquals("ttouwaboekqvkel", model.fileName()); + Assertions.assertEquals("mvb", model.content()); + Assertions.assertEquals(ContentEncoding.NONE, model.encoding()); + Assertions.assertEquals("sflhhca", model.path()); + Assertions.assertEquals("jixisxyawjoyaqcs", model.values().get("yjpkiidzyexz")); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..a0c59587749e4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeHistoryPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterHotfixUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistorySeverityType; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterHotfixUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterHotfixUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"HotfixUpgrade\",\"sourceClusterVersion\":\"lhzdsqtzb\",\"sourceOssVersion\":\"gnowcjhfgmveca\",\"sourceBuildNumber\":\"xmwoteyowcluqo\",\"targetClusterVersion\":\"kqvgqouw\",\"targetOssVersion\":\"zmpjwyiv\",\"targetBuildNumber\":\"kfxcvhrfs\",\"componentName\":\"uagrttikteusqc\",\"severity\":\"medium\",\"utcTime\":\"yklxubyjaffmmfbl\",\"upgradeResult\":\"Failed\"}") + .toObject(ClusterHotfixUpgradeHistoryProperties.class); + Assertions.assertEquals("yklxubyjaffmmfbl", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("lhzdsqtzb", model.sourceClusterVersion()); + Assertions.assertEquals("gnowcjhfgmveca", model.sourceOssVersion()); + Assertions.assertEquals("xmwoteyowcluqo", model.sourceBuildNumber()); + Assertions.assertEquals("kqvgqouw", model.targetClusterVersion()); + Assertions.assertEquals("zmpjwyiv", model.targetOssVersion()); + Assertions.assertEquals("kfxcvhrfs", model.targetBuildNumber()); + Assertions.assertEquals("uagrttikteusqc", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.MEDIUM, model.severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterHotfixUpgradeHistoryProperties model + = new ClusterHotfixUpgradeHistoryProperties().withUtcTime("yklxubyjaffmmfbl") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED) + .withSourceClusterVersion("lhzdsqtzb") + .withSourceOssVersion("gnowcjhfgmveca") + .withSourceBuildNumber("xmwoteyowcluqo") + .withTargetClusterVersion("kqvgqouw") + .withTargetOssVersion("zmpjwyiv") + .withTargetBuildNumber("kfxcvhrfs") + .withComponentName("uagrttikteusqc") + .withSeverity(ClusterUpgradeHistorySeverityType.MEDIUM); + model = BinaryData.fromObject(model).toObject(ClusterHotfixUpgradeHistoryProperties.class); + Assertions.assertEquals("yklxubyjaffmmfbl", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("lhzdsqtzb", model.sourceClusterVersion()); + Assertions.assertEquals("gnowcjhfgmveca", model.sourceOssVersion()); + Assertions.assertEquals("xmwoteyowcluqo", model.sourceBuildNumber()); + Assertions.assertEquals("kqvgqouw", model.targetClusterVersion()); + Assertions.assertEquals("zmpjwyiv", model.targetOssVersion()); + Assertions.assertEquals("kfxcvhrfs", model.targetBuildNumber()); + Assertions.assertEquals("uagrttikteusqc", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.MEDIUM, model.severity()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradePropertiesTests.java index 0dcdfcf4bf224..6ff6c52de13a8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradePropertiesTests.java @@ -12,23 +12,24 @@ public final class ClusterHotfixUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterHotfixUpgradeProperties model = BinaryData.fromString( - "{\"upgradeType\":\"HotfixUpgrade\",\"targetOssVersion\":\"doiwi\",\"targetClusterVersion\":\"htywubxcbihwq\",\"targetBuildNumber\":\"fdntwjchrdgoih\",\"componentName\":\"mwctondzjluudfd\"}") + "{\"upgradeType\":\"HotfixUpgrade\",\"targetOssVersion\":\"ydvfvfcjnae\",\"targetClusterVersion\":\"srvhmgorffuki\",\"targetBuildNumber\":\"vwmzhwplefaxvxil\",\"componentName\":\"tg\"}") .toObject(ClusterHotfixUpgradeProperties.class); - Assertions.assertEquals("doiwi", model.targetOssVersion()); - Assertions.assertEquals("htywubxcbihwq", model.targetClusterVersion()); - Assertions.assertEquals("fdntwjchrdgoih", model.targetBuildNumber()); - Assertions.assertEquals("mwctondzjluudfd", model.componentName()); + Assertions.assertEquals("ydvfvfcjnae", model.targetOssVersion()); + Assertions.assertEquals("srvhmgorffuki", model.targetClusterVersion()); + Assertions.assertEquals("vwmzhwplefaxvxil", model.targetBuildNumber()); + Assertions.assertEquals("tg", model.componentName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterHotfixUpgradeProperties model = new ClusterHotfixUpgradeProperties().withTargetOssVersion("doiwi") - .withTargetClusterVersion("htywubxcbihwq").withTargetBuildNumber("fdntwjchrdgoih") - .withComponentName("mwctondzjluudfd"); + ClusterHotfixUpgradeProperties model = new ClusterHotfixUpgradeProperties().withTargetOssVersion("ydvfvfcjnae") + .withTargetClusterVersion("srvhmgorffuki") + .withTargetBuildNumber("vwmzhwplefaxvxil") + .withComponentName("tg"); model = BinaryData.fromObject(model).toObject(ClusterHotfixUpgradeProperties.class); - Assertions.assertEquals("doiwi", model.targetOssVersion()); - Assertions.assertEquals("htywubxcbihwq", model.targetClusterVersion()); - Assertions.assertEquals("fdntwjchrdgoih", model.targetBuildNumber()); - Assertions.assertEquals("mwctondzjluudfd", model.componentName()); + Assertions.assertEquals("ydvfvfcjnae", model.targetOssVersion()); + Assertions.assertEquals("srvhmgorffuki", model.targetClusterVersion()); + Assertions.assertEquals("vwmzhwplefaxvxil", model.targetBuildNumber()); + Assertions.assertEquals("tg", model.componentName()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeRollbackHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeRollbackHistoryPropertiesTests.java new file mode 100644 index 0000000000000..ebb8a61077ac5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterHotfixUpgradeRollbackHistoryPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterHotfixUpgradeRollbackHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistorySeverityType; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterHotfixUpgradeRollbackHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterHotfixUpgradeRollbackHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"HotfixUpgradeRollback\",\"sourceClusterVersion\":\"u\",\"sourceOssVersion\":\"gqibrtalmetttw\",\"sourceBuildNumber\":\"slqxi\",\"targetClusterVersion\":\"rmooizqse\",\"targetOssVersion\":\"xiutcx\",\"targetBuildNumber\":\"zhyrpeto\",\"componentName\":\"bjoxs\",\"severity\":\"low\",\"utcTime\":\"nhl\",\"upgradeResult\":\"Failed\"}") + .toObject(ClusterHotfixUpgradeRollbackHistoryProperties.class); + Assertions.assertEquals("nhl", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("u", model.sourceClusterVersion()); + Assertions.assertEquals("gqibrtalmetttw", model.sourceOssVersion()); + Assertions.assertEquals("slqxi", model.sourceBuildNumber()); + Assertions.assertEquals("rmooizqse", model.targetClusterVersion()); + Assertions.assertEquals("xiutcx", model.targetOssVersion()); + Assertions.assertEquals("zhyrpeto", model.targetBuildNumber()); + Assertions.assertEquals("bjoxs", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.LOW, model.severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterHotfixUpgradeRollbackHistoryProperties model + = new ClusterHotfixUpgradeRollbackHistoryProperties().withUtcTime("nhl") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED) + .withSourceClusterVersion("u") + .withSourceOssVersion("gqibrtalmetttw") + .withSourceBuildNumber("slqxi") + .withTargetClusterVersion("rmooizqse") + .withTargetOssVersion("xiutcx") + .withTargetBuildNumber("zhyrpeto") + .withComponentName("bjoxs") + .withSeverity(ClusterUpgradeHistorySeverityType.LOW); + model = BinaryData.fromObject(model).toObject(ClusterHotfixUpgradeRollbackHistoryProperties.class); + Assertions.assertEquals("nhl", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("u", model.sourceClusterVersion()); + Assertions.assertEquals("gqibrtalmetttw", model.sourceOssVersion()); + Assertions.assertEquals("slqxi", model.sourceBuildNumber()); + Assertions.assertEquals("rmooizqse", model.targetClusterVersion()); + Assertions.assertEquals("xiutcx", model.targetOssVersion()); + Assertions.assertEquals("zhyrpeto", model.targetBuildNumber()); + Assertions.assertEquals("bjoxs", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.LOW, model.severity()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..59f8f423c5036 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradeHistoryPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterInPlaceUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistorySeverityType; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterInPlaceUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterInPlaceUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"ClusterInPlaceUpgradeHistoryProperties\",\"sourceClusterVersion\":\"ydwqfbylyrf\",\"sourceOssVersion\":\"agt\",\"sourceBuildNumber\":\"jocqwogfnzjvusf\",\"targetClusterVersion\":\"dmozu\",\"targetOssVersion\":\"lfsbtkadpysow\",\"targetBuildNumber\":\"tgkbugrjqctojc\",\"componentName\":\"sofieypefojyqd\",\"severity\":\"low\",\"utcTime\":\"plcplcwkhi\",\"upgradeResult\":\"Failed\"}") + .toObject(ClusterInPlaceUpgradeHistoryProperties.class); + Assertions.assertEquals("plcplcwkhi", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("ydwqfbylyrf", model.sourceClusterVersion()); + Assertions.assertEquals("agt", model.sourceOssVersion()); + Assertions.assertEquals("jocqwogfnzjvusf", model.sourceBuildNumber()); + Assertions.assertEquals("dmozu", model.targetClusterVersion()); + Assertions.assertEquals("lfsbtkadpysow", model.targetOssVersion()); + Assertions.assertEquals("tgkbugrjqctojc", model.targetBuildNumber()); + Assertions.assertEquals("sofieypefojyqd", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.LOW, model.severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterInPlaceUpgradeHistoryProperties model + = new ClusterInPlaceUpgradeHistoryProperties().withUtcTime("plcplcwkhi") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED) + .withSourceClusterVersion("ydwqfbylyrf") + .withSourceOssVersion("agt") + .withSourceBuildNumber("jocqwogfnzjvusf") + .withTargetClusterVersion("dmozu") + .withTargetOssVersion("lfsbtkadpysow") + .withTargetBuildNumber("tgkbugrjqctojc") + .withComponentName("sofieypefojyqd") + .withSeverity(ClusterUpgradeHistorySeverityType.LOW); + model = BinaryData.fromObject(model).toObject(ClusterInPlaceUpgradeHistoryProperties.class); + Assertions.assertEquals("plcplcwkhi", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("ydwqfbylyrf", model.sourceClusterVersion()); + Assertions.assertEquals("agt", model.sourceOssVersion()); + Assertions.assertEquals("jocqwogfnzjvusf", model.sourceBuildNumber()); + Assertions.assertEquals("dmozu", model.targetClusterVersion()); + Assertions.assertEquals("lfsbtkadpysow", model.targetOssVersion()); + Assertions.assertEquals("tgkbugrjqctojc", model.targetBuildNumber()); + Assertions.assertEquals("sofieypefojyqd", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.LOW, model.severity()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradePropertiesTests.java new file mode 100644 index 0000000000000..be393a0449fd0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInPlaceUpgradePropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterInPlaceUpgradeProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterInPlaceUpgradePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterInPlaceUpgradeProperties model = BinaryData.fromString( + "{\"upgradeType\":\"ClusterInPlaceUpgradeProperties\",\"targetOssVersion\":\"unzo\",\"targetClusterVersion\":\"dhcxgkmoy\",\"targetBuildNumber\":\"dyuib\",\"componentName\":\"fdn\"}") + .toObject(ClusterInPlaceUpgradeProperties.class); + Assertions.assertEquals("unzo", model.targetOssVersion()); + Assertions.assertEquals("dhcxgkmoy", model.targetClusterVersion()); + Assertions.assertEquals("dyuib", model.targetBuildNumber()); + Assertions.assertEquals("fdn", model.componentName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterInPlaceUpgradeProperties model = new ClusterInPlaceUpgradeProperties().withTargetOssVersion("unzo") + .withTargetClusterVersion("dhcxgkmoy") + .withTargetBuildNumber("dyuib") + .withComponentName("fdn"); + model = BinaryData.fromObject(model).toObject(ClusterInPlaceUpgradeProperties.class); + Assertions.assertEquals("unzo", model.targetOssVersion()); + Assertions.assertEquals("dhcxgkmoy", model.targetClusterVersion()); + Assertions.assertEquals("dyuib", model.targetBuildNumber()); + Assertions.assertEquals("fdn", model.componentName()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesStatusTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesStatusTests.java index 961e532c07510..b882531975284 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesStatusTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesStatusTests.java @@ -12,20 +12,21 @@ public final class ClusterInstanceViewPropertiesStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewPropertiesStatus model - = BinaryData.fromString("{\"ready\":\"rmaequ\",\"reason\":\"hxicslfaoqz\",\"message\":\"yylhalnswhccsp\"}") + = BinaryData.fromString("{\"ready\":\"thrrgh\",\"reason\":\"bdhqxvcxgf\",\"message\":\"dsofbshrns\"}") .toObject(ClusterInstanceViewPropertiesStatus.class); - Assertions.assertEquals("rmaequ", model.ready()); - Assertions.assertEquals("hxicslfaoqz", model.reason()); - Assertions.assertEquals("yylhalnswhccsp", model.message()); + Assertions.assertEquals("thrrgh", model.ready()); + Assertions.assertEquals("bdhqxvcxgf", model.reason()); + Assertions.assertEquals("dsofbshrns", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterInstanceViewPropertiesStatus model = new ClusterInstanceViewPropertiesStatus().withReady("rmaequ") - .withReason("hxicslfaoqz").withMessage("yylhalnswhccsp"); + ClusterInstanceViewPropertiesStatus model = new ClusterInstanceViewPropertiesStatus().withReady("thrrgh") + .withReason("bdhqxvcxgf") + .withMessage("dsofbshrns"); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewPropertiesStatus.class); - Assertions.assertEquals("rmaequ", model.ready()); - Assertions.assertEquals("hxicslfaoqz", model.reason()); - Assertions.assertEquals("yylhalnswhccsp", model.message()); + Assertions.assertEquals("thrrgh", model.ready()); + Assertions.assertEquals("bdhqxvcxgf", model.reason()); + Assertions.assertEquals("dsofbshrns", model.message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesTests.java index 387bea1743c83..3b3b3c5949209 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewPropertiesTests.java @@ -15,32 +15,31 @@ public final class ClusterInstanceViewPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewProperties model = BinaryData.fromString( - "{\"status\":{\"ready\":\"ykutwpf\",\"reason\":\"a\",\"message\":\"hrskdsnfd\"},\"serviceStatuses\":[{\"kind\":\"oakgtdlmkkzev\",\"ready\":\"l\",\"message\":\"wpusdsttwvogv\"},{\"kind\":\"bejdcn\",\"ready\":\"qqmoaku\",\"message\":\"m\"},{\"kind\":\"zr\",\"ready\":\"rdgrtw\",\"message\":\"nuuzkopbm\"},{\"kind\":\"nrfdw\",\"ready\":\"yuhhziu\",\"message\":\"fozbhdmsmlmzqhof\"}]}") + "{\"status\":{\"ready\":\"pij\",\"reason\":\"rxfrddhc\",\"message\":\"tizzronasxif\"},\"serviceStatuses\":[{\"kind\":\"zq\",\"ready\":\"zh\",\"message\":\"wesgogczh\"},{\"kind\":\"nnxk\",\"ready\":\"lgnyhmo\",\"message\":\"xkk\"}]}") .toObject(ClusterInstanceViewProperties.class); - Assertions.assertEquals("ykutwpf", model.status().ready()); - Assertions.assertEquals("a", model.status().reason()); - Assertions.assertEquals("hrskdsnfd", model.status().message()); - Assertions.assertEquals("oakgtdlmkkzev", model.serviceStatuses().get(0).kind()); - Assertions.assertEquals("l", model.serviceStatuses().get(0).ready()); - Assertions.assertEquals("wpusdsttwvogv", model.serviceStatuses().get(0).message()); + Assertions.assertEquals("pij", model.status().ready()); + Assertions.assertEquals("rxfrddhc", model.status().reason()); + Assertions.assertEquals("tizzronasxif", model.status().message()); + Assertions.assertEquals("zq", model.serviceStatuses().get(0).kind()); + Assertions.assertEquals("zh", model.serviceStatuses().get(0).ready()); + Assertions.assertEquals("wesgogczh", model.serviceStatuses().get(0).message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterInstanceViewProperties model = new ClusterInstanceViewProperties() - .withStatus( - new ClusterInstanceViewPropertiesStatus().withReady("ykutwpf").withReason("a").withMessage("hrskdsnfd")) + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("pij") + .withReason("rxfrddhc") + .withMessage("tizzronasxif")) .withServiceStatuses( - Arrays.asList(new ServiceStatus().withKind("oakgtdlmkkzev").withReady("l").withMessage("wpusdsttwvogv"), - new ServiceStatus().withKind("bejdcn").withReady("qqmoaku").withMessage("m"), - new ServiceStatus().withKind("zr").withReady("rdgrtw").withMessage("nuuzkopbm"), - new ServiceStatus().withKind("nrfdw").withReady("yuhhziu").withMessage("fozbhdmsmlmzqhof"))); + Arrays.asList(new ServiceStatus().withKind("zq").withReady("zh").withMessage("wesgogczh"), + new ServiceStatus().withKind("nnxk").withReady("lgnyhmo").withMessage("xkk"))); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewProperties.class); - Assertions.assertEquals("ykutwpf", model.status().ready()); - Assertions.assertEquals("a", model.status().reason()); - Assertions.assertEquals("hrskdsnfd", model.status().message()); - Assertions.assertEquals("oakgtdlmkkzev", model.serviceStatuses().get(0).kind()); - Assertions.assertEquals("l", model.serviceStatuses().get(0).ready()); - Assertions.assertEquals("wpusdsttwvogv", model.serviceStatuses().get(0).message()); + Assertions.assertEquals("pij", model.status().ready()); + Assertions.assertEquals("rxfrddhc", model.status().reason()); + Assertions.assertEquals("tizzronasxif", model.status().message()); + Assertions.assertEquals("zq", model.serviceStatuses().get(0).kind()); + Assertions.assertEquals("zh", model.serviceStatuses().get(0).ready()); + Assertions.assertEquals("wesgogczh", model.serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultInnerTests.java index 2117d5096cb15..6b4eb2d005dbc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultInnerTests.java @@ -16,34 +16,34 @@ public final class ClusterInstanceViewResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewResultInner model = BinaryData.fromString( - "{\"name\":\"ncormrlxqtvcof\",\"properties\":{\"status\":{\"ready\":\"dflvkg\",\"reason\":\"bgdknnqv\",\"message\":\"znqntoru\"},\"serviceStatuses\":[{\"kind\":\"gsahmkycgrauw\",\"ready\":\"uetae\",\"message\":\"ruvdmov\"},{\"kind\":\"mz\",\"ready\":\"xwabmqoe\",\"message\":\"ifrvtpu\"},{\"kind\":\"ujmqlgkfbtndoa\",\"ready\":\"n\",\"message\":\"jcntuj\"}]}}") + "{\"name\":\"gzxnfaazpxdtnk\",\"properties\":{\"status\":{\"ready\":\"mkqjj\",\"reason\":\"uenvrkp\",\"message\":\"uaibrebqaaysj\"},\"serviceStatuses\":[{\"kind\":\"xqtnq\",\"ready\":\"tezlwff\",\"message\":\"akpjpqqmtedlt\"},{\"kind\":\"mjihyeozphv\",\"ready\":\"auyqncygupkv\",\"message\":\"mdscwxqupev\"}]}}") .toObject(ClusterInstanceViewResultInner.class); - Assertions.assertEquals("ncormrlxqtvcof", model.name()); - Assertions.assertEquals("dflvkg", model.properties().status().ready()); - Assertions.assertEquals("bgdknnqv", model.properties().status().reason()); - Assertions.assertEquals("znqntoru", model.properties().status().message()); - Assertions.assertEquals("gsahmkycgrauw", model.properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("uetae", model.properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("ruvdmov", model.properties().serviceStatuses().get(0).message()); + Assertions.assertEquals("gzxnfaazpxdtnk", model.name()); + Assertions.assertEquals("mkqjj", model.properties().status().ready()); + Assertions.assertEquals("uenvrkp", model.properties().status().reason()); + Assertions.assertEquals("uaibrebqaaysj", model.properties().status().message()); + Assertions.assertEquals("xqtnq", model.properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("tezlwff", model.properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("akpjpqqmtedlt", model.properties().serviceStatuses().get(0).message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterInstanceViewResultInner model = new ClusterInstanceViewResultInner().withName("ncormrlxqtvcof") + ClusterInstanceViewResultInner model = new ClusterInstanceViewResultInner().withName("gzxnfaazpxdtnk") .withProperties(new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("dflvkg").withReason("bgdknnqv") - .withMessage("znqntoru")) + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("mkqjj") + .withReason("uenvrkp") + .withMessage("uaibrebqaaysj")) .withServiceStatuses(Arrays.asList( - new ServiceStatus().withKind("gsahmkycgrauw").withReady("uetae").withMessage("ruvdmov"), - new ServiceStatus().withKind("mz").withReady("xwabmqoe").withMessage("ifrvtpu"), - new ServiceStatus().withKind("ujmqlgkfbtndoa").withReady("n").withMessage("jcntuj")))); + new ServiceStatus().withKind("xqtnq").withReady("tezlwff").withMessage("akpjpqqmtedlt"), + new ServiceStatus().withKind("mjihyeozphv").withReady("auyqncygupkv").withMessage("mdscwxqupev")))); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewResultInner.class); - Assertions.assertEquals("ncormrlxqtvcof", model.name()); - Assertions.assertEquals("dflvkg", model.properties().status().ready()); - Assertions.assertEquals("bgdknnqv", model.properties().status().reason()); - Assertions.assertEquals("znqntoru", model.properties().status().message()); - Assertions.assertEquals("gsahmkycgrauw", model.properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("uetae", model.properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("ruvdmov", model.properties().serviceStatuses().get(0).message()); + Assertions.assertEquals("gzxnfaazpxdtnk", model.name()); + Assertions.assertEquals("mkqjj", model.properties().status().ready()); + Assertions.assertEquals("uenvrkp", model.properties().status().reason()); + Assertions.assertEquals("uaibrebqaaysj", model.properties().status().message()); + Assertions.assertEquals("xqtnq", model.properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("tezlwff", model.properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("akpjpqqmtedlt", model.properties().serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultPropertiesTests.java index fb405ceef9711..5ec55211f3078 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultPropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewResultPropertiesTests.java @@ -15,33 +15,33 @@ public final class ClusterInstanceViewResultPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewResultProperties model = BinaryData.fromString( - "{\"status\":{\"ready\":\"tcje\",\"reason\":\"twwaezkojvdcpzf\",\"message\":\"ouicybxarzgszu\"},\"serviceStatuses\":[{\"kind\":\"x\",\"ready\":\"iqopidoamciod\",\"message\":\"haz\"},{\"kind\":\"khnzbonlw\",\"ready\":\"toego\",\"message\":\"wbw\"},{\"kind\":\"kszzcmrvexztv\",\"ready\":\"t\",\"message\":\"sfraoyzko\"},{\"kind\":\"wtl\",\"ready\":\"nguxawqaldsy\",\"message\":\"ximerqfobwyznk\"}]}") + "{\"status\":{\"ready\":\"hfstotxhojujbyp\",\"reason\":\"mc\",\"message\":\"hixbjxyfwnyl\"},\"serviceStatuses\":[{\"kind\":\"ool\",\"ready\":\"ttpkiwkkbnujrywv\",\"message\":\"lbfpncurd\"},{\"kind\":\"iwii\",\"ready\":\"htywubxcbihwq\",\"message\":\"fdntwjchrdgoih\"},{\"kind\":\"umwctondz\",\"ready\":\"luudfdlwggytsb\",\"message\":\"ovvtgseinqfiu\"},{\"kind\":\"x\",\"ready\":\"knpirgnepttwq\",\"message\":\"niffcdmqnroj\"}]}") .toObject(ClusterInstanceViewResultProperties.class); - Assertions.assertEquals("tcje", model.status().ready()); - Assertions.assertEquals("twwaezkojvdcpzf", model.status().reason()); - Assertions.assertEquals("ouicybxarzgszu", model.status().message()); - Assertions.assertEquals("x", model.serviceStatuses().get(0).kind()); - Assertions.assertEquals("iqopidoamciod", model.serviceStatuses().get(0).ready()); - Assertions.assertEquals("haz", model.serviceStatuses().get(0).message()); + Assertions.assertEquals("hfstotxhojujbyp", model.status().ready()); + Assertions.assertEquals("mc", model.status().reason()); + Assertions.assertEquals("hixbjxyfwnyl", model.status().message()); + Assertions.assertEquals("ool", model.serviceStatuses().get(0).kind()); + Assertions.assertEquals("ttpkiwkkbnujrywv", model.serviceStatuses().get(0).ready()); + Assertions.assertEquals("lbfpncurd", model.serviceStatuses().get(0).message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterInstanceViewResultProperties model - = new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("tcje").withReason("twwaezkojvdcpzf") - .withMessage("ouicybxarzgszu")) - .withServiceStatuses( - Arrays.asList(new ServiceStatus().withKind("x").withReady("iqopidoamciod").withMessage("haz"), - new ServiceStatus().withKind("khnzbonlw").withReady("toego").withMessage("wbw"), - new ServiceStatus().withKind("kszzcmrvexztv").withReady("t").withMessage("sfraoyzko"), - new ServiceStatus().withKind("wtl").withReady("nguxawqaldsy").withMessage("ximerqfobwyznk"))); + ClusterInstanceViewResultProperties model = new ClusterInstanceViewResultProperties() + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("hfstotxhojujbyp") + .withReason("mc") + .withMessage("hixbjxyfwnyl")) + .withServiceStatuses(Arrays.asList( + new ServiceStatus().withKind("ool").withReady("ttpkiwkkbnujrywv").withMessage("lbfpncurd"), + new ServiceStatus().withKind("iwii").withReady("htywubxcbihwq").withMessage("fdntwjchrdgoih"), + new ServiceStatus().withKind("umwctondz").withReady("luudfdlwggytsb").withMessage("ovvtgseinqfiu"), + new ServiceStatus().withKind("x").withReady("knpirgnepttwq").withMessage("niffcdmqnroj"))); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewResultProperties.class); - Assertions.assertEquals("tcje", model.status().ready()); - Assertions.assertEquals("twwaezkojvdcpzf", model.status().reason()); - Assertions.assertEquals("ouicybxarzgszu", model.status().message()); - Assertions.assertEquals("x", model.serviceStatuses().get(0).kind()); - Assertions.assertEquals("iqopidoamciod", model.serviceStatuses().get(0).ready()); - Assertions.assertEquals("haz", model.serviceStatuses().get(0).message()); + Assertions.assertEquals("hfstotxhojujbyp", model.status().ready()); + Assertions.assertEquals("mc", model.status().reason()); + Assertions.assertEquals("hixbjxyfwnyl", model.status().message()); + Assertions.assertEquals("ool", model.serviceStatuses().get(0).kind()); + Assertions.assertEquals("ttpkiwkkbnujrywv", model.serviceStatuses().get(0).ready()); + Assertions.assertEquals("lbfpncurd", model.serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewStatusTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewStatusTests.java index 74062666c76ea..be3ed61ecdc28 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewStatusTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewStatusTests.java @@ -12,20 +12,20 @@ public final class ClusterInstanceViewStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewStatus model - = BinaryData.fromString("{\"ready\":\"kaivwit\",\"reason\":\"cywuggwol\",\"message\":\"czbwemhairsbr\"}") + = BinaryData.fromString("{\"ready\":\"buswdvzyy\",\"reason\":\"cnunvjsr\",\"message\":\"f\"}") .toObject(ClusterInstanceViewStatus.class); - Assertions.assertEquals("kaivwit", model.ready()); - Assertions.assertEquals("cywuggwol", model.reason()); - Assertions.assertEquals("czbwemhairsbr", model.message()); + Assertions.assertEquals("buswdvzyy", model.ready()); + Assertions.assertEquals("cnunvjsr", model.reason()); + Assertions.assertEquals("f", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterInstanceViewStatus model - = new ClusterInstanceViewStatus().withReady("kaivwit").withReason("cywuggwol").withMessage("czbwemhairsbr"); + = new ClusterInstanceViewStatus().withReady("buswdvzyy").withReason("cnunvjsr").withMessage("f"); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewStatus.class); - Assertions.assertEquals("kaivwit", model.ready()); - Assertions.assertEquals("cywuggwol", model.reason()); - Assertions.assertEquals("czbwemhairsbr", model.message()); + Assertions.assertEquals("buswdvzyy", model.ready()); + Assertions.assertEquals("cnunvjsr", model.reason()); + Assertions.assertEquals("f", model.message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewsResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewsResultTests.java index f2cf98d0f484e..a3f5153e03576 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewsResultTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterInstanceViewsResultTests.java @@ -17,60 +17,63 @@ public final class ClusterInstanceViewsResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterInstanceViewsResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"idb\",\"properties\":{\"status\":{\"ready\":\"fatpxllrxcyjmoa\",\"reason\":\"uvarmywdmjsjq\",\"message\":\"hhyxxrw\"},\"serviceStatuses\":[{\"kind\":\"co\",\"ready\":\"uhpkxkgymar\",\"message\":\"n\"}]}},{\"name\":\"jxqugjhky\",\"properties\":{\"status\":{\"ready\":\"ubeddg\",\"reason\":\"ofwq\",\"message\":\"qal\"},\"serviceStatuses\":[{\"kind\":\"mnjijpxacqqudf\",\"ready\":\"byxbaaabjy\",\"message\":\"yffimrzrtuzqogs\"},{\"kind\":\"xnevfdnwn\",\"ready\":\"mewzsyyc\",\"message\":\"zsoibjudpfrxtr\"}]}},{\"name\":\"hzv\",\"properties\":{\"status\":{\"ready\":\"ytdw\",\"reason\":\"brqubp\",\"message\":\"h\"},\"serviceStatuses\":[{\"kind\":\"iilivpdtiirqtd\",\"ready\":\"oaxoruzfgsqu\",\"message\":\"xrxxlep\"},{\"kind\":\"ramxjezwlwnw\",\"ready\":\"uqlcvydy\",\"message\":\"tdooaoj\"},{\"kind\":\"niodkooeb\",\"ready\":\"nuj\",\"message\":\"mmsbvdkcrodtjin\"},{\"kind\":\"wj\",\"ready\":\"fltkacjv\",\"message\":\"kdlfoa\"}]}},{\"name\":\"ggkfpagaowpul\",\"properties\":{\"status\":{\"ready\":\"qblylsyxkqj\",\"reason\":\"jervtia\",\"message\":\"sdszue\"},\"serviceStatuses\":[{\"kind\":\"sbzkf\",\"ready\":\"beyvpnqicvinvkjj\",\"message\":\"xrbuukzclew\"},{\"kind\":\"hmlwpaztzpo\",\"ready\":\"ncckw\",\"message\":\"zqwhxxbuyqaxzfeq\"},{\"kind\":\"tpp\",\"ready\":\"iolxor\",\"message\":\"lt\"},{\"kind\":\"lmncw\",\"ready\":\"obqwcsdbnwdcfh\",\"message\":\"qdpfuvglsbjjca\"}]}}],\"nextLink\":\"xbvtvudu\"}") + "{\"value\":[{\"name\":\"rmuhapfcq\",\"properties\":{\"status\":{\"ready\":\"psqxq\",\"reason\":\"svuo\",\"message\":\"gc\"},\"serviceStatuses\":[{\"kind\":\"lvez\",\"ready\":\"ypql\",\"message\":\"eokerqwkyhkobopg\"},{\"kind\":\"edkowepbqpcrfk\",\"ready\":\"wccsnjvcdwxlpqek\",\"message\":\"nkhtjsyingw\"},{\"kind\":\"qatmtdhtmdvy\",\"ready\":\"gikdgsz\",\"message\":\"kbir\"}]}},{\"name\":\"yuzhlhkjoqrvq\",\"properties\":{\"status\":{\"ready\":\"aatjinrvgoupmfi\",\"reason\":\"fggjioolvr\",\"message\":\"kvtkkg\"},\"serviceStatuses\":[{\"kind\":\"qwjygvja\",\"ready\":\"vblm\",\"message\":\"k\"},{\"kind\":\"uhbxvvy\",\"ready\":\"gsopbyrqufegxu\",\"message\":\"zfbn\"},{\"kind\":\"lmctlpd\",\"ready\":\"gitvg\",\"message\":\"hrixkwmy\"},{\"kind\":\"jejveg\",\"ready\":\"hbpnaixexccbd\",\"message\":\"ax\"}]}},{\"name\":\"cexdrrvqa\",\"properties\":{\"status\":{\"ready\":\"qkghtpwijnhy\",\"reason\":\"vfycxzb\",\"message\":\"oowvrv\"},\"serviceStatuses\":[{\"kind\":\"gjqppy\",\"ready\":\"s\",\"message\":\"on\"}]}},{\"name\":\"myhgfipnsxkmc\",\"properties\":{\"status\":{\"ready\":\"a\",\"reason\":\"rrjreafxtsgu\",\"message\":\"jglikkxwslolb\"},\"serviceStatuses\":[{\"kind\":\"vuzlm\",\"ready\":\"felfktg\",\"message\":\"crpw\"},{\"kind\":\"xeznoi\",\"ready\":\"brnjwmw\",\"message\":\"nbsazejjoqkag\"}]}}],\"nextLink\":\"sxtta\"}") .toObject(ClusterInstanceViewsResult.class); - Assertions.assertEquals("idb", model.value().get(0).name()); - Assertions.assertEquals("fatpxllrxcyjmoa", model.value().get(0).properties().status().ready()); - Assertions.assertEquals("uvarmywdmjsjq", model.value().get(0).properties().status().reason()); - Assertions.assertEquals("hhyxxrw", model.value().get(0).properties().status().message()); - Assertions.assertEquals("co", model.value().get(0).properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("uhpkxkgymar", model.value().get(0).properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("n", model.value().get(0).properties().serviceStatuses().get(0).message()); + Assertions.assertEquals("rmuhapfcq", model.value().get(0).name()); + Assertions.assertEquals("psqxq", model.value().get(0).properties().status().ready()); + Assertions.assertEquals("svuo", model.value().get(0).properties().status().reason()); + Assertions.assertEquals("gc", model.value().get(0).properties().status().message()); + Assertions.assertEquals("lvez", model.value().get(0).properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("ypql", model.value().get(0).properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("eokerqwkyhkobopg", + model.value().get(0).properties().serviceStatuses().get(0).message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterInstanceViewsResult model = new ClusterInstanceViewsResult().withValue(Arrays.asList( - new ClusterInstanceViewResultInner().withName("idb") + new ClusterInstanceViewResultInner().withName("rmuhapfcq") + .withProperties(new ClusterInstanceViewResultProperties().withStatus( + new ClusterInstanceViewPropertiesStatus().withReady("psqxq").withReason("svuo").withMessage("gc")) + .withServiceStatuses(Arrays.asList( + new ServiceStatus().withKind("lvez").withReady("ypql").withMessage("eokerqwkyhkobopg"), + new ServiceStatus().withKind("edkowepbqpcrfk") + .withReady("wccsnjvcdwxlpqek") + .withMessage("nkhtjsyingw"), + new ServiceStatus().withKind("qatmtdhtmdvy").withReady("gikdgsz").withMessage("kbir")))), + new ClusterInstanceViewResultInner().withName("yuzhlhkjoqrvq") .withProperties(new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("fatpxllrxcyjmoa") - .withReason("uvarmywdmjsjq").withMessage("hhyxxrw")) + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("aatjinrvgoupmfi") + .withReason("fggjioolvr") + .withMessage("kvtkkg")) .withServiceStatuses( - Arrays.asList(new ServiceStatus().withKind("co").withReady("uhpkxkgymar").withMessage("n")))), - new ClusterInstanceViewResultInner().withName("jxqugjhky") - .withProperties(new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("ubeddg").withReason("ofwq") - .withMessage("qal")) - .withServiceStatuses(Arrays.asList( - new ServiceStatus().withKind("mnjijpxacqqudf").withReady("byxbaaabjy") - .withMessage("yffimrzrtuzqogs"), - new ServiceStatus().withKind("xnevfdnwn").withReady("mewzsyyc") - .withMessage("zsoibjudpfrxtr")))), - new ClusterInstanceViewResultInner().withName("hzv") + Arrays.asList(new ServiceStatus().withKind("qwjygvja").withReady("vblm").withMessage("k"), + new ServiceStatus().withKind("uhbxvvy").withReady("gsopbyrqufegxu").withMessage("zfbn"), + new ServiceStatus().withKind("lmctlpd").withReady("gitvg").withMessage("hrixkwmy"), + new ServiceStatus().withKind("jejveg").withReady("hbpnaixexccbd").withMessage("ax")))), + new ClusterInstanceViewResultInner().withName("cexdrrvqa") .withProperties(new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("ytdw").withReason("brqubp") - .withMessage("h")) - .withServiceStatuses(Arrays.asList( - new ServiceStatus().withKind("iilivpdtiirqtd").withReady("oaxoruzfgsqu").withMessage("xrxxlep"), - new ServiceStatus().withKind("ramxjezwlwnw").withReady("uqlcvydy").withMessage("tdooaoj"), - new ServiceStatus().withKind("niodkooeb").withReady("nuj").withMessage("mmsbvdkcrodtjin"), - new ServiceStatus().withKind("wj").withReady("fltkacjv").withMessage("kdlfoa")))), - new ClusterInstanceViewResultInner().withName("ggkfpagaowpul") + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("qkghtpwijnhy") + .withReason("vfycxzb") + .withMessage("oowvrv")) + .withServiceStatuses( + Arrays.asList(new ServiceStatus().withKind("gjqppy").withReady("s").withMessage("on")))), + new ClusterInstanceViewResultInner().withName("myhgfipnsxkmc") .withProperties(new ClusterInstanceViewResultProperties() - .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("qblylsyxkqj").withReason("jervtia") - .withMessage("sdszue")) + .withStatus(new ClusterInstanceViewPropertiesStatus().withReady("a") + .withReason("rrjreafxtsgu") + .withMessage("jglikkxwslolb")) .withServiceStatuses(Arrays.asList( - new ServiceStatus().withKind("sbzkf").withReady("beyvpnqicvinvkjj").withMessage("xrbuukzclew"), - new ServiceStatus().withKind("hmlwpaztzpo").withReady("ncckw").withMessage("zqwhxxbuyqaxzfeq"), - new ServiceStatus().withKind("tpp").withReady("iolxor").withMessage("lt"), new ServiceStatus() - .withKind("lmncw").withReady("obqwcsdbnwdcfh").withMessage("qdpfuvglsbjjca")))))); + new ServiceStatus().withKind("vuzlm").withReady("felfktg").withMessage("crpw"), + new ServiceStatus().withKind("xeznoi").withReady("brnjwmw").withMessage("nbsazejjoqkag")))))); model = BinaryData.fromObject(model).toObject(ClusterInstanceViewsResult.class); - Assertions.assertEquals("idb", model.value().get(0).name()); - Assertions.assertEquals("fatpxllrxcyjmoa", model.value().get(0).properties().status().ready()); - Assertions.assertEquals("uvarmywdmjsjq", model.value().get(0).properties().status().reason()); - Assertions.assertEquals("hhyxxrw", model.value().get(0).properties().status().message()); - Assertions.assertEquals("co", model.value().get(0).properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("uhpkxkgymar", model.value().get(0).properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("n", model.value().get(0).properties().serviceStatuses().get(0).message()); + Assertions.assertEquals("rmuhapfcq", model.value().get(0).name()); + Assertions.assertEquals("psqxq", model.value().get(0).properties().status().ready()); + Assertions.assertEquals("svuo", model.value().get(0).properties().status().reason()); + Assertions.assertEquals("gc", model.value().get(0).properties().status().message()); + Assertions.assertEquals("lvez", model.value().get(0).properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("ypql", model.value().get(0).properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("eokerqwkyhkobopg", + model.value().get(0).properties().serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobInnerTests.java index 07613985d6b9b..0d34cf65674e3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobInnerTests.java @@ -12,7 +12,7 @@ public final class ClusterJobInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterJobInner model = BinaryData.fromString( - "{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"washr\",\"name\":\"dtkcnqxwbpokulp\",\"type\":\"ujw\"}") + "{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"wib\",\"name\":\"rcdlbhshfwpr\",\"type\":\"cstwity\"}") .toObject(ClusterJobInner.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobListTests.java index e07432e315821..242b1c46573de 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobListTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobListTests.java @@ -15,9 +15,9 @@ public final class ClusterJobListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterJobList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"ipqiiobyuqerpq\",\"name\":\"pqwcciuqgbdbutau\",\"type\":\"fbtkuwhhmhyk\"},{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"oxafn\",\"name\":\"dlpichkoymkcdyhb\",\"type\":\"kkpwdreqnovvq\"}],\"nextLink\":\"vljxywsu\"}") + "{\"value\":[{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"vxccedcp\",\"name\":\"md\",\"type\":\"odn\"},{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"xltjcvnhltiu\",\"name\":\"cxnavv\",\"type\":\"xqi\"}],\"nextLink\":\"qunyowxwlmdjr\"}") .toObject(ClusterJobList.class); - Assertions.assertEquals("vljxywsu", model.nextLink()); + Assertions.assertEquals("qunyowxwlmdjr", model.nextLink()); } @org.junit.jupiter.api.Test @@ -25,8 +25,8 @@ public void testSerialize() throws Exception { ClusterJobList model = new ClusterJobList() .withValue(Arrays.asList(new ClusterJobInner().withProperties(new ClusterJobProperties()), new ClusterJobInner().withProperties(new ClusterJobProperties()))) - .withNextLink("vljxywsu"); + .withNextLink("qunyowxwlmdjr"); model = BinaryData.fromObject(model).toObject(ClusterJobList.class); - Assertions.assertEquals("vljxywsu", model.nextLink()); + Assertions.assertEquals("qunyowxwlmdjr", model.nextLink()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListMockTests.java index 95d44494548b4..8e0b9737617ea 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsListMockTests.java @@ -6,50 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterJob; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterJobsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"ylaxxulcdi\",\"name\":\"dosfjbjsvgjrw\",\"type\":\"r\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"rrouuxvnsasbcry\",\"name\":\"o\",\"type\":\"izrxklob\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response - = manager.clusterJobs().list("kizvytn", "zvulj", "aaeranokqgukk", "qnvb", com.azure.core.util.Context.NONE); + PagedIterable response = manager.clusterJobs() + .list("zna", "xbannovvoxc", "ytprwnwvroev", "tlyo", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobMockTests.java index ba73eb154c51c..90601d3c46c83 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterJobsRunJobMockTests.java @@ -6,51 +6,34 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterJobInner; import com.azure.resourcemanager.hdinsight.containers.models.ClusterJob; import com.azure.resourcemanager.hdinsight.containers.models.ClusterJobProperties; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterJobsRunJobMockTests { @Test public void testRunJob() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"wmdboxdfgsftuf\",\"name\":\"obrjlnacgcc\",\"type\":\"knh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"jobType\":\"ClusterJobProperties\"},\"id\":\"dtvqe\",\"name\":\"rqctmxxdtdd\",\"type\":\"flhuytxzv\"}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - ClusterJob response = manager.clusterJobs().runJob("cbslhhx", "db", "vodhtn", - new ClusterJobInner().withProperties(new ClusterJobProperties()), com.azure.core.util.Context.NONE); + ClusterJob response = manager.clusterJobs() + .runJob("lcqxypokk", "minqcym", "zng", new ClusterJobInner().withProperties(new ClusterJobProperties()), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListMockTests.java new file mode 100644 index 0000000000000..5accf317ccf03 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibrariesListMockTests.java @@ -0,0 +1,40 @@ +// 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.containers.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.containers.HDInsightContainersManager; +import com.azure.resourcemanager.hdinsight.containers.models.Category; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibrary; +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 ClusterLibrariesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"yych\",\"timestamp\":\"2021-07-13T04:48:49Z\",\"status\":\"UNINSTALLING\",\"message\":\"jrtwsz\"},\"id\":\"vuicp\",\"name\":\"vtrrmhwrbfdpyflu\",\"type\":\"hvj\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.clusterLibraries() + .list("llklmtk", "lowkxxpvb", "dfjmzsyzfhotlh", Category.CUSTOM, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("yych", response.iterator().next().properties().remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryInnerTests.java new file mode 100644 index 0000000000000..6e7cf3f3a10d8 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterLibraryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterLibraryInner model = BinaryData.fromString( + "{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"wlvwlyoupf\",\"timestamp\":\"2021-07-15T15:51:01Z\",\"status\":\"INSTALLING\",\"message\":\"bdyhgkfminsgowz\"},\"id\":\"tsttktlahbq\",\"name\":\"ctxtgzukxi\",\"type\":\"mmqtgqqqxhr\"}") + .toObject(ClusterLibraryInner.class); + Assertions.assertEquals("wlvwlyoupf", model.properties().remarks()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterLibraryInner model + = new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("wlvwlyoupf")); + model = BinaryData.fromObject(model).toObject(ClusterLibraryInner.class); + Assertions.assertEquals("wlvwlyoupf", model.properties().remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryListTests.java new file mode 100644 index 0000000000000..62abc8a59fe6a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryListTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryList; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ClusterLibraryListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterLibraryList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"crxgibb\",\"timestamp\":\"2020-12-25T20:16:58Z\",\"status\":\"UNINSTALL_FAILED\",\"message\":\"fozauorsuk\"},\"id\":\"wbqpl\",\"name\":\"lvnuuepzlrph\",\"type\":\"zsoldwey\"},{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"dunvmnnrwrbiorkt\",\"timestamp\":\"2021-08-10T02:45:15Z\",\"status\":\"INSTALLED\",\"message\":\"hgdnhxmsivfo\"},\"id\":\"loxggdufiqn\",\"name\":\"ieuzaofjchvcyyy\",\"type\":\"fgdo\"},{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"ubiipuipwoqonma\",\"timestamp\":\"2021-10-21T10:35:29Z\",\"status\":\"UNINSTALL_FAILED\",\"message\":\"zshq\"},\"id\":\"impevf\",\"name\":\"mblrrilbywd\",\"type\":\"smiccwrwfscj\"},{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"ynszquji\",\"timestamp\":\"2021-01-17T07:53:09Z\",\"status\":\"INSTALLED\",\"message\":\"tiby\"},\"id\":\"bblgyavut\",\"name\":\"thjoxoism\",\"type\":\"ksbpimlqoljx\"}],\"nextLink\":\"gxxlxsffgcvizq\"}") + .toObject(ClusterLibraryList.class); + Assertions.assertEquals("crxgibb", model.value().get(0).properties().remarks()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterLibraryList model = new ClusterLibraryList().withValue(Arrays.asList( + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("crxgibb")), + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("dunvmnnrwrbiorkt")), + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("ubiipuipwoqonma")), + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("ynszquji")))); + model = BinaryData.fromObject(model).toObject(ClusterLibraryList.class); + Assertions.assertEquals("crxgibb", model.value().get(0).properties().remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationPropertiesTests.java new file mode 100644 index 0000000000000..4016808c2420f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationPropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperationProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.LibraryManagementAction; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ClusterLibraryManagementOperationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterLibraryManagementOperationProperties model = BinaryData.fromString( + "{\"action\":\"Uninstall\",\"libraries\":[{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"iogsjkmnwq\",\"timestamp\":\"2021-09-21T11:57:43Z\",\"status\":\"UNINSTALLING\",\"message\":\"yhddvia\"},\"id\":\"gfnmntfpmvmemfnc\",\"name\":\"dwvvba\",\"type\":\"xlllchp\"}]}") + .toObject(ClusterLibraryManagementOperationProperties.class); + Assertions.assertEquals(LibraryManagementAction.UNINSTALL, model.action()); + Assertions.assertEquals("iogsjkmnwq", model.libraries().get(0).properties().remarks()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterLibraryManagementOperationProperties model = new ClusterLibraryManagementOperationProperties() + .withAction(LibraryManagementAction.UNINSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("iogsjkmnwq")))); + model = BinaryData.fromObject(model).toObject(ClusterLibraryManagementOperationProperties.class); + Assertions.assertEquals(LibraryManagementAction.UNINSTALL, model.action()); + Assertions.assertEquals("iogsjkmnwq", model.libraries().get(0).properties().remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationTests.java new file mode 100644 index 0000000000000..27892e5af5775 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryManagementOperationTests.java @@ -0,0 +1,38 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterLibraryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperation; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryManagementOperationProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.LibraryManagementAction; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ClusterLibraryManagementOperationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterLibraryManagementOperation model = BinaryData.fromString( + "{\"properties\":{\"action\":\"Uninstall\",\"libraries\":[{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"wxyiopidkqq\",\"timestamp\":\"2021-05-28T06:42:38Z\",\"status\":\"INSTALLING\",\"message\":\"xkdmligo\"},\"id\":\"brxk\",\"name\":\"mloazuru\",\"type\":\"cbgoor\"},{\"properties\":{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"eoybfhjxakvvjgs\",\"timestamp\":\"2021-07-21T11:06:32Z\",\"status\":\"UNINSTALL_FAILED\",\"message\":\"mywwtkgkxnyed\"},\"id\":\"gyvudtjuewbc\",\"name\":\"hxuuwhcjyxccybvp\",\"type\":\"yakk\"}]},\"id\":\"zp\",\"name\":\"gwjplmag\",\"type\":\"tcyohpfkyrk\"}") + .toObject(ClusterLibraryManagementOperation.class); + Assertions.assertEquals(LibraryManagementAction.UNINSTALL, model.properties().action()); + Assertions.assertEquals("wxyiopidkqq", model.properties().libraries().get(0).properties().remarks()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterLibraryManagementOperation model = new ClusterLibraryManagementOperation().withProperties( + new ClusterLibraryManagementOperationProperties().withAction(LibraryManagementAction.UNINSTALL) + .withLibraries(Arrays.asList( + new ClusterLibraryInner().withProperties(new ClusterLibraryProperties().withRemarks("wxyiopidkqq")), + new ClusterLibraryInner() + .withProperties(new ClusterLibraryProperties().withRemarks("eoybfhjxakvvjgs"))))); + model = BinaryData.fromObject(model).toObject(ClusterLibraryManagementOperation.class); + Assertions.assertEquals(LibraryManagementAction.UNINSTALL, model.properties().action()); + Assertions.assertEquals("wxyiopidkqq", model.properties().libraries().get(0).properties().remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryPropertiesTests.java new file mode 100644 index 0000000000000..5b825e99a3f30 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLibraryPropertiesTests.java @@ -0,0 +1,26 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterLibraryProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterLibraryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterLibraryProperties model = BinaryData.fromString( + "{\"type\":\"ClusterLibraryProperties\",\"remarks\":\"rxcpjuisavo\",\"timestamp\":\"2021-01-28T07:43:14Z\",\"status\":\"UNINSTALLING\",\"message\":\"azivjlfrqttbajl\"}") + .toObject(ClusterLibraryProperties.class); + Assertions.assertEquals("rxcpjuisavo", model.remarks()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterLibraryProperties model = new ClusterLibraryProperties().withRemarks("rxcpjuisavo"); + model = BinaryData.fromObject(model).toObject(ClusterLibraryProperties.class); + Assertions.assertEquals("rxcpjuisavo", model.remarks()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsApplicationLogsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsApplicationLogsTests.java index 29a203f413b22..5c8fc22c03cc3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsApplicationLogsTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsApplicationLogsTests.java @@ -12,18 +12,18 @@ public final class ClusterLogAnalyticsApplicationLogsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterLogAnalyticsApplicationLogs model - = BinaryData.fromString("{\"stdOutEnabled\":false,\"stdErrorEnabled\":true}") + = BinaryData.fromString("{\"stdOutEnabled\":true,\"stdErrorEnabled\":true}") .toObject(ClusterLogAnalyticsApplicationLogs.class); - Assertions.assertEquals(false, model.stdOutEnabled()); + Assertions.assertEquals(true, model.stdOutEnabled()); Assertions.assertEquals(true, model.stdErrorEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterLogAnalyticsApplicationLogs model - = new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(false).withStdErrorEnabled(true); + = new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(true).withStdErrorEnabled(true); model = BinaryData.fromObject(model).toObject(ClusterLogAnalyticsApplicationLogs.class); - Assertions.assertEquals(false, model.stdOutEnabled()); + Assertions.assertEquals(true, model.stdOutEnabled()); Assertions.assertEquals(true, model.stdErrorEnabled()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsProfileTests.java index 3acfc6a68477a..f2367d8595080 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterLogAnalyticsProfileTests.java @@ -13,24 +13,24 @@ public final class ClusterLogAnalyticsProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterLogAnalyticsProfile model = BinaryData.fromString( - "{\"enabled\":false,\"applicationLogs\":{\"stdOutEnabled\":true,\"stdErrorEnabled\":true},\"metricsEnabled\":true}") + "{\"enabled\":true,\"applicationLogs\":{\"stdOutEnabled\":true,\"stdErrorEnabled\":false},\"metricsEnabled\":false}") .toObject(ClusterLogAnalyticsProfile.class); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals(true, model.enabled()); Assertions.assertEquals(true, model.applicationLogs().stdOutEnabled()); - Assertions.assertEquals(true, model.applicationLogs().stdErrorEnabled()); - Assertions.assertEquals(true, model.metricsEnabled()); + Assertions.assertEquals(false, model.applicationLogs().stdErrorEnabled()); + Assertions.assertEquals(false, model.metricsEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterLogAnalyticsProfile model = new ClusterLogAnalyticsProfile().withEnabled(false) + ClusterLogAnalyticsProfile model = new ClusterLogAnalyticsProfile().withEnabled(true) .withApplicationLogs( - new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(true).withStdErrorEnabled(true)) - .withMetricsEnabled(true); + new ClusterLogAnalyticsApplicationLogs().withStdOutEnabled(true).withStdErrorEnabled(false)) + .withMetricsEnabled(false); model = BinaryData.fromObject(model).toObject(ClusterLogAnalyticsProfile.class); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals(true, model.enabled()); Assertions.assertEquals(true, model.applicationLogs().stdOutEnabled()); - Assertions.assertEquals(true, model.applicationLogs().stdErrorEnabled()); - Assertions.assertEquals(true, model.metricsEnabled()); + Assertions.assertEquals(false, model.applicationLogs().stdErrorEnabled()); + Assertions.assertEquals(false, model.metricsEnabled()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..4027bdf4975c2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeHistoryPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPatchVersionUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistorySeverityType; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPatchVersionUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPatchVersionUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"PatchVersionUpgrade\",\"sourceClusterVersion\":\"q\",\"sourceOssVersion\":\"kzjcjbtrgae\",\"sourceBuildNumber\":\"vibr\",\"targetClusterVersion\":\"jsto\",\"targetOssVersion\":\"eitpkxztmo\",\"targetBuildNumber\":\"klf\",\"componentName\":\"dgfcwqmp\",\"severity\":\"high\",\"utcTime\":\"qxzhem\",\"upgradeResult\":\"Failed\"}") + .toObject(ClusterPatchVersionUpgradeHistoryProperties.class); + Assertions.assertEquals("qxzhem", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("q", model.sourceClusterVersion()); + Assertions.assertEquals("kzjcjbtrgae", model.sourceOssVersion()); + Assertions.assertEquals("vibr", model.sourceBuildNumber()); + Assertions.assertEquals("jsto", model.targetClusterVersion()); + Assertions.assertEquals("eitpkxztmo", model.targetOssVersion()); + Assertions.assertEquals("klf", model.targetBuildNumber()); + Assertions.assertEquals("dgfcwqmp", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.HIGH, model.severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPatchVersionUpgradeHistoryProperties model + = new ClusterPatchVersionUpgradeHistoryProperties().withUtcTime("qxzhem") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED) + .withSourceClusterVersion("q") + .withSourceOssVersion("kzjcjbtrgae") + .withSourceBuildNumber("vibr") + .withTargetClusterVersion("jsto") + .withTargetOssVersion("eitpkxztmo") + .withTargetBuildNumber("klf") + .withComponentName("dgfcwqmp") + .withSeverity(ClusterUpgradeHistorySeverityType.HIGH); + model = BinaryData.fromObject(model).toObject(ClusterPatchVersionUpgradeHistoryProperties.class); + Assertions.assertEquals("qxzhem", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + Assertions.assertEquals("q", model.sourceClusterVersion()); + Assertions.assertEquals("kzjcjbtrgae", model.sourceOssVersion()); + Assertions.assertEquals("vibr", model.sourceBuildNumber()); + Assertions.assertEquals("jsto", model.targetClusterVersion()); + Assertions.assertEquals("eitpkxztmo", model.targetOssVersion()); + Assertions.assertEquals("klf", model.targetBuildNumber()); + Assertions.assertEquals("dgfcwqmp", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.HIGH, model.severity()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradePropertiesTests.java new file mode 100644 index 0000000000000..56032ae3d3447 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradePropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPatchVersionUpgradeProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPatchVersionUpgradePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPatchVersionUpgradeProperties model = BinaryData.fromString( + "{\"upgradeType\":\"PatchVersionUpgrade\",\"targetOssVersion\":\"nzeyqxtjj\",\"targetClusterVersion\":\"qlqhycavodg\",\"targetBuildNumber\":\"dbeesmie\",\"componentName\":\"lrariaawiu\"}") + .toObject(ClusterPatchVersionUpgradeProperties.class); + Assertions.assertEquals("nzeyqxtjj", model.targetOssVersion()); + Assertions.assertEquals("qlqhycavodg", model.targetClusterVersion()); + Assertions.assertEquals("dbeesmie", model.targetBuildNumber()); + Assertions.assertEquals("lrariaawiu", model.componentName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPatchVersionUpgradeProperties model + = new ClusterPatchVersionUpgradeProperties().withTargetOssVersion("nzeyqxtjj") + .withTargetClusterVersion("qlqhycavodg") + .withTargetBuildNumber("dbeesmie") + .withComponentName("lrariaawiu"); + model = BinaryData.fromObject(model).toObject(ClusterPatchVersionUpgradeProperties.class); + Assertions.assertEquals("nzeyqxtjj", model.targetOssVersion()); + Assertions.assertEquals("qlqhycavodg", model.targetClusterVersion()); + Assertions.assertEquals("dbeesmie", model.targetBuildNumber()); + Assertions.assertEquals("lrariaawiu", model.componentName()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeRollbackHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeRollbackHistoryPropertiesTests.java new file mode 100644 index 0000000000000..f18a1ecea7910 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPatchVersionUpgradeRollbackHistoryPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPatchVersionUpgradeRollbackHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistorySeverityType; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPatchVersionUpgradeRollbackHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPatchVersionUpgradeRollbackHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"PatchVersionUpgradeRollback\",\"sourceClusterVersion\":\"ohu\",\"sourceOssVersion\":\"wtwko\",\"sourceBuildNumber\":\"wculkbaw\",\"targetClusterVersion\":\"ajnjwltlwtjj\",\"targetOssVersion\":\"ktalhsnvkcdmxz\",\"targetBuildNumber\":\"oaimlnw\",\"componentName\":\"aomylwea\",\"severity\":\"high\",\"utcTime\":\"cse\",\"upgradeResult\":\"Succeed\"}") + .toObject(ClusterPatchVersionUpgradeRollbackHistoryProperties.class); + Assertions.assertEquals("cse", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("ohu", model.sourceClusterVersion()); + Assertions.assertEquals("wtwko", model.sourceOssVersion()); + Assertions.assertEquals("wculkbaw", model.sourceBuildNumber()); + Assertions.assertEquals("ajnjwltlwtjj", model.targetClusterVersion()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.targetOssVersion()); + Assertions.assertEquals("oaimlnw", model.targetBuildNumber()); + Assertions.assertEquals("aomylwea", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.HIGH, model.severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPatchVersionUpgradeRollbackHistoryProperties model + = new ClusterPatchVersionUpgradeRollbackHistoryProperties().withUtcTime("cse") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.SUCCEED) + .withSourceClusterVersion("ohu") + .withSourceOssVersion("wtwko") + .withSourceBuildNumber("wculkbaw") + .withTargetClusterVersion("ajnjwltlwtjj") + .withTargetOssVersion("ktalhsnvkcdmxz") + .withTargetBuildNumber("oaimlnw") + .withComponentName("aomylwea") + .withSeverity(ClusterUpgradeHistorySeverityType.HIGH); + model = BinaryData.fromObject(model).toObject(ClusterPatchVersionUpgradeRollbackHistoryProperties.class); + Assertions.assertEquals("cse", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("ohu", model.sourceClusterVersion()); + Assertions.assertEquals("wtwko", model.sourceOssVersion()); + Assertions.assertEquals("wculkbaw", model.sourceBuildNumber()); + Assertions.assertEquals("ajnjwltlwtjj", model.targetClusterVersion()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.targetOssVersion()); + Assertions.assertEquals("oaimlnw", model.targetBuildNumber()); + Assertions.assertEquals("aomylwea", model.componentName()); + Assertions.assertEquals(ClusterUpgradeHistorySeverityType.HIGH, model.severity()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..788f07110867b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchUpgradeHistoryPropertiesTests.java @@ -0,0 +1,43 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAksPatchUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPoolAksPatchUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPoolAksPatchUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"AKSPatchUpgrade\",\"upgradeClusterPool\":true,\"upgradeAllClusterNodes\":true,\"originalVersion\":\"xvd\",\"newVersion\":\"fwafqrouda\",\"utcTime\":\"pavehhr\",\"upgradeResult\":\"Succeed\"}") + .toObject(ClusterPoolAksPatchUpgradeHistoryProperties.class); + Assertions.assertEquals("pavehhr", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals(true, model.upgradeClusterPool()); + Assertions.assertEquals(true, model.upgradeAllClusterNodes()); + Assertions.assertEquals("xvd", model.originalVersion()); + Assertions.assertEquals("fwafqrouda", model.newVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPoolAksPatchUpgradeHistoryProperties model + = new ClusterPoolAksPatchUpgradeHistoryProperties().withUtcTime("pavehhr") + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED) + .withUpgradeClusterPool(true) + .withUpgradeAllClusterNodes(true) + .withOriginalVersion("xvd") + .withNewVersion("fwafqrouda"); + model = BinaryData.fromObject(model).toObject(ClusterPoolAksPatchUpgradeHistoryProperties.class); + Assertions.assertEquals("pavehhr", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals(true, model.upgradeClusterPool()); + Assertions.assertEquals(true, model.upgradeAllClusterNodes()); + Assertions.assertEquals("xvd", model.originalVersion()); + Assertions.assertEquals("fwafqrouda", model.newVersion()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchVersionUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchVersionUpgradePropertiesTests.java index e9368c6540331..31122d0a97d48 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchVersionUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAksPatchVersionUpgradePropertiesTests.java @@ -12,20 +12,22 @@ public final class ClusterPoolAksPatchVersionUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolAksPatchVersionUpgradeProperties model = BinaryData.fromString( - "{\"upgradeType\":\"AKSPatchUpgrade\",\"upgradeClusterPool\":false,\"upgradeAllClusterNodes\":true,\"targetAksVersion\":\"jrywvtylbfpnc\"}") + "{\"upgradeType\":\"AKSPatchUpgrade\",\"upgradeClusterPool\":true,\"upgradeAllClusterNodes\":false,\"targetAksVersion\":\"ifmzzsd\"}") .toObject(ClusterPoolAksPatchVersionUpgradeProperties.class); - Assertions.assertEquals(false, model.upgradeClusterPool()); - Assertions.assertEquals(true, model.upgradeAllClusterNodes()); - Assertions.assertEquals("jrywvtylbfpnc", model.targetAksVersion()); + Assertions.assertEquals(true, model.upgradeClusterPool()); + Assertions.assertEquals(false, model.upgradeAllClusterNodes()); + Assertions.assertEquals("ifmzzsd", model.targetAksVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolAksPatchVersionUpgradeProperties model = new ClusterPoolAksPatchVersionUpgradeProperties() - .withUpgradeClusterPool(false).withUpgradeAllClusterNodes(true).withTargetAksVersion("jrywvtylbfpnc"); + ClusterPoolAksPatchVersionUpgradeProperties model + = new ClusterPoolAksPatchVersionUpgradeProperties().withUpgradeClusterPool(true) + .withUpgradeAllClusterNodes(false) + .withTargetAksVersion("ifmzzsd"); model = BinaryData.fromObject(model).toObject(ClusterPoolAksPatchVersionUpgradeProperties.class); - Assertions.assertEquals(false, model.upgradeClusterPool()); - Assertions.assertEquals(true, model.upgradeAllClusterNodes()); - Assertions.assertEquals("jrywvtylbfpnc", model.targetAksVersion()); + Assertions.assertEquals(true, model.upgradeClusterPool()); + Assertions.assertEquals(false, model.upgradeAllClusterNodes()); + Assertions.assertEquals("ifmzzsd", model.targetAksVersion()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeAksPatchUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeAksPatchUpgradePropertiesTests.java index 30fa3b3b9b152..34a62e752fc71 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeAksPatchUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeAksPatchUpgradePropertiesTests.java @@ -13,21 +13,22 @@ public final class ClusterPoolAvailableUpgradeAksPatchUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolAvailableUpgradeAksPatchUpgradeProperties model = BinaryData.fromString( - "{\"upgradeType\":\"AKSPatchUpgrade\",\"currentVersion\":\"lwuenvrkp\",\"currentVersionStatus\":\"Supported\",\"latestVersion\":\"ibreb\"}") + "{\"upgradeType\":\"AKSPatchUpgrade\",\"currentVersion\":\"kkdmfl\",\"currentVersionStatus\":\"Supported\",\"latestVersion\":\"mjlxrrilozapeewc\"}") .toObject(ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.class); - Assertions.assertEquals("lwuenvrkp", model.currentVersion()); + Assertions.assertEquals("kkdmfl", model.currentVersion()); Assertions.assertEquals(CurrentClusterPoolAksVersionStatus.SUPPORTED, model.currentVersionStatus()); - Assertions.assertEquals("ibreb", model.latestVersion()); + Assertions.assertEquals("mjlxrrilozapeewc", model.latestVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolAvailableUpgradeAksPatchUpgradeProperties model - = new ClusterPoolAvailableUpgradeAksPatchUpgradeProperties().withCurrentVersion("lwuenvrkp") - .withCurrentVersionStatus(CurrentClusterPoolAksVersionStatus.SUPPORTED).withLatestVersion("ibreb"); + = new ClusterPoolAvailableUpgradeAksPatchUpgradeProperties().withCurrentVersion("kkdmfl") + .withCurrentVersionStatus(CurrentClusterPoolAksVersionStatus.SUPPORTED) + .withLatestVersion("mjlxrrilozapeewc"); model = BinaryData.fromObject(model).toObject(ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.class); - Assertions.assertEquals("lwuenvrkp", model.currentVersion()); + Assertions.assertEquals("kkdmfl", model.currentVersion()); Assertions.assertEquals(CurrentClusterPoolAksVersionStatus.SUPPORTED, model.currentVersionStatus()); - Assertions.assertEquals("ibreb", model.latestVersion()); + Assertions.assertEquals("mjlxrrilozapeewc", model.latestVersion()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeInnerTests.java index 97fffa1f8771e..c52edb2e928a7 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeInnerTests.java @@ -12,7 +12,7 @@ public final class ClusterPoolAvailableUpgradeInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolAvailableUpgradeInner model = BinaryData.fromString( - "{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"rolfpfp\",\"name\":\"algbquxigjyjg\",\"type\":\"jaoyfhrtx\"}") + "{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"nb\",\"name\":\"xqabnmocpcysh\",\"type\":\"rzafbljjgpbtoqcj\"}") .toObject(ClusterPoolAvailableUpgradeInner.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeListTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeListTests.java index 7c996ae33c3f6..0d5f95b79c4e6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeListTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeListTests.java @@ -15,19 +15,20 @@ public final class ClusterPoolAvailableUpgradeListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolAvailableUpgradeList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"bciqfouflm\",\"name\":\"nkzsmodmglou\",\"type\":\"pbkwtmu\"},{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"qktapspwgcuert\",\"name\":\"mkdo\",\"type\":\"vqwhbmdgbbjfd\"}],\"nextLink\":\"mbmbexppbh\"}") + "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"ac\",\"name\":\"boo\",\"type\":\"flnrosfqpteehzz\"},{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"yqrimzin\",\"name\":\"vswjdk\",\"type\":\"rsoodqxhcrmnoh\"},{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"kwh\",\"name\":\"soifiyipjxsqw\",\"type\":\"gr\"}],\"nextLink\":\"znorcj\"}") .toObject(ClusterPoolAvailableUpgradeList.class); - Assertions.assertEquals("mbmbexppbh", model.nextLink()); + Assertions.assertEquals("znorcj", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolAvailableUpgradeList model = new ClusterPoolAvailableUpgradeList() .withValue(Arrays.asList( + new ClusterPoolAvailableUpgradeInner().withProperties(new ClusterPoolAvailableUpgradeProperties()), new ClusterPoolAvailableUpgradeInner().withProperties(new ClusterPoolAvailableUpgradeProperties()), new ClusterPoolAvailableUpgradeInner().withProperties(new ClusterPoolAvailableUpgradeProperties()))) - .withNextLink("mbmbexppbh"); + .withNextLink("znorcj"); model = BinaryData.fromObject(model).toObject(ClusterPoolAvailableUpgradeList.class); - Assertions.assertEquals("mbmbexppbh", model.nextLink()); + Assertions.assertEquals("znorcj", model.nextLink()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeNodeOsUpgradePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeNodeOsUpgradePropertiesTests.java index 97e79bcc8896e..aa7b8cf1f5dc1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeNodeOsUpgradePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradeNodeOsUpgradePropertiesTests.java @@ -12,16 +12,16 @@ public final class ClusterPoolAvailableUpgradeNodeOsUpgradePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolAvailableUpgradeNodeOsUpgradeProperties model - = BinaryData.fromString("{\"upgradeType\":\"NodeOsUpgrade\",\"latestVersion\":\"aysjkixqtnqttez\"}") + = BinaryData.fromString("{\"upgradeType\":\"NodeOsUpgrade\",\"latestVersion\":\"xlktwkuzi\"}") .toObject(ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.class); - Assertions.assertEquals("aysjkixqtnqttez", model.latestVersion()); + Assertions.assertEquals("xlktwkuzi", model.latestVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolAvailableUpgradeNodeOsUpgradeProperties model - = new ClusterPoolAvailableUpgradeNodeOsUpgradeProperties().withLatestVersion("aysjkixqtnqttez"); + = new ClusterPoolAvailableUpgradeNodeOsUpgradeProperties().withLatestVersion("xlktwkuzi"); model = BinaryData.fromObject(model).toObject(ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.class); - Assertions.assertEquals("aysjkixqtnqttez", model.latestVersion()); + Assertions.assertEquals("xlktwkuzi", model.latestVersion()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListMockTests.java index 5dc3eaddd283b..59c9d251723b6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolAvailableUpgradesListMockTests.java @@ -6,50 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolAvailableUpgrade; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolAvailableUpgradesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"pqbmfpjbab\",\"name\":\"idfcxsspuunnoxyh\",\"type\":\"xgqddrih\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolAvailableUpgradeProperties\"},\"id\":\"hdxbzlm\",\"name\":\"muapcvhdbevw\",\"type\":\"qxeysko\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.clusterPoolAvailableUpgrades() - .list("fukuvsjcswsmystu", "uqypfcvle", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.clusterPoolAvailableUpgrades().list("gqcwdhohsdtmc", "zsu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolComputeProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolComputeProfileTests.java index 182cda8e08968..363a53ec8fe2f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolComputeProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolComputeProfileTests.java @@ -6,20 +6,25 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolComputeProfile; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ClusterPoolComputeProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolComputeProfile model = BinaryData.fromString("{\"vmSize\":\"kkvnipjox\",\"count\":1539160915}") + ClusterPoolComputeProfile model = BinaryData.fromString( + "{\"vmSize\":\"ooginuvamih\",\"count\":774982264,\"availabilityZones\":[\"rxzxtheo\",\"usivye\",\"cciqihnhungbwjz\"]}") .toObject(ClusterPoolComputeProfile.class); - Assertions.assertEquals("kkvnipjox", model.vmSize()); + Assertions.assertEquals("ooginuvamih", model.vmSize()); + Assertions.assertEquals("rxzxtheo", model.availabilityZones().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolComputeProfile model = new ClusterPoolComputeProfile().withVmSize("kkvnipjox"); + ClusterPoolComputeProfile model = new ClusterPoolComputeProfile().withVmSize("ooginuvamih") + .withAvailabilityZones(Arrays.asList("rxzxtheo", "usivye", "cciqihnhungbwjz")); model = BinaryData.fromObject(model).toObject(ClusterPoolComputeProfile.class); - Assertions.assertEquals("kkvnipjox", model.vmSize()); + Assertions.assertEquals("ooginuvamih", model.vmSize()); + Assertions.assertEquals("rxzxtheo", model.availabilityZones().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolInnerTests.java index 4d96adb90d2b8..bf198fd78f481 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolInnerTests.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; import java.util.Arrays; import java.util.HashMap; @@ -21,48 +22,57 @@ public final class ClusterPoolInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"deploymentId\":\"uv\",\"managedResourceGroupName\":\"xpyb\",\"aksManagedResourceGroupName\":\"m\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"mtz\"},\"computeProfile\":{\"vmSize\":\"pbsphrupidgs\",\"count\":1332019186},\"aksClusterProfile\":{\"aksClusterResourceId\":\"hphoycm\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"ao\",\"msiClientId\":\"hdxbmtqio\",\"msiObjectId\":\"jzehtb\"},\"aksVersion\":\"fpownoizhwlr\"},\"networkProfile\":{\"subnetId\":\"bqsoqijg\",\"outboundType\":\"userDefinedRouting\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"lobcufpdznrbtcq\",\"jnqglhqgnu\",\"ooojywifsqe\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"dfmglzlhjx\"},\"status\":\"f\"},\"location\":\"mrvktsizntoc\",\"tags\":{\"kfo\":\"ouajpsqucmpoyf\"},\"id\":\"knygjofjddeq\",\"name\":\"rd\",\"type\":\"upewnwreitjzy\"}") + "{\"properties\":{\"provisioningState\":\"Accepted\",\"deploymentId\":\"uv\",\"managedResourceGroupName\":\"xpyb\",\"aksManagedResourceGroupName\":\"m\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"mtz\",\"publicIpTag\":{\"ipTagType\":\"bsphrupidgsybbe\",\"tag\":\"hphoycm\"}},\"computeProfile\":{\"vmSize\":\"xaobhdxbmtqioqjz\",\"count\":1801213143,\"availabilityZones\":[\"ufpo\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"izhwlrxy\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"soqijg\",\"msiClientId\":\"dmbpazlobcufpdz\",\"msiObjectId\":\"rbt\"},\"aksVersion\":\"qjnqglhqgnufoooj\"},\"networkProfile\":{\"subnetId\":\"ifsqesaagdfmg\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"ifkwmrvktsizntoc\",\"pa\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"psqucmpoyf\"},\"status\":\"fogknygjofjdde\"},\"location\":\"rd\",\"tags\":{\"sarhmofc\":\"ewnwreitjzyfl\",\"yurkdtmlxhekuksj\":\"hs\"},\"id\":\"xukcdmpar\",\"name\":\"ryuanzwuxzdxtay\",\"type\":\"lhmwhfpmrqobm\"}") .toObject(ClusterPoolInner.class); - Assertions.assertEquals("mrvktsizntoc", model.location()); - Assertions.assertEquals("ouajpsqucmpoyf", model.tags().get("kfo")); + Assertions.assertEquals("rd", model.location()); + Assertions.assertEquals("ewnwreitjzyfl", model.tags().get("sarhmofc")); Assertions.assertEquals("xpyb", model.properties().managedResourceGroupName()); Assertions.assertEquals("mtz", model.properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("pbsphrupidgs", model.properties().computeProfile().vmSize()); - Assertions.assertEquals("bqsoqijg", model.properties().networkProfile().subnetId()); - Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.properties().networkProfile().outboundType()); - Assertions.assertEquals(true, model.properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("lobcufpdznrbtcq", + Assertions.assertEquals("bsphrupidgsybbe", model.properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("hphoycm", model.properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.properties().computeProfile().vmSize()); + Assertions.assertEquals("ufpo", model.properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("ifsqesaagdfmg", model.properties().networkProfile().subnetId()); + Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.properties().networkProfile().outboundType()); + Assertions.assertEquals(false, model.properties().networkProfile().enablePrivateApiServer()); + Assertions.assertEquals("ifkwmrvktsizntoc", model.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(true, model.properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("dfmglzlhjx", model.properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals(false, model.properties().logAnalyticsProfile().enabled()); + Assertions.assertEquals("psqucmpoyf", model.properties().logAnalyticsProfile().workspaceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolInner model - = new ClusterPoolInner().withLocation("mrvktsizntoc").withTags(mapOf("kfo", "ouajpsqucmpoyf")) - .withProperties(new ClusterPoolResourceProperties().withManagedResourceGroupName("xpyb") - .withClusterPoolProfile( - new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("mtz")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("pbsphrupidgs")) - .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("bqsoqijg") - .withOutboundType(OutboundType.USER_DEFINED_ROUTING).withEnablePrivateApiServer(true) - .withApiServerAuthorizedIpRanges(Arrays.asList("lobcufpdznrbtcq", "jnqglhqgnu", "ooojywifsqe"))) - .withLogAnalyticsProfile(new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(true) - .withWorkspaceId("dfmglzlhjx"))); + ClusterPoolInner model = new ClusterPoolInner().withLocation("rd") + .withTags(mapOf("sarhmofc", "ewnwreitjzyfl", "yurkdtmlxhekuksj", "hs")) + .withProperties(new ClusterPoolResourceProperties().withManagedResourceGroupName("xpyb") + .withClusterPoolProfile( + new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("mtz") + .withPublicIpTag(new IpTag().withIpTagType("bsphrupidgsybbe").withTag("hphoycm"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("xaobhdxbmtqioqjz") + .withAvailabilityZones(Arrays.asList("ufpo"))) + .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("ifsqesaagdfmg") + .withOutboundType(OutboundType.LOAD_BALANCER) + .withEnablePrivateApiServer(false) + .withApiServerAuthorizedIpRanges(Arrays.asList("ifkwmrvktsizntoc", "pa"))) + .withLogAnalyticsProfile(new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false) + .withWorkspaceId("psqucmpoyf"))); model = BinaryData.fromObject(model).toObject(ClusterPoolInner.class); - Assertions.assertEquals("mrvktsizntoc", model.location()); - Assertions.assertEquals("ouajpsqucmpoyf", model.tags().get("kfo")); + Assertions.assertEquals("rd", model.location()); + Assertions.assertEquals("ewnwreitjzyfl", model.tags().get("sarhmofc")); Assertions.assertEquals("xpyb", model.properties().managedResourceGroupName()); Assertions.assertEquals("mtz", model.properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("pbsphrupidgs", model.properties().computeProfile().vmSize()); - Assertions.assertEquals("bqsoqijg", model.properties().networkProfile().subnetId()); - Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.properties().networkProfile().outboundType()); - Assertions.assertEquals(true, model.properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("lobcufpdznrbtcq", + Assertions.assertEquals("bsphrupidgsybbe", model.properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("hphoycm", model.properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.properties().computeProfile().vmSize()); + Assertions.assertEquals("ufpo", model.properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("ifsqesaagdfmg", model.properties().networkProfile().subnetId()); + Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.properties().networkProfile().outboundType()); + Assertions.assertEquals(false, model.properties().networkProfile().enablePrivateApiServer()); + Assertions.assertEquals("ifkwmrvktsizntoc", model.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(true, model.properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("dfmglzlhjx", model.properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals(false, model.properties().logAnalyticsProfile().enabled()); + Assertions.assertEquals("psqucmpoyf", model.properties().logAnalyticsProfile().workspaceId()); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolListResultTests.java index 4d8f5147a75e3..66b8a738a4943 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolListResultTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolListResultTests.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; import java.util.Arrays; import java.util.HashMap; @@ -22,52 +23,68 @@ public final class ClusterPoolListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"deploymentId\":\"jdous\",\"managedResourceGroupName\":\"qvkoc\",\"aksManagedResourceGroupName\":\"jdkwtnhxbnjb\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"sqrglssainq\"},\"computeProfile\":{\"vmSize\":\"jwnzlljfmp\",\"count\":1098993569},\"aksClusterProfile\":{\"aksClusterResourceId\":\"mgxsab\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"qduujitcjczdz\",\"msiClientId\":\"vndhkrwpdapp\",\"msiObjectId\":\"sbdkvwr\"},\"aksVersion\":\"feusnhut\"},\"networkProfile\":{\"subnetId\":\"ltmrldh\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"tqxhocdgeab\",\"gphuticndvka\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"i\"},\"status\":\"yhxhu\"},\"location\":\"k\",\"tags\":{\"iawxklry\":\"xolniwpwcukjfk\",\"cbacphejkotynqg\":\"lwckbasyypnddhs\"},\"id\":\"ulzndlikwyqk\",\"name\":\"fgibmadgakeq\",\"type\":\"rxybz\"}],\"nextLink\":\"e\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"deploymentId\":\"zqqedq\",\"managedResourceGroupName\":\"bciqfouflm\",\"aksManagedResourceGroupName\":\"kzsmodm\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"ougpbkwt\",\"publicIpTag\":{\"ipTagType\":\"tduqktapspwgcuer\",\"tag\":\"umkdosvqwhbmd\"}},\"computeProfile\":{\"vmSize\":\"bbjfddgmbmbexp\",\"count\":72940743,\"availabilityZones\":[\"qrolfpf\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"lgbquxig\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"jgzjaoyfhrtx\",\"msiClientId\":\"lnerkujysvleju\",\"msiObjectId\":\"fqawrlyxw\"},\"aksVersion\":\"cpr\"},\"networkProfile\":{\"subnetId\":\"wbxgjvt\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"dnrujqguhmuouqfp\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"bngui\"},\"status\":\"wu\"},\"location\":\"gazxuf\",\"tags\":{\"fidfvzw\":\"ckyfih\",\"nteiwaopv\":\"zuhtymwisdkfthwx\"},\"id\":\"mijcmmxdcufufs\",\"name\":\"pymzidnsezcxtbzs\",\"type\":\"fycc\"}],\"nextLink\":\"ewmdw\"}") .toObject(ClusterPoolListResult.class); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("xolniwpwcukjfk", model.value().get(0).tags().get("iawxklry")); - Assertions.assertEquals("qvkoc", model.value().get(0).properties().managedResourceGroupName()); - Assertions.assertEquals("sqrglssainq", + Assertions.assertEquals("gazxuf", model.value().get(0).location()); + Assertions.assertEquals("ckyfih", model.value().get(0).tags().get("fidfvzw")); + Assertions.assertEquals("bciqfouflm", model.value().get(0).properties().managedResourceGroupName()); + Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("jwnzlljfmp", model.value().get(0).properties().computeProfile().vmSize()); - Assertions.assertEquals("ltmrldh", model.value().get(0).properties().networkProfile().subnetId()); + Assertions.assertEquals("tduqktapspwgcuer", + model.value().get(0).properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("umkdosvqwhbmd", + model.value().get(0).properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("bbjfddgmbmbexp", model.value().get(0).properties().computeProfile().vmSize()); + Assertions.assertEquals("qrolfpf", + model.value().get(0).properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("wbxgjvt", model.value().get(0).properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.value().get(0).properties().networkProfile().outboundType()); - Assertions.assertEquals(true, model.value().get(0).properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("tqxhocdgeab", + Assertions.assertEquals(false, model.value().get(0).properties().networkProfile().enablePrivateApiServer()); + Assertions.assertEquals("dnrujqguhmuouqfp", model.value().get(0).properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(true, model.value().get(0).properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("i", model.value().get(0).properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals(false, model.value().get(0).properties().logAnalyticsProfile().enabled()); + Assertions.assertEquals("bngui", model.value().get(0).properties().logAnalyticsProfile().workspaceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolListResult model = new ClusterPoolListResult().withValue(Arrays.asList(new ClusterPoolInner() - .withLocation("k").withTags(mapOf("iawxklry", "xolniwpwcukjfk", "cbacphejkotynqg", "lwckbasyypnddhs")) - .withProperties(new ClusterPoolResourceProperties().withManagedResourceGroupName("qvkoc") - .withClusterPoolProfile( - new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("sqrglssainq")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("jwnzlljfmp")) - .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("ltmrldh") - .withOutboundType(OutboundType.LOAD_BALANCER).withEnablePrivateApiServer(true) - .withApiServerAuthorizedIpRanges(Arrays.asList("tqxhocdgeab", "gphuticndvka"))) - .withLogAnalyticsProfile( - new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(true).withWorkspaceId("i"))))); + ClusterPoolListResult model + = new ClusterPoolListResult().withValue(Arrays.asList(new ClusterPoolInner().withLocation("gazxuf") + .withTags(mapOf("fidfvzw", "ckyfih", "nteiwaopv", "zuhtymwisdkfthwx")) + .withProperties(new ClusterPoolResourceProperties().withManagedResourceGroupName("bciqfouflm") + .withClusterPoolProfile( + new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("ougpbkwt") + .withPublicIpTag(new IpTag().withIpTagType("tduqktapspwgcuer").withTag("umkdosvqwhbmd"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("bbjfddgmbmbexp") + .withAvailabilityZones(Arrays.asList("qrolfpf"))) + .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("wbxgjvt") + .withOutboundType(OutboundType.LOAD_BALANCER) + .withEnablePrivateApiServer(false) + .withApiServerAuthorizedIpRanges(Arrays.asList("dnrujqguhmuouqfp"))) + .withLogAnalyticsProfile(new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false) + .withWorkspaceId("bngui"))))); model = BinaryData.fromObject(model).toObject(ClusterPoolListResult.class); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("xolniwpwcukjfk", model.value().get(0).tags().get("iawxklry")); - Assertions.assertEquals("qvkoc", model.value().get(0).properties().managedResourceGroupName()); - Assertions.assertEquals("sqrglssainq", + Assertions.assertEquals("gazxuf", model.value().get(0).location()); + Assertions.assertEquals("ckyfih", model.value().get(0).tags().get("fidfvzw")); + Assertions.assertEquals("bciqfouflm", model.value().get(0).properties().managedResourceGroupName()); + Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("jwnzlljfmp", model.value().get(0).properties().computeProfile().vmSize()); - Assertions.assertEquals("ltmrldh", model.value().get(0).properties().networkProfile().subnetId()); + Assertions.assertEquals("tduqktapspwgcuer", + model.value().get(0).properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("umkdosvqwhbmd", + model.value().get(0).properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("bbjfddgmbmbexp", model.value().get(0).properties().computeProfile().vmSize()); + Assertions.assertEquals("qrolfpf", + model.value().get(0).properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("wbxgjvt", model.value().get(0).properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.value().get(0).properties().networkProfile().outboundType()); - Assertions.assertEquals(true, model.value().get(0).properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("tqxhocdgeab", + Assertions.assertEquals(false, model.value().get(0).properties().networkProfile().enablePrivateApiServer()); + Assertions.assertEquals("dnrujqguhmuouqfp", model.value().get(0).properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(true, model.value().get(0).properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("i", model.value().get(0).properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals(false, model.value().get(0).properties().logAnalyticsProfile().enabled()); + Assertions.assertEquals("bngui", model.value().get(0).properties().logAnalyticsProfile().workspaceId()); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolLogAnalyticsProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolLogAnalyticsProfileTests.java index 11a539578fcbe..678fb59a9a316 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolLogAnalyticsProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolLogAnalyticsProfileTests.java @@ -11,19 +11,18 @@ public final class ClusterPoolLogAnalyticsProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolLogAnalyticsProfile model - = BinaryData.fromString("{\"enabled\":false,\"workspaceId\":\"gispemvtzfkufubl\"}") - .toObject(ClusterPoolLogAnalyticsProfile.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gispemvtzfkufubl", model.workspaceId()); + ClusterPoolLogAnalyticsProfile model = BinaryData.fromString("{\"enabled\":true,\"workspaceId\":\"jkot\"}") + .toObject(ClusterPoolLogAnalyticsProfile.class); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("jkot", model.workspaceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolLogAnalyticsProfile model - = new ClusterPoolLogAnalyticsProfile().withEnabled(false).withWorkspaceId("gispemvtzfkufubl"); + = new ClusterPoolLogAnalyticsProfile().withEnabled(true).withWorkspaceId("jkot"); model = BinaryData.fromObject(model).toObject(ClusterPoolLogAnalyticsProfile.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gispemvtzfkufubl", model.workspaceId()); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("jkot", model.workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNetworkProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNetworkProfileTests.java index 5f9458117e880..e49d8f8af465f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNetworkProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNetworkProfileTests.java @@ -14,23 +14,24 @@ public final class ClusterPoolNetworkProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolNetworkProfile model = BinaryData.fromString( - "{\"subnetId\":\"oginuvamiheognar\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"tusivyevcciqihn\"]}") + "{\"subnetId\":\"k\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"iwpwcuk\",\"fkgiawxk\",\"ryplwckbasyypn\"]}") .toObject(ClusterPoolNetworkProfile.class); - Assertions.assertEquals("oginuvamiheognar", model.subnetId()); + Assertions.assertEquals("k", model.subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.outboundType()); - Assertions.assertEquals(false, model.enablePrivateApiServer()); - Assertions.assertEquals("tusivyevcciqihn", model.apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(true, model.enablePrivateApiServer()); + Assertions.assertEquals("iwpwcuk", model.apiServerAuthorizedIpRanges().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolNetworkProfile model = new ClusterPoolNetworkProfile().withSubnetId("oginuvamiheognar") - .withOutboundType(OutboundType.LOAD_BALANCER).withEnablePrivateApiServer(false) - .withApiServerAuthorizedIpRanges(Arrays.asList("tusivyevcciqihn")); + ClusterPoolNetworkProfile model = new ClusterPoolNetworkProfile().withSubnetId("k") + .withOutboundType(OutboundType.LOAD_BALANCER) + .withEnablePrivateApiServer(true) + .withApiServerAuthorizedIpRanges(Arrays.asList("iwpwcuk", "fkgiawxk", "ryplwckbasyypn")); model = BinaryData.fromObject(model).toObject(ClusterPoolNetworkProfile.class); - Assertions.assertEquals("oginuvamiheognar", model.subnetId()); + Assertions.assertEquals("k", model.subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.outboundType()); - Assertions.assertEquals(false, model.enablePrivateApiServer()); - Assertions.assertEquals("tusivyevcciqihn", model.apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(true, model.enablePrivateApiServer()); + Assertions.assertEquals("iwpwcuk", model.apiServerAuthorizedIpRanges().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNodeOsUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNodeOsUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..fe377afa57ca7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolNodeOsUpgradeHistoryPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolNodeOsUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPoolNodeOsUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPoolNodeOsUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"NodeOsUpgrade\",\"newNodeOs\":\"brn\",\"utcTime\":\"suxmpraf\",\"upgradeResult\":\"Succeed\"}") + .toObject(ClusterPoolNodeOsUpgradeHistoryProperties.class); + Assertions.assertEquals("suxmpraf", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("brn", model.newNodeOs()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPoolNodeOsUpgradeHistoryProperties model + = new ClusterPoolNodeOsUpgradeHistoryProperties().withUtcTime("suxmpraf") + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED) + .withNewNodeOs("brn"); + model = BinaryData.fromObject(model).toObject(ClusterPoolNodeOsUpgradeHistoryProperties.class); + Assertions.assertEquals("suxmpraf", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + Assertions.assertEquals("brn", model.newNodeOs()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolProfileTests.java index 59f61f38e51d2..f2880606ce146 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolProfileTests.java @@ -6,20 +6,27 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import org.junit.jupiter.api.Assertions; public final class ClusterPoolProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolProfile model - = BinaryData.fromString("{\"clusterPoolVersion\":\"nhsjcnyej\"}").toObject(ClusterPoolProfile.class); - Assertions.assertEquals("nhsjcnyej", model.clusterPoolVersion()); + ClusterPoolProfile model = BinaryData.fromString( + "{\"clusterPoolVersion\":\"vdphlxaolthqtr\",\"publicIpTag\":{\"ipTagType\":\"jbp\",\"tag\":\"zfsinzgvf\"}}") + .toObject(ClusterPoolProfile.class); + Assertions.assertEquals("vdphlxaolthqtr", model.clusterPoolVersion()); + Assertions.assertEquals("jbp", model.publicIpTag().ipTagType()); + Assertions.assertEquals("zfsinzgvf", model.publicIpTag().tag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolProfile model = new ClusterPoolProfile().withClusterPoolVersion("nhsjcnyej"); + ClusterPoolProfile model = new ClusterPoolProfile().withClusterPoolVersion("vdphlxaolthqtr") + .withPublicIpTag(new IpTag().withIpTagType("jbp").withTag("zfsinzgvf")); model = BinaryData.fromObject(model).toObject(ClusterPoolProfile.class); - Assertions.assertEquals("nhsjcnyej", model.clusterPoolVersion()); + Assertions.assertEquals("vdphlxaolthqtr", model.clusterPoolVersion()); + Assertions.assertEquals("jbp", model.publicIpTag().ipTagType()); + Assertions.assertEquals("zfsinzgvf", model.publicIpTag().tag()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesAksClusterProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesAksClusterProfileTests.java index f9bdec09fd0f9..f45337da1de99 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesAksClusterProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesAksClusterProfileTests.java @@ -13,24 +13,26 @@ public final class ClusterPoolResourcePropertiesAksClusterProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolResourcePropertiesAksClusterProfile model = BinaryData.fromString( - "{\"aksClusterResourceId\":\"hgejspodma\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"zyde\",\"msiClientId\":\"o\",\"msiObjectId\":\"wyahuxinpmqnja\"},\"aksVersion\":\"ixjsprozvcputeg\"}") + "{\"aksClusterResourceId\":\"fygxgispemvtzfk\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"ubljofxqe\",\"msiClientId\":\"fjaeq\",\"msiObjectId\":\"hqjbasvmsmj\"},\"aksVersion\":\"lngsntnbybkzgcwr\"}") .toObject(ClusterPoolResourcePropertiesAksClusterProfile.class); - Assertions.assertEquals("hgejspodma", model.aksClusterResourceId()); - Assertions.assertEquals("zyde", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); - Assertions.assertEquals("o", model.aksClusterAgentPoolIdentityProfile().msiClientId()); - Assertions.assertEquals("wyahuxinpmqnja", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); + Assertions.assertEquals("fygxgispemvtzfk", model.aksClusterResourceId()); + Assertions.assertEquals("ubljofxqe", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); + Assertions.assertEquals("fjaeq", model.aksClusterAgentPoolIdentityProfile().msiClientId()); + Assertions.assertEquals("hqjbasvmsmj", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolResourcePropertiesAksClusterProfile model - = new ClusterPoolResourcePropertiesAksClusterProfile().withAksClusterResourceId("hgejspodma") - .withAksClusterAgentPoolIdentityProfile(new AksClusterProfileAksClusterAgentPoolIdentityProfile() - .withMsiResourceId("zyde").withMsiClientId("o").withMsiObjectId("wyahuxinpmqnja")); + = new ClusterPoolResourcePropertiesAksClusterProfile().withAksClusterResourceId("fygxgispemvtzfk") + .withAksClusterAgentPoolIdentityProfile( + new AksClusterProfileAksClusterAgentPoolIdentityProfile().withMsiResourceId("ubljofxqe") + .withMsiClientId("fjaeq") + .withMsiObjectId("hqjbasvmsmj")); model = BinaryData.fromObject(model).toObject(ClusterPoolResourcePropertiesAksClusterProfile.class); - Assertions.assertEquals("hgejspodma", model.aksClusterResourceId()); - Assertions.assertEquals("zyde", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); - Assertions.assertEquals("o", model.aksClusterAgentPoolIdentityProfile().msiClientId()); - Assertions.assertEquals("wyahuxinpmqnja", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); + Assertions.assertEquals("fygxgispemvtzfk", model.aksClusterResourceId()); + Assertions.assertEquals("ubljofxqe", model.aksClusterAgentPoolIdentityProfile().msiResourceId()); + Assertions.assertEquals("fjaeq", model.aksClusterAgentPoolIdentityProfile().msiClientId()); + Assertions.assertEquals("hqjbasvmsmj", model.aksClusterAgentPoolIdentityProfile().msiObjectId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesClusterPoolProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesClusterPoolProfileTests.java index f87dc5d5abb37..0dc8013d7e2ff 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesClusterPoolProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesClusterPoolProfileTests.java @@ -6,22 +6,28 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesClusterPoolProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import org.junit.jupiter.api.Assertions; public final class ClusterPoolResourcePropertiesClusterPoolProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolResourcePropertiesClusterPoolProfile model - = BinaryData.fromString("{\"clusterPoolVersion\":\"dcc\"}") - .toObject(ClusterPoolResourcePropertiesClusterPoolProfile.class); - Assertions.assertEquals("dcc", model.clusterPoolVersion()); + ClusterPoolResourcePropertiesClusterPoolProfile model = BinaryData.fromString( + "{\"clusterPoolVersion\":\"bcryffdfd\",\"publicIpTag\":{\"ipTagType\":\"ygexpaojakhmsb\",\"tag\":\"jhcrz\"}}") + .toObject(ClusterPoolResourcePropertiesClusterPoolProfile.class); + Assertions.assertEquals("bcryffdfd", model.clusterPoolVersion()); + Assertions.assertEquals("ygexpaojakhmsb", model.publicIpTag().ipTagType()); + Assertions.assertEquals("jhcrz", model.publicIpTag().tag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolResourcePropertiesClusterPoolProfile model - = new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("dcc"); + = new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("bcryffdfd") + .withPublicIpTag(new IpTag().withIpTagType("ygexpaojakhmsb").withTag("jhcrz")); model = BinaryData.fromObject(model).toObject(ClusterPoolResourcePropertiesClusterPoolProfile.class); - Assertions.assertEquals("dcc", model.clusterPoolVersion()); + Assertions.assertEquals("bcryffdfd", model.clusterPoolVersion()); + Assertions.assertEquals("ygexpaojakhmsb", model.publicIpTag().ipTagType()); + Assertions.assertEquals("jhcrz", model.publicIpTag().tag()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesComputeProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesComputeProfileTests.java index 98b003c5614a4..2597f941efaea 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesComputeProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesComputeProfileTests.java @@ -6,22 +6,26 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ClusterPoolResourcePropertiesComputeProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolResourcePropertiesComputeProfile model - = BinaryData.fromString("{\"vmSize\":\"kryhtnapczwlokj\",\"count\":1793570177}") - .toObject(ClusterPoolResourcePropertiesComputeProfile.class); - Assertions.assertEquals("kryhtnapczwlokj", model.vmSize()); + ClusterPoolResourcePropertiesComputeProfile model = BinaryData.fromString( + "{\"vmSize\":\"felluwfzitonpe\",\"count\":794210755,\"availabilityZones\":[\"jlxofpdvhpfxxyp\",\"ninmayhuyb\",\"kpode\"]}") + .toObject(ClusterPoolResourcePropertiesComputeProfile.class); + Assertions.assertEquals("felluwfzitonpe", model.vmSize()); + Assertions.assertEquals("jlxofpdvhpfxxyp", model.availabilityZones().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolResourcePropertiesComputeProfile model - = new ClusterPoolResourcePropertiesComputeProfile().withVmSize("kryhtnapczwlokj"); + = new ClusterPoolResourcePropertiesComputeProfile().withVmSize("felluwfzitonpe") + .withAvailabilityZones(Arrays.asList("jlxofpdvhpfxxyp", "ninmayhuyb", "kpode")); model = BinaryData.fromObject(model).toObject(ClusterPoolResourcePropertiesComputeProfile.class); - Assertions.assertEquals("kryhtnapczwlokj", model.vmSize()); + Assertions.assertEquals("felluwfzitonpe", model.vmSize()); + Assertions.assertEquals("jlxofpdvhpfxxyp", model.availabilityZones().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesLogAnalyticsProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesLogAnalyticsProfileTests.java index a42fc0caaa27f..8637e8b250aec 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesLogAnalyticsProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesLogAnalyticsProfileTests.java @@ -12,18 +12,18 @@ public final class ClusterPoolResourcePropertiesLogAnalyticsProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolResourcePropertiesLogAnalyticsProfile model - = BinaryData.fromString("{\"enabled\":false,\"workspaceId\":\"gbwjzrnf\"}") + = BinaryData.fromString("{\"enabled\":false,\"workspaceId\":\"sgcbac\"}") .toObject(ClusterPoolResourcePropertiesLogAnalyticsProfile.class); Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gbwjzrnf", model.workspaceId()); + Assertions.assertEquals("sgcbac", model.workspaceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolResourcePropertiesLogAnalyticsProfile model - = new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false).withWorkspaceId("gbwjzrnf"); + = new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false).withWorkspaceId("sgcbac"); model = BinaryData.fromObject(model).toObject(ClusterPoolResourcePropertiesLogAnalyticsProfile.class); Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gbwjzrnf", model.workspaceId()); + Assertions.assertEquals("sgcbac", model.workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesNetworkProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesNetworkProfileTests.java index afea3d87fe1fb..676b75fa07fdb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesNetworkProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesNetworkProfileTests.java @@ -14,24 +14,25 @@ public final class ClusterPoolResourcePropertiesNetworkProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolResourcePropertiesNetworkProfile model = BinaryData.fromString( - "{\"subnetId\":\"jrwzox\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"uwfzitonpe\",\"fpjkjlxofp\",\"vhpfxxypininmay\",\"uybbkpodep\"]}") + "{\"subnetId\":\"feusnhut\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"dhugjzzdatqxhocd\",\"eablg\",\"huticndvkao\",\"wyiftyhxhur\"]}") .toObject(ClusterPoolResourcePropertiesNetworkProfile.class); - Assertions.assertEquals("jrwzox", model.subnetId()); + Assertions.assertEquals("feusnhut", model.subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.outboundType()); - Assertions.assertEquals(true, model.enablePrivateApiServer()); - Assertions.assertEquals("uwfzitonpe", model.apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(false, model.enablePrivateApiServer()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.apiServerAuthorizedIpRanges().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolResourcePropertiesNetworkProfile model = new ClusterPoolResourcePropertiesNetworkProfile() - .withSubnetId("jrwzox").withOutboundType(OutboundType.LOAD_BALANCER).withEnablePrivateApiServer(true) - .withApiServerAuthorizedIpRanges( - Arrays.asList("uwfzitonpe", "fpjkjlxofp", "vhpfxxypininmay", "uybbkpodep")); + .withSubnetId("feusnhut") + .withOutboundType(OutboundType.LOAD_BALANCER) + .withEnablePrivateApiServer(false) + .withApiServerAuthorizedIpRanges(Arrays.asList("dhugjzzdatqxhocd", "eablg", "huticndvkao", "wyiftyhxhur")); model = BinaryData.fromObject(model).toObject(ClusterPoolResourcePropertiesNetworkProfile.class); - Assertions.assertEquals("jrwzox", model.subnetId()); + Assertions.assertEquals("feusnhut", model.subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.outboundType()); - Assertions.assertEquals(true, model.enablePrivateApiServer()); - Assertions.assertEquals("uwfzitonpe", model.apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(false, model.enablePrivateApiServer()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.apiServerAuthorizedIpRanges().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesTests.java index 3ee513b516148..a12cec0696cf5 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolResourcePropertiesTests.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -18,41 +19,48 @@ public final class ClusterPoolResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolResourceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"deploymentId\":\"arhmofcqhsmy\",\"managedResourceGroupName\":\"kdtmlxhekuk\",\"aksManagedResourceGroupName\":\"txukcdmp\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"cryuan\"},\"computeProfile\":{\"vmSize\":\"w\",\"count\":1339392727},\"aksClusterProfile\":{\"aksClusterResourceId\":\"t\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"rlhm\",\"msiClientId\":\"hfpmrqobmtukknr\",\"msiObjectId\":\"rtihfxtijbpz\"},\"aksVersion\":\"nwzsymg\"},\"networkProfile\":{\"subnetId\":\"uf\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"bihanuf\",\"fcbjysagithxqha\",\"ifpikxwczby\",\"cnpqxuhivyqniwby\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"vd\"},\"status\":\"jgrtfwvukxga\"}") + "{\"provisioningState\":\"Canceled\",\"deploymentId\":\"nryrtihf\",\"managedResourceGroupName\":\"ijbpzvgnwzsymgl\",\"aksManagedResourceGroupName\":\"fcyzkohdbihanufh\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"bj\",\"publicIpTag\":{\"ipTagType\":\"a\",\"tag\":\"ithxqhabifpi\"}},\"computeProfile\":{\"vmSize\":\"xwczbyscnp\",\"count\":219984358,\"availabilityZones\":[\"vyq\",\"iwbybrkxvdumjg\",\"tfwvukxgaudc\",\"snhsjcnyejhkryh\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"pczwlo\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"yemkkvnip\",\"msiClientId\":\"oxzjnchgejspod\",\"msiObjectId\":\"ailzydehojwyahu\"},\"aksVersion\":\"npmqnjaqwixjspro\"},\"networkProfile\":{\"subnetId\":\"cputegjvwmfdats\",\"outboundType\":\"userDefinedRouting\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"u\",\"suuv\",\"kjozkrwfnd\",\"odjpslwejd\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"yoqpsoaccta\"},\"status\":\"kljla\"}") .toObject(ClusterPoolResourceProperties.class); - Assertions.assertEquals("kdtmlxhekuk", model.managedResourceGroupName()); - Assertions.assertEquals("cryuan", model.clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("w", model.computeProfile().vmSize()); - Assertions.assertEquals("uf", model.networkProfile().subnetId()); - Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.networkProfile().outboundType()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.managedResourceGroupName()); + Assertions.assertEquals("bj", model.clusterPoolProfile().clusterPoolVersion()); + Assertions.assertEquals("a", model.clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("ithxqhabifpi", model.clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("xwczbyscnp", model.computeProfile().vmSize()); + Assertions.assertEquals("vyq", model.computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("cputegjvwmfdats", model.networkProfile().subnetId()); + Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.networkProfile().outboundType()); Assertions.assertEquals(true, model.networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("bihanuf", model.networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(false, model.logAnalyticsProfile().enabled()); - Assertions.assertEquals("vd", model.logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("u", model.networkProfile().apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(true, model.logAnalyticsProfile().enabled()); + Assertions.assertEquals("yoqpsoaccta", model.logAnalyticsProfile().workspaceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolResourceProperties model - = new ClusterPoolResourceProperties().withManagedResourceGroupName("kdtmlxhekuk") - .withClusterPoolProfile( - new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("cryuan")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("w")) - .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("uf") - .withOutboundType(OutboundType.LOAD_BALANCER).withEnablePrivateApiServer(true) - .withApiServerAuthorizedIpRanges( - Arrays.asList("bihanuf", "fcbjysagithxqha", "ifpikxwczby", "cnpqxuhivyqniwby"))) - .withLogAnalyticsProfile( - new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false).withWorkspaceId("vd")); + ClusterPoolResourceProperties model = new ClusterPoolResourceProperties() + .withManagedResourceGroupName("ijbpzvgnwzsymgl") + .withClusterPoolProfile(new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("bj") + .withPublicIpTag(new IpTag().withIpTagType("a").withTag("ithxqhabifpi"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("xwczbyscnp") + .withAvailabilityZones(Arrays.asList("vyq", "iwbybrkxvdumjg", "tfwvukxgaudc", "snhsjcnyejhkryh"))) + .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("cputegjvwmfdats") + .withOutboundType(OutboundType.USER_DEFINED_ROUTING) + .withEnablePrivateApiServer(true) + .withApiServerAuthorizedIpRanges(Arrays.asList("u", "suuv", "kjozkrwfnd", "odjpslwejd"))) + .withLogAnalyticsProfile(new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(true) + .withWorkspaceId("yoqpsoaccta")); model = BinaryData.fromObject(model).toObject(ClusterPoolResourceProperties.class); - Assertions.assertEquals("kdtmlxhekuk", model.managedResourceGroupName()); - Assertions.assertEquals("cryuan", model.clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("w", model.computeProfile().vmSize()); - Assertions.assertEquals("uf", model.networkProfile().subnetId()); - Assertions.assertEquals(OutboundType.LOAD_BALANCER, model.networkProfile().outboundType()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.managedResourceGroupName()); + Assertions.assertEquals("bj", model.clusterPoolProfile().clusterPoolVersion()); + Assertions.assertEquals("a", model.clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("ithxqhabifpi", model.clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("xwczbyscnp", model.computeProfile().vmSize()); + Assertions.assertEquals("vyq", model.computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("cputegjvwmfdats", model.networkProfile().subnetId()); + Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.networkProfile().outboundType()); Assertions.assertEquals(true, model.networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("bihanuf", model.networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(false, model.logAnalyticsProfile().enabled()); - Assertions.assertEquals("vd", model.logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("u", model.networkProfile().apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(true, model.logAnalyticsProfile().enabled()); + Assertions.assertEquals("yoqpsoaccta", model.logAnalyticsProfile().workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListMockTests.java new file mode 100644 index 0000000000000..64987300519a5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoriesListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.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.containers.HDInsightContainersManager; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistory; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +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 ClusterPoolUpgradeHistoriesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolUpgradeHistoryProperties\",\"utcTime\":\"owxeqocljmy\",\"upgradeResult\":\"Succeed\"},\"id\":\"zqkjjeokbzefe\",\"name\":\"rx\",\"type\":\"czurtlei\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.clusterPoolUpgradeHistories().list("qzinkfkbg", "z", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("owxeqocljmy", response.iterator().next().properties().utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, + response.iterator().next().properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryInnerTests.java new file mode 100644 index 0000000000000..0fb4ecc54809c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryInnerTests.java @@ -0,0 +1,32 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPoolUpgradeHistoryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPoolUpgradeHistoryInner model = BinaryData.fromString( + "{\"properties\":{\"upgradeType\":\"ClusterPoolUpgradeHistoryProperties\",\"utcTime\":\"scpai\",\"upgradeResult\":\"Succeed\"},\"id\":\"hbcsgl\",\"name\":\"mmajtjaodx\",\"type\":\"bnbdxkqpxokajion\"}") + .toObject(ClusterPoolUpgradeHistoryInner.class); + Assertions.assertEquals("scpai", model.properties().utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.properties().upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPoolUpgradeHistoryInner model = new ClusterPoolUpgradeHistoryInner() + .withProperties(new ClusterPoolUpgradeHistoryProperties().withUtcTime("scpai") + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED)); + model = BinaryData.fromObject(model).toObject(ClusterPoolUpgradeHistoryInner.class); + Assertions.assertEquals("scpai", model.properties().utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.SUCCEED, model.properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryListResultTests.java new file mode 100644 index 0000000000000..0b6c6a7db0043 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryListResultTests.java @@ -0,0 +1,37 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryListResult; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPoolUpgradeHistoryListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPoolUpgradeHistoryListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterPoolUpgradeHistoryProperties\",\"utcTime\":\"ljavbqid\",\"upgradeResult\":\"Failed\"},\"id\":\"jzyulpk\",\"name\":\"dj\",\"type\":\"rlkhbzhfepgzgq\"}],\"nextLink\":\"zloc\"}") + .toObject(ClusterPoolUpgradeHistoryListResult.class); + Assertions.assertEquals("ljavbqid", model.value().get(0).properties().utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED, + model.value().get(0).properties().upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPoolUpgradeHistoryListResult model + = new ClusterPoolUpgradeHistoryListResult().withValue(Arrays.asList(new ClusterPoolUpgradeHistoryInner() + .withProperties(new ClusterPoolUpgradeHistoryProperties().withUtcTime("ljavbqid") + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED)))); + model = BinaryData.fromObject(model).toObject(ClusterPoolUpgradeHistoryListResult.class); + Assertions.assertEquals("ljavbqid", model.value().get(0).properties().utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED, + model.value().get(0).properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..1a1080dd686be --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolUpgradeHistoryPropertiesTests.java @@ -0,0 +1,31 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPoolUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPoolUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"ClusterPoolUpgradeHistoryProperties\",\"utcTime\":\"imexgstxgcpodgma\",\"upgradeResult\":\"Failed\"}") + .toObject(ClusterPoolUpgradeHistoryProperties.class); + Assertions.assertEquals("imexgstxgcpodgma", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPoolUpgradeHistoryProperties model + = new ClusterPoolUpgradeHistoryProperties().withUtcTime("imexgstxgcpodgma") + .withUpgradeResult(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED); + model = BinaryData.fromObject(model).toObject(ClusterPoolUpgradeHistoryProperties.class); + Assertions.assertEquals("imexgstxgcpodgma", model.utcTime()); + Assertions.assertEquals(ClusterPoolUpgradeHistoryUpgradeResultType.FAILED, model.upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionInnerTests.java index 8d1f7a645c1fb..4a546cfa46ea6 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionInnerTests.java @@ -13,20 +13,22 @@ public final class ClusterPoolVersionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolVersionInner model = BinaryData.fromString( - "{\"properties\":{\"clusterPoolVersion\":\"guufzd\",\"aksVersion\":\"yqtfihwh\",\"isPreview\":true},\"id\":\"ingamvp\",\"name\":\"ho\",\"type\":\"zqzudph\"}") + "{\"properties\":{\"clusterPoolVersion\":\"jgcyztsfmznba\",\"aksVersion\":\"ph\",\"isPreview\":true},\"id\":\"rn\",\"name\":\"pxehuwrykqga\",\"type\":\"fmviklby\"}") .toObject(ClusterPoolVersionInner.class); - Assertions.assertEquals("guufzd", model.properties().clusterPoolVersion()); - Assertions.assertEquals("yqtfihwh", model.properties().aksVersion()); + Assertions.assertEquals("jgcyztsfmznba", model.properties().clusterPoolVersion()); + Assertions.assertEquals("ph", model.properties().aksVersion()); Assertions.assertEquals(true, model.properties().isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolVersionInner model = new ClusterPoolVersionInner().withProperties(new ClusterPoolVersionProperties() - .withClusterPoolVersion("guufzd").withAksVersion("yqtfihwh").withIsPreview(true)); + ClusterPoolVersionInner model = new ClusterPoolVersionInner() + .withProperties(new ClusterPoolVersionProperties().withClusterPoolVersion("jgcyztsfmznba") + .withAksVersion("ph") + .withIsPreview(true)); model = BinaryData.fromObject(model).toObject(ClusterPoolVersionInner.class); - Assertions.assertEquals("guufzd", model.properties().clusterPoolVersion()); - Assertions.assertEquals("yqtfihwh", model.properties().aksVersion()); + Assertions.assertEquals("jgcyztsfmznba", model.properties().clusterPoolVersion()); + Assertions.assertEquals("ph", model.properties().aksVersion()); Assertions.assertEquals(true, model.properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionPropertiesTests.java index 56eecbaea90c0..fa54bbe4ee758 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionPropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionPropertiesTests.java @@ -11,21 +11,22 @@ public final class ClusterPoolVersionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterPoolVersionProperties model - = BinaryData.fromString("{\"clusterPoolVersion\":\"mvdk\",\"aksVersion\":\"ynwcvtbv\",\"isPreview\":true}") - .toObject(ClusterPoolVersionProperties.class); - Assertions.assertEquals("mvdk", model.clusterPoolVersion()); - Assertions.assertEquals("ynwcvtbv", model.aksVersion()); + ClusterPoolVersionProperties model = BinaryData + .fromString("{\"clusterPoolVersion\":\"khbejdznxc\",\"aksVersion\":\"srhnjivo\",\"isPreview\":true}") + .toObject(ClusterPoolVersionProperties.class); + Assertions.assertEquals("khbejdznxc", model.clusterPoolVersion()); + Assertions.assertEquals("srhnjivo", model.aksVersion()); Assertions.assertEquals(true, model.isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterPoolVersionProperties model = new ClusterPoolVersionProperties().withClusterPoolVersion("mvdk") - .withAksVersion("ynwcvtbv").withIsPreview(true); + ClusterPoolVersionProperties model = new ClusterPoolVersionProperties().withClusterPoolVersion("khbejdznxc") + .withAksVersion("srhnjivo") + .withIsPreview(true); model = BinaryData.fromObject(model).toObject(ClusterPoolVersionProperties.class); - Assertions.assertEquals("mvdk", model.clusterPoolVersion()); - Assertions.assertEquals("ynwcvtbv", model.aksVersion()); + Assertions.assertEquals("khbejdznxc", model.clusterPoolVersion()); + Assertions.assertEquals("srhnjivo", model.aksVersion()); Assertions.assertEquals(true, model.isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionsListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionsListResultTests.java index 7b61c47e9b9ba..85c2944fd50b3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionsListResultTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolVersionsListResultTests.java @@ -15,25 +15,27 @@ public final class ClusterPoolVersionsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterPoolVersionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"clusterPoolVersion\":\"twbdsrezpdrhn\",\"aksVersion\":\"yowqkdwytisibir\",\"isPreview\":false},\"id\":\"kpzi\",\"name\":\"ejzanlfz\",\"type\":\"iavrm\"},{\"properties\":{\"clusterPoolVersion\":\"nokixrjqcirgz\",\"aksVersion\":\"rlazszrnw\",\"isPreview\":true},\"id\":\"dfpwpjylwbtlhfls\",\"name\":\"cdhszf\",\"type\":\"vfbgofeljagrqmqh\"},{\"properties\":{\"clusterPoolVersion\":\"riiiojnalghfkv\",\"aksVersion\":\"sexso\",\"isPreview\":false},\"id\":\"uqhhahhxvrh\",\"name\":\"zkw\",\"type\":\"jgwwspughftq\"}],\"nextLink\":\"hqxujxukndxdi\"}") + "{\"value\":[{\"properties\":{\"clusterPoolVersion\":\"jzgxmrhublwp\",\"aksVersion\":\"sutrgjup\",\"isPreview\":true},\"id\":\"p\",\"name\":\"oqh\",\"type\":\"hej\"},{\"properties\":{\"clusterPoolVersion\":\"zpnfqntcypsxj\",\"aksVersion\":\"oimwkslirc\",\"isPreview\":false},\"id\":\"vydfceacvlhvygdy\",\"name\":\"t\",\"type\":\"mrtwna\"}],\"nextLink\":\"slbi\"}") .toObject(ClusterPoolVersionsListResult.class); - Assertions.assertEquals("twbdsrezpdrhn", model.value().get(0).properties().clusterPoolVersion()); - Assertions.assertEquals("yowqkdwytisibir", model.value().get(0).properties().aksVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().isPreview()); + Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).properties().clusterPoolVersion()); + Assertions.assertEquals("sutrgjup", model.value().get(0).properties().aksVersion()); + Assertions.assertEquals(true, model.value().get(0).properties().isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterPoolVersionsListResult model = new ClusterPoolVersionsListResult().withValue(Arrays.asList( - new ClusterPoolVersionInner().withProperties(new ClusterPoolVersionProperties() - .withClusterPoolVersion("twbdsrezpdrhn").withAksVersion("yowqkdwytisibir").withIsPreview(false)), - new ClusterPoolVersionInner().withProperties(new ClusterPoolVersionProperties() - .withClusterPoolVersion("nokixrjqcirgz").withAksVersion("rlazszrnw").withIsPreview(true)), - new ClusterPoolVersionInner().withProperties(new ClusterPoolVersionProperties() - .withClusterPoolVersion("riiiojnalghfkv").withAksVersion("sexso").withIsPreview(false)))); + new ClusterPoolVersionInner() + .withProperties(new ClusterPoolVersionProperties().withClusterPoolVersion("jzgxmrhublwp") + .withAksVersion("sutrgjup") + .withIsPreview(true)), + new ClusterPoolVersionInner() + .withProperties(new ClusterPoolVersionProperties().withClusterPoolVersion("zpnfqntcypsxj") + .withAksVersion("oimwkslirc") + .withIsPreview(false)))); model = BinaryData.fromObject(model).toObject(ClusterPoolVersionsListResult.class); - Assertions.assertEquals("twbdsrezpdrhn", model.value().get(0).properties().clusterPoolVersion()); - Assertions.assertEquals("yowqkdwytisibir", model.value().get(0).properties().aksVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().isPreview()); + Assertions.assertEquals("jzgxmrhublwp", model.value().get(0).properties().clusterPoolVersion()); + Assertions.assertEquals("sutrgjup", model.value().get(0).properties().aksVersion()); + Assertions.assertEquals(true, model.value().get(0).properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateMockTests.java index dfeb481ffd0d8..30e96ffd935a1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsCreateOrUpdateMockTests.java @@ -6,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourceProperties; @@ -18,8 +16,8 @@ import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesComputeProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsight.containers.models.IpTag; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -27,60 +25,57 @@ import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentId\":\"jlfrq\",\"managedResourceGroupName\":\"bajlka\",\"aksManagedResourceGroupName\":\"wxyiopidkqq\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"uvscxkdmligov\"},\"computeProfile\":{\"vmSize\":\"brxk\",\"count\":1244288604},\"aksClusterProfile\":{\"aksClusterResourceId\":\"zuruocbgo\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"bteoybf\",\"msiClientId\":\"jxakv\",\"msiObjectId\":\"jgslordilmyww\"},\"aksVersion\":\"gkxnyedabg\"},\"networkProfile\":{\"subnetId\":\"udtjuewbc\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"c\",\"yxccyb\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"akkud\"},\"status\":\"xgwjplmagstcyoh\"},\"location\":\"kyrk\",\"tags\":{\"aiy\":\"giogsjkmnwqjno\"},\"id\":\"ddviacegfnmntfpm\",\"name\":\"memfnczdwvvbalxl\",\"type\":\"lchpodbzevwrdn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentId\":\"geyzihgrkyuiz\",\"managedResourceGroupName\":\"snmfpphojeevy\",\"aksManagedResourceGroupName\":\"hsgz\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"zbgomfgbeg\",\"publicIpTag\":{\"ipTagType\":\"gleohi\",\"tag\":\"etnluankrrfx\"}},\"computeProfile\":{\"vmSize\":\"eebtijvacvb\",\"count\":192666481,\"availabilityZones\":[\"q\",\"lajrnwxacevehj\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"xoafgaoqltfae\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"inmfgvxirp\",\"msiClientId\":\"hriypoqeyhlqhy\",\"msiObjectId\":\"prlpy\"},\"aksVersion\":\"uciqdsme\"},\"networkProfile\":{\"subnetId\":\"itdfuxtyasiib\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"stgnl\",\"hnmgixhcm\",\"vmqfoud\",\"rhc\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"rotwypundmbxhugc\"},\"status\":\"k\"},\"location\":\"lgorb\",\"tags\":{\"jltfvnzcyjtotpv\":\"pmdtz\"},\"id\":\"pvpbdbzqgqqiheds\",\"name\":\"qwthmky\",\"type\":\"bcysih\"}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - ClusterPool response = manager.clusterPools().define("miloxggdufiqndie").withRegion("hbq") - .withExistingResourceGroup("wjhhgdnhxmsivf").withTags(mapOf("x", "xtgzukxitmmqtgqq")) - .withProperties(new ClusterPoolResourceProperties().withManagedResourceGroupName("fgdo") - .withClusterPoolProfile( - new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("ekni")) - .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("shqvcimpev")) - .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("sbpimlq") - .withOutboundType(OutboundType.USER_DEFINED_ROUTING).withEnablePrivateApiServer(true) - .withApiServerAuthorizedIpRanges(Arrays.asList("xxlxsffgcvizq", "dwl", "w", "youpfgfbkj"))) - .withLogAnalyticsProfile(new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(true) - .withWorkspaceId("hgkfmin"))) - .create(); + ClusterPool response + = manager.clusterPools() + .define("boldforobwj") + .withRegion("qoli") + .withExistingResourceGroup("chxgs") + .withTags(mapOf("oq", "aiouaubrjt", "rzpasccbiuimzdly", "fuojrngif", "fdvruz", "dfqwmkyoq")) + .withProperties( + new ClusterPoolResourceProperties().withManagedResourceGroupName("qpbtuodxes") + .withClusterPoolProfile(new ClusterPoolResourcePropertiesClusterPoolProfile() + .withClusterPoolVersion("rwoycqucwyh") + .withPublicIpTag(new IpTag().withIpTagType("nomdrkywuhpsv").withTag("uurutlwexxwlalni"))) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("xzsrzpge") + .withAvailabilityZones(Arrays.asList("bwwpgdakchzy"))) + .withNetworkProfile(new ClusterPoolResourcePropertiesNetworkProfile().withSubnetId("ufmhrunc") + .withOutboundType(OutboundType.USER_DEFINED_ROUTING) + .withEnablePrivateApiServer(false) + .withApiServerAuthorizedIpRanges(Arrays.asList("cdqzhlctddu", "qn", "yfp"))) + .withLogAnalyticsProfile( + new ClusterPoolResourcePropertiesLogAnalyticsProfile().withEnabled(false) + .withWorkspaceId("bnjj"))) + .create(); - Assertions.assertEquals("kyrk", response.location()); - Assertions.assertEquals("giogsjkmnwqjno", response.tags().get("aiy")); - Assertions.assertEquals("bajlka", response.properties().managedResourceGroupName()); - Assertions.assertEquals("uvscxkdmligov", response.properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("brxk", response.properties().computeProfile().vmSize()); - Assertions.assertEquals("udtjuewbc", response.properties().networkProfile().subnetId()); + Assertions.assertEquals("lgorb", response.location()); + Assertions.assertEquals("pmdtz", response.tags().get("jltfvnzcyjtotpv")); + Assertions.assertEquals("snmfpphojeevy", response.properties().managedResourceGroupName()); + Assertions.assertEquals("zbgomfgbeg", response.properties().clusterPoolProfile().clusterPoolVersion()); + Assertions.assertEquals("gleohi", response.properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("etnluankrrfx", response.properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("eebtijvacvb", response.properties().computeProfile().vmSize()); + Assertions.assertEquals("q", response.properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("itdfuxtyasiib", response.properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, response.properties().networkProfile().outboundType()); - Assertions.assertEquals(true, response.properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("c", response.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); - Assertions.assertEquals(true, response.properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("akkud", response.properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals(false, response.properties().networkProfile().enablePrivateApiServer()); + Assertions.assertEquals("stgnl", response.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals(false, response.properties().logAnalyticsProfile().enabled()); + Assertions.assertEquals("rotwypundmbxhugc", response.properties().logAnalyticsProfile().workspaceId()); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteMockTests.java index 41f9bbc41b1a5..4fb40998ed1b3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsDeleteMockTests.java @@ -6,46 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.clusterPools().delete("wxnb", "fezzxscyhwzdg", com.azure.core.util.Context.NONE); + manager.clusterPools().delete("juwasqvdaeyyguxa", "jsqzhzbezk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupWithResponseMockTests.java index 03ff5d25422f4..d67689d5d0d3c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsGetByResourceGroupWithResponseMockTests.java @@ -6,62 +6,48 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"deploymentId\":\"irgne\",\"managedResourceGroupName\":\"twqmsniffcdmqnr\",\"aksManagedResourceGroupName\":\"lpijnkrxfrd\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"c\"},\"computeProfile\":{\"vmSize\":\"atiz\",\"count\":99900434},\"aksClusterProfile\":{\"aksClusterResourceId\":\"sxiftozq\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"hftwesgog\",\"msiClientId\":\"zhonnxkrlgnyhmo\",\"msiObjectId\":\"sxkkg\"},\"aksVersion\":\"rrghxjbdhqxvcxgf\"},\"networkProfile\":{\"subnetId\":\"dsofbshrns\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"z\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"cnunvjsr\"},\"status\":\"f\"},\"location\":\"nopqgikyzirtx\",\"tags\":{\"ejnt\":\"x\",\"dxtqmieoxo\":\"sewgioilqukr\",\"hhavgrvkffovjz\":\"ggufhyaomtb\"},\"id\":\"pjbi\",\"name\":\"gjmfxumvfcl\",\"type\":\"yo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentId\":\"fgzdjtxvz\",\"managedResourceGroupName\":\"bqvgaqv\",\"aksManagedResourceGroupName\":\"a\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"qusrdvetnws\",\"publicIpTag\":{\"ipTagType\":\"utnw\",\"tag\":\"duy\"}},\"computeProfile\":{\"vmSize\":\"vuzhyr\",\"count\":680405996,\"availabilityZones\":[\"mvekdxukuqgsjj\",\"undxgketw\",\"hhzjhfj\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"vmuvgpmu\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"qsxvmhf\",\"msiClientId\":\"uzjyihsasbhudypo\",\"msiObjectId\":\"yue\"},\"aksVersion\":\"lynsqyrpf\"},\"networkProfile\":{\"subnetId\":\"brlttymsjnygq\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"zgtila\",\"hnfhqlyvijouwi\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"yzunbixxrtikv\"},\"status\":\"wpgclrcivt\"},\"location\":\"xfrk\",\"tags\":{\"ka\":\"pmyyefrpmpdnqq\",\"vmm\":\"ao\",\"itgvkx\":\"npqfrtqlkzmeg\",\"hcans\":\"zyqdrfegcealzx\"},\"id\":\"moy\",\"name\":\"hlwigdivbkbxg\",\"type\":\"mf\"}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); ClusterPool response = manager.clusterPools() - .getByResourceGroupWithResponse("wggytsbwtovvt", "seinqfiuf", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("nopqgikyzirtx", response.location()); - Assertions.assertEquals("x", response.tags().get("ejnt")); - Assertions.assertEquals("twqmsniffcdmqnr", response.properties().managedResourceGroupName()); - Assertions.assertEquals("c", response.properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("atiz", response.properties().computeProfile().vmSize()); - Assertions.assertEquals("dsofbshrns", response.properties().networkProfile().subnetId()); + .getByResourceGroupWithResponse("vyi", "zqodfvpgshox", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xfrk", response.location()); + Assertions.assertEquals("pmyyefrpmpdnqq", response.tags().get("ka")); + Assertions.assertEquals("bqvgaqv", response.properties().managedResourceGroupName()); + Assertions.assertEquals("qusrdvetnws", response.properties().clusterPoolProfile().clusterPoolVersion()); + Assertions.assertEquals("utnw", response.properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("duy", response.properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("vuzhyr", response.properties().computeProfile().vmSize()); + Assertions.assertEquals("mvekdxukuqgsjj", response.properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("brlttymsjnygq", response.properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, response.properties().networkProfile().outboundType()); Assertions.assertEquals(false, response.properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("z", response.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); + Assertions.assertEquals("zgtila", response.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); Assertions.assertEquals(true, response.properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("cnunvjsr", response.properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("yzunbixxrtikv", response.properties().logAnalyticsProfile().workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupMockTests.java index d56d12777086c..35d26fc3f907a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListByResourceGroupMockTests.java @@ -6,67 +6,55 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"deploymentId\":\"qgaifmviklbydv\",\"managedResourceGroupName\":\"bejdznxcv\",\"aksManagedResourceGroupName\":\"rhnj\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"olvtnovqfzge\"},\"computeProfile\":{\"vmSize\":\"jdftuljltd\",\"count\":1745294880},\"aksClusterProfile\":{\"aksClusterResourceId\":\"tmczuomejwcwwqi\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"nssxmojmsvpk\",\"msiClientId\":\"prvkwcfzqljyxgtc\",\"msiObjectId\":\"heyd\"},\"aksVersion\":\"dshmkxmaehvbbx\"},\"networkProfile\":{\"subnetId\":\"iplt\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"kgxywr\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"kl\"},\"status\":\"pluodpv\"},\"location\":\"udlgzibthostgkts\",\"tags\":{\"odqkdlwwqfb\":\"xeclzedqbcvhzlhp\",\"lmbtxhwgfwsrt\":\"mlkxtrqjfs\",\"kh\":\"wcoezbrhub\",\"ookk\":\"dyg\"},\"id\":\"fqjbvleo\",\"name\":\"fmluiqtqzfavyvn\",\"type\":\"qybaryeua\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"deploymentId\":\"ytnrzvuljraae\",\"managedResourceGroupName\":\"nok\",\"aksManagedResourceGroupName\":\"ukkjqnvbroyla\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"ulcdisdosf\",\"publicIpTag\":{\"ipTagType\":\"jsvg\",\"tag\":\"rwhryvycytd\"}},\"computeProfile\":{\"vmSize\":\"lxgccknfnwmbtm\",\"count\":166285139,\"availabilityZones\":[\"dhttzaefedxihchr\",\"hk\",\"crjdqnsdfzpbgtg\",\"ylkdghrje\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"lwxezwzhokvbwnh\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"qlgehg\",\"msiClientId\":\"pipifh\",\"msiObjectId\":\"f\"},\"aksVersion\":\"ajvgcxtxjcsheafi\"},\"networkProfile\":{\"subnetId\":\"tugsresmkssjh\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"fwegprhptillu\",\"biqtgdq\",\"hm\",\"wsldrizetpwbr\"]},\"logAnalyticsProfile\":{\"enabled\":true,\"workspaceId\":\"ibph\"},\"status\":\"zmizakakan\"},\"location\":\"p\",\"tags\":{\"xprimrsop\":\"zhajoylhjlmuo\",\"stvasylwxdzaumw\":\"eecjmeis\"},\"id\":\"oohgu\",\"name\":\"fuzboyjathwtzolb\",\"type\":\"emwmdxmebwjs\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.clusterPools().listByResourceGroup("rpxeh", com.azure.core.util.Context.NONE); + = manager.clusterPools().listByResourceGroup("knh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("udlgzibthostgkts", response.iterator().next().location()); - Assertions.assertEquals("xeclzedqbcvhzlhp", response.iterator().next().tags().get("odqkdlwwqfb")); - Assertions.assertEquals("bejdznxcv", response.iterator().next().properties().managedResourceGroupName()); - Assertions.assertEquals("olvtnovqfzge", + Assertions.assertEquals("p", response.iterator().next().location()); + Assertions.assertEquals("zhajoylhjlmuo", response.iterator().next().tags().get("xprimrsop")); + Assertions.assertEquals("nok", response.iterator().next().properties().managedResourceGroupName()); + Assertions.assertEquals("ulcdisdosf", response.iterator().next().properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("jdftuljltd", response.iterator().next().properties().computeProfile().vmSize()); - Assertions.assertEquals("iplt", response.iterator().next().properties().networkProfile().subnetId()); + Assertions.assertEquals("jsvg", + response.iterator().next().properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("rwhryvycytd", + response.iterator().next().properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("lxgccknfnwmbtm", response.iterator().next().properties().computeProfile().vmSize()); + Assertions.assertEquals("dhttzaefedxihchr", + response.iterator().next().properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("tugsresmkssjh", response.iterator().next().properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, response.iterator().next().properties().networkProfile().outboundType()); - Assertions.assertEquals(false, + Assertions.assertEquals(true, response.iterator().next().properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("kgxywr", + Assertions.assertEquals("fwegprhptillu", response.iterator().next().properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); Assertions.assertEquals(true, response.iterator().next().properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("kl", response.iterator().next().properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("ibph", response.iterator().next().properties().logAnalyticsProfile().workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListMockTests.java index 838e20f26691d..fb284378c06f0 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsListMockTests.java @@ -6,67 +6,54 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"deploymentId\":\"zbomvzzbtdcqvpni\",\"managedResourceGroupName\":\"jviylwdshfs\",\"aksManagedResourceGroupName\":\"rbgyefry\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"gaojf\"},\"computeProfile\":{\"vmSize\":\"wncot\",\"count\":1018101586},\"aksClusterProfile\":{\"aksClusterResourceId\":\"rctym\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"oftpipiwycz\",\"msiClientId\":\"hxacpqjlihhyu\",\"msiObjectId\":\"pskasdvlmfwdg\"},\"aksVersion\":\"ulucv\"},\"networkProfile\":{\"subnetId\":\"mrsreuzvxurisjnh\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":false,\"apiServerAuthorizedIpRanges\":[\"jzgxmrhublwp\",\"esutrgjupauutpw\",\"qhih\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"w\"},\"status\":\"nfqn\"},\"location\":\"ypsxjvfoim\",\"tags\":{\"zjxvydfcea\":\"lirc\",\"gdyftumrtwna\":\"vlhv\"},\"id\":\"jslb\",\"name\":\"wkojgcyztsfmzn\",\"type\":\"aeqphchqnr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"deploymentId\":\"dxasicddyvv\",\"managedResourceGroupName\":\"kgfmocwahpq\",\"aksManagedResourceGroupName\":\"tjeaahhvjhh\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"kzyb\",\"publicIpTag\":{\"ipTagType\":\"jid\",\"tag\":\"ksyxkyxvxevblbje\"}},\"computeProfile\":{\"vmSize\":\"nljlageuaulx\",\"count\":783935050,\"availabilityZones\":[\"bn\",\"ppxynenls\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"izzgwkln\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"mffeycxcktpi\",\"msiClientId\":\"merteeammxqiek\",\"msiObjectId\":\"kzddrtkgdojbmxva\"},\"aksVersion\":\"efdeesve\"},\"networkProfile\":{\"subnetId\":\"ijpxtx\",\"outboundType\":\"loadBalancer\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"jwsawddjibab\",\"vit\",\"tvtzeexavoxtfg\",\"ecdmdqbwpy\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"sfj\"},\"status\":\"b\"},\"location\":\"hhxud\",\"tags\":{\"es\":\"odhtnsirudhzm\",\"zrcxfailcfxwmdbo\":\"kdlpa\"},\"id\":\"dfgsftufqobrj\",\"name\":\"nac\",\"type\":\"cc\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.clusterPools().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("ypsxjvfoim", response.iterator().next().location()); - Assertions.assertEquals("lirc", response.iterator().next().tags().get("zjxvydfcea")); - Assertions.assertEquals("jviylwdshfs", response.iterator().next().properties().managedResourceGroupName()); - Assertions.assertEquals("gaojf", + Assertions.assertEquals("hhxud", response.iterator().next().location()); + Assertions.assertEquals("odhtnsirudhzm", response.iterator().next().tags().get("es")); + Assertions.assertEquals("kgfmocwahpq", response.iterator().next().properties().managedResourceGroupName()); + Assertions.assertEquals("kzyb", response.iterator().next().properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("wncot", response.iterator().next().properties().computeProfile().vmSize()); - Assertions.assertEquals("mrsreuzvxurisjnh", - response.iterator().next().properties().networkProfile().subnetId()); + Assertions.assertEquals("jid", + response.iterator().next().properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("ksyxkyxvxevblbje", + response.iterator().next().properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("nljlageuaulx", response.iterator().next().properties().computeProfile().vmSize()); + Assertions.assertEquals("bn", + response.iterator().next().properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("ijpxtx", response.iterator().next().properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.LOAD_BALANCER, response.iterator().next().properties().networkProfile().outboundType()); - Assertions.assertEquals(false, + Assertions.assertEquals(true, response.iterator().next().properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("jzgxmrhublwp", + Assertions.assertEquals("jwsawddjibab", response.iterator().next().properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); Assertions.assertEquals(false, response.iterator().next().properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("w", response.iterator().next().properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("sfj", response.iterator().next().properties().logAnalyticsProfile().workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeMockTests.java index 525673f5f4d7d..bb979223a543e 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterPoolsUpgradeMockTests.java @@ -6,67 +6,52 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPool; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgrade; import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolUpgradeProperties; import com.azure.resourcemanager.hdinsight.containers.models.OutboundType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClusterPoolsUpgradeMockTests { @Test public void testUpgrade() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentId\":\"rnntiewdjcv\",\"managedResourceGroupName\":\"uwrbehwagoh\",\"aksManagedResourceGroupName\":\"f\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"mrqemvvhmx\"},\"computeProfile\":{\"vmSize\":\"drjf\",\"count\":1547497678},\"aksClusterProfile\":{\"aksClusterResourceId\":\"ebjvewzcjzn\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"cpmguaadraufact\",\"msiClientId\":\"ahzovajjziuxxp\",\"msiObjectId\":\"hneekul\"},\"aksVersion\":\"slqubkwdl\"},\"networkProfile\":{\"subnetId\":\"rds\",\"outboundType\":\"userDefinedRouting\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"pjuohminyfl\",\"orwmduvwpklv\",\"w\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"xpgpq\"},\"status\":\"isze\"},\"location\":\"nb\",\"tags\":{\"confozauors\":\"xgibbda\",\"epzl\":\"kokwbqplhlvnu\"},\"id\":\"phwzsoldweyuqdu\",\"name\":\"vmnnrw\",\"type\":\"biorktal\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentId\":\"mqt\",\"managedResourceGroupName\":\"xyi\",\"aksManagedResourceGroupName\":\"dt\",\"clusterPoolProfile\":{\"clusterPoolVersion\":\"cttadi\",\"publicIpTag\":{\"ipTagType\":\"eukmr\",\"tag\":\"ieekpndzaa\"}},\"computeProfile\":{\"vmSize\":\"mudqmeq\",\"count\":334028568,\"availabilityZones\":[\"bu\",\"qwyxebeybpm\"]},\"aksClusterProfile\":{\"aksClusterResourceId\":\"rtffyaqitmh\",\"aksClusterAgentPoolIdentityProfile\":{\"msiResourceId\":\"ioqaqhvs\",\"msiClientId\":\"ufuqyrx\",\"msiObjectId\":\"dlcgqlsismjqfr\"},\"aksVersion\":\"gamquhiosrsjui\"},\"networkProfile\":{\"subnetId\":\"cdisyir\",\"outboundType\":\"userDefinedRouting\",\"enablePrivateApiServer\":true,\"apiServerAuthorizedIpRanges\":[\"xrxzbujrtr\",\"qvwre\",\"khgn\",\"nzonzl\"]},\"logAnalyticsProfile\":{\"enabled\":false,\"workspaceId\":\"yw\"},\"status\":\"vjtszcofize\"},\"location\":\"dhgbjkvre\",\"tags\":{\"shcxlpmjerbdk\":\"amurvzmlovuan\",\"bccxjmonfdgn\":\"lvidizozs\",\"ypuuwwltvuqjctze\":\"n\"},\"id\":\"keifzzhmkdasv\",\"name\":\"lyhb\",\"type\":\"cu\"}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - ClusterPool response = manager.clusterPools().upgrade("jkqa", "qgzsles", - new ClusterPoolUpgrade().withProperties(new ClusterPoolUpgradeProperties()), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nb", response.location()); - Assertions.assertEquals("xgibbda", response.tags().get("confozauors")); - Assertions.assertEquals("uwrbehwagoh", response.properties().managedResourceGroupName()); - Assertions.assertEquals("mrqemvvhmx", response.properties().clusterPoolProfile().clusterPoolVersion()); - Assertions.assertEquals("drjf", response.properties().computeProfile().vmSize()); - Assertions.assertEquals("rds", response.properties().networkProfile().subnetId()); + ClusterPool response = manager.clusterPools() + .upgrade("jpahlxvea", "f", new ClusterPoolUpgrade().withProperties(new ClusterPoolUpgradeProperties()), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("dhgbjkvre", response.location()); + Assertions.assertEquals("amurvzmlovuan", response.tags().get("shcxlpmjerbdk")); + Assertions.assertEquals("xyi", response.properties().managedResourceGroupName()); + Assertions.assertEquals("cttadi", response.properties().clusterPoolProfile().clusterPoolVersion()); + Assertions.assertEquals("eukmr", response.properties().clusterPoolProfile().publicIpTag().ipTagType()); + Assertions.assertEquals("ieekpndzaa", response.properties().clusterPoolProfile().publicIpTag().tag()); + Assertions.assertEquals("mudqmeq", response.properties().computeProfile().vmSize()); + Assertions.assertEquals("bu", response.properties().computeProfile().availabilityZones().get(0)); + Assertions.assertEquals("cdisyir", response.properties().networkProfile().subnetId()); Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, response.properties().networkProfile().outboundType()); Assertions.assertEquals(true, response.properties().networkProfile().enablePrivateApiServer()); - Assertions.assertEquals("pjuohminyfl", + Assertions.assertEquals("xrxzbujrtr", response.properties().networkProfile().apiServerAuthorizedIpRanges().get(0)); Assertions.assertEquals(false, response.properties().logAnalyticsProfile().enabled()); - Assertions.assertEquals("xpgpq", response.properties().logAnalyticsProfile().workspaceId()); + Assertions.assertEquals("yw", response.properties().logAnalyticsProfile().workspaceId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterRangerPluginProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterRangerPluginProfileTests.java index 6b4be4e7c8aaa..b8a41d0abaf31 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterRangerPluginProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterRangerPluginProfileTests.java @@ -12,14 +12,14 @@ public final class ClusterRangerPluginProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterRangerPluginProfile model - = BinaryData.fromString("{\"enabled\":false}").toObject(ClusterRangerPluginProfile.class); - Assertions.assertEquals(false, model.enabled()); + = BinaryData.fromString("{\"enabled\":true}").toObject(ClusterRangerPluginProfile.class); + Assertions.assertEquals(true, model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterRangerPluginProfile model = new ClusterRangerPluginProfile().withEnabled(false); + ClusterRangerPluginProfile model = new ClusterRangerPluginProfile().withEnabled(true); model = BinaryData.fromObject(model).toObject(ClusterRangerPluginProfile.class); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals(true, model.enabled()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizeDataTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizeDataTests.java index 6e1fe412dcac8..75986403159ba 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizeDataTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizeDataTests.java @@ -15,22 +15,22 @@ public final class ClusterResizeDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterResizeData model = BinaryData.fromString( - "{\"properties\":{\"targetWorkerNodeCount\":462425094},\"location\":\"ztfolhbnxk\",\"tags\":{\"pnapnyiropuh\":\"aulppggd\",\"git\":\"igvpgylg\"},\"id\":\"medjvcslynqwwncw\",\"name\":\"zhxgktrmgucn\",\"type\":\"pkteo\"}") + "{\"properties\":{\"targetWorkerNodeCount\":1929078891},\"location\":\"gvvcnayrhyr\",\"tags\":{\"qqtch\":\"mueedndrdvstk\",\"mtdaa\":\"alm\"},\"id\":\"gdv\",\"name\":\"vgpiohgwxrt\",\"type\":\"udxepxgyqagv\"}") .toObject(ClusterResizeData.class); - Assertions.assertEquals("ztfolhbnxk", model.location()); - Assertions.assertEquals("aulppggd", model.tags().get("pnapnyiropuh")); - Assertions.assertEquals(462425094, model.properties().targetWorkerNodeCount()); + Assertions.assertEquals("gvvcnayrhyr", model.location()); + Assertions.assertEquals("mueedndrdvstk", model.tags().get("qqtch")); + Assertions.assertEquals(1929078891, model.properties().targetWorkerNodeCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterResizeData model = new ClusterResizeData().withLocation("ztfolhbnxk") - .withTags(mapOf("pnapnyiropuh", "aulppggd", "git", "igvpgylg")) - .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(462425094)); + ClusterResizeData model = new ClusterResizeData().withLocation("gvvcnayrhyr") + .withTags(mapOf("qqtch", "mueedndrdvstk", "mtdaa", "alm")) + .withProperties(new ClusterResizeProperties().withTargetWorkerNodeCount(1929078891)); model = BinaryData.fromObject(model).toObject(ClusterResizeData.class); - Assertions.assertEquals("ztfolhbnxk", model.location()); - Assertions.assertEquals("aulppggd", model.tags().get("pnapnyiropuh")); - Assertions.assertEquals(462425094, model.properties().targetWorkerNodeCount()); + Assertions.assertEquals("gvvcnayrhyr", model.location()); + Assertions.assertEquals("mueedndrdvstk", model.tags().get("qqtch")); + Assertions.assertEquals(1929078891, model.properties().targetWorkerNodeCount()); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizePropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizePropertiesTests.java index 9864a3429a02c..a57be129517a3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizePropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterResizePropertiesTests.java @@ -12,14 +12,14 @@ public final class ClusterResizePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterResizeProperties model - = BinaryData.fromString("{\"targetWorkerNodeCount\":1950925712}").toObject(ClusterResizeProperties.class); - Assertions.assertEquals(1950925712, model.targetWorkerNodeCount()); + = BinaryData.fromString("{\"targetWorkerNodeCount\":1825902686}").toObject(ClusterResizeProperties.class); + Assertions.assertEquals(1825902686, model.targetWorkerNodeCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterResizeProperties model = new ClusterResizeProperties().withTargetWorkerNodeCount(1950925712); + ClusterResizeProperties model = new ClusterResizeProperties().withTargetWorkerNodeCount(1825902686); model = BinaryData.fromObject(model).toObject(ClusterResizeProperties.class); - Assertions.assertEquals(1950925712, model.targetWorkerNodeCount()); + Assertions.assertEquals(1825902686, model.targetWorkerNodeCount()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigTests.java index 6ea29e3739474..c3d101338c7ba 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigTests.java @@ -17,33 +17,43 @@ public final class ClusterServiceConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterServiceConfig model = BinaryData.fromString( - "{\"component\":\"rsa\",\"files\":[{\"fileName\":\"wkuofoskghsauu\",\"content\":\"jmvxie\",\"encoding\":\"Base64\",\"path\":\"idyjrrfbyaosvexc\",\"values\":{\"vleggzfbuhfmvfax\":\"pclhocohslk\"}},{\"fileName\":\"ffeii\",\"content\":\"lvmezyvshxmzsbbz\",\"encoding\":\"Base64\",\"path\":\"grxwbu\",\"values\":{\"enkouknvudw\":\"xxjnspydptk\"}}]}") + "{\"component\":\"xobbcswsrt\",\"files\":[{\"fileName\":\"iplrbpbewtghfgb\",\"content\":\"gw\",\"encoding\":\"None\",\"path\":\"v\",\"values\":{\"mxiebw\":\"kbegibt\",\"gwyzm\":\"aloayqcgwrtzju\",\"mtsavjcbpwxqp\":\"txon\",\"yvxqtayriwwroy\":\"rknftguvriuhprwm\"}},{\"fileName\":\"bexrmcq\",\"content\":\"ycnojvknmefqsg\",\"encoding\":\"Base64\",\"path\":\"apj\",\"values\":{\"lxkvu\":\"pvgqzcjrvxdjzlm\",\"n\":\"fhzovawjvzunluth\"}},{\"fileName\":\"rnxipei\",\"content\":\"jzuaejxdultskzbb\",\"encoding\":\"None\",\"path\":\"mv\",\"values\":{\"zuhkfpbsjyof\":\"gpw\",\"us\":\"xl\"}}]}") .toObject(ClusterServiceConfig.class); - Assertions.assertEquals("rsa", model.component()); - Assertions.assertEquals("wkuofoskghsauu", model.files().get(0).fileName()); - Assertions.assertEquals("jmvxie", model.files().get(0).content()); - Assertions.assertEquals(ContentEncoding.BASE64, model.files().get(0).encoding()); - Assertions.assertEquals("idyjrrfbyaosvexc", model.files().get(0).path()); - Assertions.assertEquals("pclhocohslk", model.files().get(0).values().get("vleggzfbuhfmvfax")); + Assertions.assertEquals("xobbcswsrt", model.component()); + Assertions.assertEquals("iplrbpbewtghfgb", model.files().get(0).fileName()); + Assertions.assertEquals("gw", model.files().get(0).content()); + Assertions.assertEquals(ContentEncoding.NONE, model.files().get(0).encoding()); + Assertions.assertEquals("v", model.files().get(0).path()); + Assertions.assertEquals("kbegibt", model.files().get(0).values().get("mxiebw")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterServiceConfig model = new ClusterServiceConfig().withComponent("rsa") + ClusterServiceConfig model = new ClusterServiceConfig().withComponent("xobbcswsrt") .withFiles(Arrays.asList( - new ClusterConfigFile().withFileName("wkuofoskghsauu").withContent("jmvxie") - .withEncoding(ContentEncoding.BASE64).withPath("idyjrrfbyaosvexc") - .withValues(mapOf("vleggzfbuhfmvfax", "pclhocohslk")), - new ClusterConfigFile().withFileName("ffeii").withContent("lvmezyvshxmzsbbz") - .withEncoding(ContentEncoding.BASE64).withPath("grxwbu") - .withValues(mapOf("enkouknvudw", "xxjnspydptk")))); + new ClusterConfigFile().withFileName("iplrbpbewtghfgb") + .withContent("gw") + .withEncoding(ContentEncoding.NONE) + .withPath("v") + .withValues(mapOf("mxiebw", "kbegibt", "gwyzm", "aloayqcgwrtzju", "mtsavjcbpwxqp", "txon", + "yvxqtayriwwroy", "rknftguvriuhprwm")), + new ClusterConfigFile().withFileName("bexrmcq") + .withContent("ycnojvknmefqsg") + .withEncoding(ContentEncoding.BASE64) + .withPath("apj") + .withValues(mapOf("lxkvu", "pvgqzcjrvxdjzlm", "n", "fhzovawjvzunluth")), + new ClusterConfigFile().withFileName("rnxipei") + .withContent("jzuaejxdultskzbb") + .withEncoding(ContentEncoding.NONE) + .withPath("mv") + .withValues(mapOf("zuhkfpbsjyof", "gpw", "us", "xl")))); model = BinaryData.fromObject(model).toObject(ClusterServiceConfig.class); - Assertions.assertEquals("rsa", model.component()); - Assertions.assertEquals("wkuofoskghsauu", model.files().get(0).fileName()); - Assertions.assertEquals("jmvxie", model.files().get(0).content()); - Assertions.assertEquals(ContentEncoding.BASE64, model.files().get(0).encoding()); - Assertions.assertEquals("idyjrrfbyaosvexc", model.files().get(0).path()); - Assertions.assertEquals("pclhocohslk", model.files().get(0).values().get("vleggzfbuhfmvfax")); + Assertions.assertEquals("xobbcswsrt", model.component()); + Assertions.assertEquals("iplrbpbewtghfgb", model.files().get(0).fileName()); + Assertions.assertEquals("gw", model.files().get(0).content()); + Assertions.assertEquals(ContentEncoding.NONE, model.files().get(0).encoding()); + Assertions.assertEquals("v", model.files().get(0).path()); + Assertions.assertEquals("kbegibt", model.files().get(0).values().get("mxiebw")); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigsProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigsProfileTests.java index 2f8e18d42b722..858b3a750de59 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigsProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterServiceConfigsProfileTests.java @@ -18,45 +18,88 @@ public final class ClusterServiceConfigsProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterServiceConfigsProfile model = BinaryData.fromString( - "{\"serviceName\":\"nvowgujju\",\"configs\":[{\"component\":\"dkcglhsl\",\"files\":[{\"fileName\":\"jdyggdtji\",\"content\":\"b\",\"encoding\":\"None\",\"path\":\"qweykhmenev\",\"values\":{\"ybcibvyvdcsit\":\"xfw\",\"eypvhezrkg\":\"nnaamdectehfiqsc\"}}]},{\"component\":\"hcjrefovgmk\",\"files\":[{\"fileName\":\"leyyvx\",\"content\":\"jpkcattpng\",\"encoding\":\"None\",\"path\":\"czsqpjhvm\",\"values\":{\"ysou\":\"v\",\"canoaeupf\":\"q\",\"tuo\":\"yhltrpmopjmcm\"}}]},{\"component\":\"thfuiuaodsfcpkvx\",\"files\":[{\"fileName\":\"puozmyzydag\",\"content\":\"axbezyiuo\",\"encoding\":\"None\",\"path\":\"hrdxwzywqsmbs\",\"values\":{\"ryocfsfksymdd\":\"xim\"}},{\"fileName\":\"stkiiuxhqyud\",\"content\":\"rrqnbpoczvyifqrv\",\"encoding\":\"None\",\"path\":\"sllr\",\"values\":{\"watkpnpulexxb\":\"d\",\"yokacspkw\":\"zwtruwiqzbqjvsov\",\"rkcciwwzjuqk\":\"hzdobpxjmflbvvnc\"}}]}]}") + "{\"serviceName\":\"d\",\"configs\":[{\"component\":\"avxbniwdjswztsdb\",\"files\":[{\"fileName\":\"nxytxh\",\"content\":\"xbzpfzab\",\"encoding\":\"Base64\",\"path\":\"hxw\",\"values\":{\"vgyuguos\":\"yqiklbbovplwzb\"}},{\"fileName\":\"mkfssxqukkfplgm\",\"content\":\"xnkjzkdesl\",\"encoding\":\"Base64\",\"path\":\"pwiyig\",\"values\":{\"upedeojnabckhs\":\"kdwzbaiuebbaumny\",\"ie\":\"txp\"}},{\"fileName\":\"tfhvpesapskrdqmh\",\"content\":\"dhtldwkyz\",\"encoding\":\"Base64\",\"path\":\"kn\",\"values\":{\"wrupqsxvnmicykvc\":\"cwsvlxotog\",\"eil\":\"o\"}}]},{\"component\":\"vnotyfjfcnj\",\"files\":[{\"fileName\":\"cn\",\"content\":\"hbttkphyw\",\"encoding\":\"None\",\"path\":\"t\",\"values\":{\"abgy\":\"ermclfplphoxuscr\",\"qugxywpmueefjzwf\":\"psbjta\"}}]},{\"component\":\"kqujidsuyono\",\"files\":[{\"fileName\":\"laocqxtccmg\",\"content\":\"dxyt\",\"encoding\":\"None\",\"path\":\"rxv\",\"values\":{\"zntxhdz\":\"dw\"}},{\"fileName\":\"lrqjbhckfr\",\"content\":\"rxsbkyvp\",\"encoding\":\"None\",\"path\":\"uzbpzkafku\",\"values\":{\"ehhseyvjusrts\":\"rnwb\",\"mx\":\"hspkdeemao\"}}]},{\"component\":\"gkvtmelmqkrhah\",\"files\":[{\"fileName\":\"juahaquhcdhmdual\",\"content\":\"xqpvfadmw\",\"encoding\":\"None\",\"path\":\"gvxp\",\"values\":{\"b\":\"mzlfmisgwb\",\"dawkzbali\":\"e\"}},{\"fileName\":\"urqhaka\",\"content\":\"ashsfwxos\",\"encoding\":\"Base64\",\"path\":\"cugicjoox\",\"values\":{\"euecivyhzceuoj\":\"bwpucwwfvovbv\",\"dytdxwitx\":\"jrwjueiotwm\",\"qwgxhniskx\":\"rjaw\"}},{\"fileName\":\"bkpyc\",\"content\":\"lwn\",\"encoding\":\"None\",\"path\":\"dauwhvylwzbtd\",\"values\":{\"pow\":\"jznb\",\"qlveualupjmkh\":\"wpr\"}}]}]}") .toObject(ClusterServiceConfigsProfile.class); - Assertions.assertEquals("nvowgujju", model.serviceName()); - Assertions.assertEquals("dkcglhsl", model.configs().get(0).component()); - Assertions.assertEquals("jdyggdtji", model.configs().get(0).files().get(0).fileName()); - Assertions.assertEquals("b", model.configs().get(0).files().get(0).content()); - Assertions.assertEquals(ContentEncoding.NONE, model.configs().get(0).files().get(0).encoding()); - Assertions.assertEquals("qweykhmenev", model.configs().get(0).files().get(0).path()); - Assertions.assertEquals("xfw", model.configs().get(0).files().get(0).values().get("ybcibvyvdcsit")); + Assertions.assertEquals("d", model.serviceName()); + Assertions.assertEquals("avxbniwdjswztsdb", model.configs().get(0).component()); + Assertions.assertEquals("nxytxh", model.configs().get(0).files().get(0).fileName()); + Assertions.assertEquals("xbzpfzab", model.configs().get(0).files().get(0).content()); + Assertions.assertEquals(ContentEncoding.BASE64, model.configs().get(0).files().get(0).encoding()); + Assertions.assertEquals("hxw", model.configs().get(0).files().get(0).path()); + Assertions.assertEquals("yqiklbbovplwzb", model.configs().get(0).files().get(0).values().get("vgyuguos")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterServiceConfigsProfile model = new ClusterServiceConfigsProfile().withServiceName("nvowgujju") - .withConfigs(Arrays.asList( - new ClusterServiceConfig().withComponent("dkcglhsl") - .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("jdyggdtji").withContent("b") - .withEncoding(ContentEncoding.NONE).withPath("qweykhmenev") - .withValues(mapOf("ybcibvyvdcsit", "xfw", "eypvhezrkg", "nnaamdectehfiqsc")))), - new ClusterServiceConfig().withComponent("hcjrefovgmk") - .withFiles(Arrays.asList(new ClusterConfigFile().withFileName("leyyvx").withContent("jpkcattpng") - .withEncoding(ContentEncoding.NONE).withPath("czsqpjhvm") - .withValues(mapOf("ysou", "v", "canoaeupf", "q", "tuo", "yhltrpmopjmcm")))), - new ClusterServiceConfig().withComponent("thfuiuaodsfcpkvx") - .withFiles(Arrays.asList( - new ClusterConfigFile().withFileName("puozmyzydag").withContent("axbezyiuo") - .withEncoding(ContentEncoding.NONE).withPath("hrdxwzywqsmbs") - .withValues(mapOf("ryocfsfksymdd", "xim")), - new ClusterConfigFile().withFileName("stkiiuxhqyud").withContent("rrqnbpoczvyifqrv") - .withEncoding(ContentEncoding.NONE).withPath("sllr").withValues(mapOf("watkpnpulexxb", "d", - "yokacspkw", "zwtruwiqzbqjvsov", "rkcciwwzjuqk", "hzdobpxjmflbvvnc")))))); + ClusterServiceConfigsProfile model + = new ClusterServiceConfigsProfile().withServiceName("d") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig().withComponent("avxbniwdjswztsdb") + .withFiles(Arrays.asList( + new ClusterConfigFile().withFileName("nxytxh") + .withContent("xbzpfzab") + .withEncoding(ContentEncoding.BASE64) + .withPath("hxw") + .withValues(mapOf("vgyuguos", "yqiklbbovplwzb")), + new ClusterConfigFile().withFileName("mkfssxqukkfplgm") + .withContent("xnkjzkdesl") + .withEncoding(ContentEncoding.BASE64) + .withPath("pwiyig") + .withValues(mapOf("upedeojnabckhs", "kdwzbaiuebbaumny", "ie", "txp")), + new ClusterConfigFile().withFileName("tfhvpesapskrdqmh") + .withContent("dhtldwkyz") + .withEncoding(ContentEncoding.BASE64) + .withPath("kn") + .withValues(mapOf("wrupqsxvnmicykvc", "cwsvlxotog", "eil", "o")))), + new ClusterServiceConfig().withComponent("vnotyfjfcnj") + .withFiles( + Arrays + .asList(new ClusterConfigFile().withFileName("cn") + .withContent("hbttkphyw") + .withEncoding(ContentEncoding.NONE) + .withPath("t") + .withValues(mapOf("abgy", "ermclfplphoxuscr", "qugxywpmueefjzwf", + "psbjta")))), + new ClusterServiceConfig().withComponent("kqujidsuyono") + .withFiles(Arrays.asList( + new ClusterConfigFile().withFileName("laocqxtccmg") + .withContent("dxyt") + .withEncoding(ContentEncoding.NONE) + .withPath("rxv") + .withValues(mapOf("zntxhdz", "dw")), + new ClusterConfigFile().withFileName("lrqjbhckfr") + .withContent("rxsbkyvp") + .withEncoding(ContentEncoding.NONE) + .withPath("uzbpzkafku") + .withValues(mapOf("ehhseyvjusrts", "rnwb", "mx", "hspkdeemao")))), + new ClusterServiceConfig().withComponent("gkvtmelmqkrhah") + .withFiles(Arrays.asList( + new ClusterConfigFile().withFileName("juahaquhcdhmdual") + .withContent("xqpvfadmw") + .withEncoding(ContentEncoding.NONE) + .withPath("gvxp") + .withValues(mapOf("b", "mzlfmisgwb", "dawkzbali", "e")), + new ClusterConfigFile().withFileName("urqhaka") + .withContent("ashsfwxos") + .withEncoding(ContentEncoding.BASE64) + .withPath("cugicjoox") + .withValues(mapOf("euecivyhzceuoj", "bwpucwwfvovbv", "dytdxwitx", "jrwjueiotwm", + "qwgxhniskx", "rjaw")), + new ClusterConfigFile().withFileName("bkpyc") + .withContent("lwn") + .withEncoding(ContentEncoding.NONE) + .withPath("dauwhvylwzbtd") + .withValues(mapOf("pow", "jznb", "qlveualupjmkh", "wpr")))))); model = BinaryData.fromObject(model).toObject(ClusterServiceConfigsProfile.class); - Assertions.assertEquals("nvowgujju", model.serviceName()); - Assertions.assertEquals("dkcglhsl", model.configs().get(0).component()); - Assertions.assertEquals("jdyggdtji", model.configs().get(0).files().get(0).fileName()); - Assertions.assertEquals("b", model.configs().get(0).files().get(0).content()); - Assertions.assertEquals(ContentEncoding.NONE, model.configs().get(0).files().get(0).encoding()); - Assertions.assertEquals("qweykhmenev", model.configs().get(0).files().get(0).path()); - Assertions.assertEquals("xfw", model.configs().get(0).files().get(0).values().get("ybcibvyvdcsit")); + Assertions.assertEquals("d", model.serviceName()); + Assertions.assertEquals("avxbniwdjswztsdb", model.configs().get(0).component()); + Assertions.assertEquals("nxytxh", model.configs().get(0).files().get(0).fileName()); + Assertions.assertEquals("xbzpfzab", model.configs().get(0).files().get(0).content()); + Assertions.assertEquals(ContentEncoding.BASE64, model.configs().get(0).files().get(0).encoding()); + Assertions.assertEquals("hxw", model.configs().get(0).files().get(0).path()); + Assertions.assertEquals("yqiklbbovplwzb", model.configs().get(0).files().get(0).values().get("vgyuguos")); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListMockTests.java new file mode 100644 index 0000000000000..efca1fa409352 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoriesListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.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.containers.HDInsightContainersManager; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistory; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +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 ClusterUpgradeHistoriesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterUpgradeHistoryProperties\",\"utcTime\":\"reur\",\"upgradeResult\":\"Succeed\"},\"id\":\"fuarenlvhht\",\"name\":\"lnvnafvvkyfedev\",\"type\":\"bo\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.clusterUpgradeHistories() + .list("xhpdulontacnpqwt", "htuevrhrljy", "ogwxhnsduugwb", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("reur", response.iterator().next().properties().utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, + response.iterator().next().properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryInnerTests.java new file mode 100644 index 0000000000000..2ab6d8cabcbcd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryInnerTests.java @@ -0,0 +1,32 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeHistoryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeHistoryInner model = BinaryData.fromString( + "{\"properties\":{\"upgradeType\":\"ClusterUpgradeHistoryProperties\",\"utcTime\":\"tllxdyhgsyocogj\",\"upgradeResult\":\"Failed\"},\"id\":\"tbnnha\",\"name\":\"oocrkvcikhnv\",\"type\":\"amqgxqquezikyw\"}") + .toObject(ClusterUpgradeHistoryInner.class); + Assertions.assertEquals("tllxdyhgsyocogj", model.properties().utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.properties().upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeHistoryInner model = new ClusterUpgradeHistoryInner() + .withProperties(new ClusterUpgradeHistoryProperties().withUtcTime("tllxdyhgsyocogj") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED)); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeHistoryInner.class); + Assertions.assertEquals("tllxdyhgsyocogj", model.properties().utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, model.properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryListResultTests.java new file mode 100644 index 0000000000000..42e56f9d151dd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryListResultTests.java @@ -0,0 +1,40 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterUpgradeHistoryInner; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryListResult; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeHistoryListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeHistoryListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"upgradeType\":\"ClusterUpgradeHistoryProperties\",\"utcTime\":\"ioxiysuiizyn\",\"upgradeResult\":\"Failed\"},\"id\":\"yatrwy\",\"name\":\"q\",\"type\":\"ibzyhwitsmyp\"},{\"properties\":{\"upgradeType\":\"ClusterUpgradeHistoryProperties\",\"utcTime\":\"ynpcdpumnzgmwznm\",\"upgradeResult\":\"Failed\"},\"id\":\"knso\",\"name\":\"gj\",\"type\":\"xbldtlwwrlkdmtn\"}],\"nextLink\":\"ok\"}") + .toObject(ClusterUpgradeHistoryListResult.class); + Assertions.assertEquals("ioxiysuiizyn", model.value().get(0).properties().utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, + model.value().get(0).properties().upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeHistoryListResult model = new ClusterUpgradeHistoryListResult().withValue(Arrays.asList( + new ClusterUpgradeHistoryInner() + .withProperties(new ClusterUpgradeHistoryProperties().withUtcTime("ioxiysuiizyn") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED)), + new ClusterUpgradeHistoryInner() + .withProperties(new ClusterUpgradeHistoryProperties().withUtcTime("ynpcdpumnzgmwznm") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.FAILED)))); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeHistoryListResult.class); + Assertions.assertEquals("ioxiysuiizyn", model.value().get(0).properties().utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.FAILED, + model.value().get(0).properties().upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryPropertiesTests.java new file mode 100644 index 0000000000000..4ce08ad1223e1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeHistoryPropertiesTests.java @@ -0,0 +1,30 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryProperties; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeHistoryUpgradeResultType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeHistoryProperties model = BinaryData.fromString( + "{\"upgradeType\":\"ClusterUpgradeHistoryProperties\",\"utcTime\":\"gxk\",\"upgradeResult\":\"Succeed\"}") + .toObject(ClusterUpgradeHistoryProperties.class); + Assertions.assertEquals("gxk", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeHistoryProperties model = new ClusterUpgradeHistoryProperties().withUtcTime("gxk") + .withUpgradeResult(ClusterUpgradeHistoryUpgradeResultType.SUCCEED); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeHistoryProperties.class); + Assertions.assertEquals("gxk", model.utcTime()); + Assertions.assertEquals(ClusterUpgradeHistoryUpgradeResultType.SUCCEED, model.upgradeResult()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackPropertiesTests.java new file mode 100644 index 0000000000000..7304373ff53c6 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackPropertiesTests.java @@ -0,0 +1,26 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollbackProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeRollbackPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeRollbackProperties model = BinaryData.fromString("{\"upgradeHistory\":\"melwuipiccjz\"}") + .toObject(ClusterUpgradeRollbackProperties.class); + Assertions.assertEquals("melwuipiccjz", model.upgradeHistory()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeRollbackProperties model + = new ClusterUpgradeRollbackProperties().withUpgradeHistory("melwuipiccjz"); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeRollbackProperties.class); + Assertions.assertEquals("melwuipiccjz", model.upgradeHistory()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackTests.java new file mode 100644 index 0000000000000..e4a55b4e133e0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterUpgradeRollbackTests.java @@ -0,0 +1,27 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollback; +import com.azure.resourcemanager.hdinsight.containers.models.ClusterUpgradeRollbackProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpgradeRollbackTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpgradeRollback model = BinaryData.fromString("{\"properties\":{\"upgradeHistory\":\"la\"}}") + .toObject(ClusterUpgradeRollback.class); + Assertions.assertEquals("la", model.properties().upgradeHistory()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpgradeRollback model = new ClusterUpgradeRollback() + .withProperties(new ClusterUpgradeRollbackProperties().withUpgradeHistory("la")); + model = BinaryData.fromObject(model).toObject(ClusterUpgradeRollback.class); + Assertions.assertEquals("la", model.properties().upgradeHistory()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionInnerTests.java index e903c5afaeeb4..25b49454f1f81 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionInnerTests.java @@ -13,25 +13,28 @@ public final class ClusterVersionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterVersionInner model = BinaryData.fromString( - "{\"properties\":{\"clusterType\":\"v\",\"clusterVersion\":\"k\",\"ossVersion\":\"lqwjygvjayvblm\",\"clusterPoolVersion\":\"k\",\"isPreview\":true,\"components\":[{\"name\":\"vyhgs\",\"version\":\"byrqufeg\"}]},\"id\":\"vwz\",\"name\":\"bnhlmc\",\"type\":\"l\"}") + "{\"properties\":{\"clusterType\":\"goo\",\"clusterVersion\":\"kqfqjbvl\",\"ossVersion\":\"rfmluiqtq\",\"clusterPoolVersion\":\"avyvnqqyba\",\"isPreview\":true,\"components\":[{\"name\":\"jkqa\",\"version\":\"gzslesjcbhernnti\"},{\"name\":\"djc\",\"version\":\"quwrbehwag\"}]},\"id\":\"buffkmrqemvvhm\",\"name\":\"tdrjfutacoebj\",\"type\":\"ewzcjznmwcp\"}") .toObject(ClusterVersionInner.class); - Assertions.assertEquals("v", model.properties().clusterType()); - Assertions.assertEquals("k", model.properties().clusterVersion()); - Assertions.assertEquals("lqwjygvjayvblm", model.properties().ossVersion()); - Assertions.assertEquals("k", model.properties().clusterPoolVersion()); + Assertions.assertEquals("goo", model.properties().clusterType()); + Assertions.assertEquals("kqfqjbvl", model.properties().clusterVersion()); + Assertions.assertEquals("rfmluiqtq", model.properties().ossVersion()); + Assertions.assertEquals("avyvnqqyba", model.properties().clusterPoolVersion()); Assertions.assertEquals(true, model.properties().isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterVersionInner model = new ClusterVersionInner() - .withProperties(new ClusterVersionProperties().withClusterType("v").withClusterVersion("k") - .withOssVersion("lqwjygvjayvblm").withClusterPoolVersion("k").withIsPreview(true)); + ClusterVersionInner model + = new ClusterVersionInner().withProperties(new ClusterVersionProperties().withClusterType("goo") + .withClusterVersion("kqfqjbvl") + .withOssVersion("rfmluiqtq") + .withClusterPoolVersion("avyvnqqyba") + .withIsPreview(true)); model = BinaryData.fromObject(model).toObject(ClusterVersionInner.class); - Assertions.assertEquals("v", model.properties().clusterType()); - Assertions.assertEquals("k", model.properties().clusterVersion()); - Assertions.assertEquals("lqwjygvjayvblm", model.properties().ossVersion()); - Assertions.assertEquals("k", model.properties().clusterPoolVersion()); + Assertions.assertEquals("goo", model.properties().clusterType()); + Assertions.assertEquals("kqfqjbvl", model.properties().clusterVersion()); + Assertions.assertEquals("rfmluiqtq", model.properties().ossVersion()); + Assertions.assertEquals("avyvnqqyba", model.properties().clusterPoolVersion()); Assertions.assertEquals(true, model.properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionPropertiesTests.java index be17956b0389b..54b14d652968f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionPropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionPropertiesTests.java @@ -12,25 +12,27 @@ public final class ClusterVersionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterVersionProperties model = BinaryData.fromString( - "{\"clusterType\":\"ngitvgbmhrixkwm\",\"clusterVersion\":\"jejveg\",\"ossVersion\":\"bpnaixexccbdre\",\"clusterPoolVersion\":\"hcexdrrvqa\",\"isPreview\":true,\"components\":[{\"name\":\"pwijnhy\",\"version\":\"vfycxzb\"},{\"name\":\"oowvrv\",\"version\":\"gjqppy\"}]}") + "{\"clusterType\":\"uaadraufactkahzo\",\"clusterVersion\":\"jjziuxxpsh\",\"ossVersion\":\"e\",\"clusterPoolVersion\":\"lfg\",\"isPreview\":false,\"components\":[{\"name\":\"wdlenrdsut\",\"version\":\"bazpjuohmi\"},{\"name\":\"flnorwmduvwp\",\"version\":\"vxwmygd\"},{\"name\":\"gpqch\",\"version\":\"zepn\"}]}") .toObject(ClusterVersionProperties.class); - Assertions.assertEquals("ngitvgbmhrixkwm", model.clusterType()); - Assertions.assertEquals("jejveg", model.clusterVersion()); - Assertions.assertEquals("bpnaixexccbdre", model.ossVersion()); - Assertions.assertEquals("hcexdrrvqa", model.clusterPoolVersion()); - Assertions.assertEquals(true, model.isPreview()); + Assertions.assertEquals("uaadraufactkahzo", model.clusterType()); + Assertions.assertEquals("jjziuxxpsh", model.clusterVersion()); + Assertions.assertEquals("e", model.ossVersion()); + Assertions.assertEquals("lfg", model.clusterPoolVersion()); + Assertions.assertEquals(false, model.isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterVersionProperties model - = new ClusterVersionProperties().withClusterType("ngitvgbmhrixkwm").withClusterVersion("jejveg") - .withOssVersion("bpnaixexccbdre").withClusterPoolVersion("hcexdrrvqa").withIsPreview(true); + ClusterVersionProperties model = new ClusterVersionProperties().withClusterType("uaadraufactkahzo") + .withClusterVersion("jjziuxxpsh") + .withOssVersion("e") + .withClusterPoolVersion("lfg") + .withIsPreview(false); model = BinaryData.fromObject(model).toObject(ClusterVersionProperties.class); - Assertions.assertEquals("ngitvgbmhrixkwm", model.clusterType()); - Assertions.assertEquals("jejveg", model.clusterVersion()); - Assertions.assertEquals("bpnaixexccbdre", model.ossVersion()); - Assertions.assertEquals("hcexdrrvqa", model.clusterPoolVersion()); - Assertions.assertEquals(true, model.isPreview()); + Assertions.assertEquals("uaadraufactkahzo", model.clusterType()); + Assertions.assertEquals("jjziuxxpsh", model.clusterVersion()); + Assertions.assertEquals("e", model.ossVersion()); + Assertions.assertEquals("lfg", model.clusterPoolVersion()); + Assertions.assertEquals(false, model.isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionsListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionsListResultTests.java index 893c203b5bd82..677dd123e1860 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionsListResultTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClusterVersionsListResultTests.java @@ -15,29 +15,33 @@ public final class ClusterVersionsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterVersionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"clusterType\":\"vyqia\",\"clusterVersion\":\"zwpcnpwzcjaesg\",\"ossVersion\":\"sccyajguqf\",\"clusterPoolVersion\":\"ygz\",\"isPreview\":false,\"components\":[{\"name\":\"xu\",\"version\":\"mdwzrmuhapfcqdps\"}]},\"id\":\"qvpsvuoymg\",\"name\":\"celve\",\"type\":\"rypqlmfeo\"},{\"properties\":{\"clusterType\":\"qwkyhkobop\",\"clusterVersion\":\"edkowepbqpcrfk\",\"ossVersion\":\"ccsnjvcdwxlpq\",\"clusterPoolVersion\":\"ftnkhtj\",\"isPreview\":false,\"components\":[{\"name\":\"fq\",\"version\":\"mtdh\"},{\"name\":\"dvypgikdgsz\",\"version\":\"kbir\"}]},\"id\":\"uzhlhkjoqrv\",\"name\":\"qaatjinrv\",\"type\":\"oupmfii\"}],\"nextLink\":\"ggjioolvr\"}") + "{\"value\":[{\"properties\":{\"clusterType\":\"fzg\",\"clusterVersion\":\"jdftuljltd\",\"ossVersion\":\"eamtmcz\",\"clusterPoolVersion\":\"m\",\"isPreview\":false,\"components\":[{\"name\":\"qioknssxmojm\",\"version\":\"p\"}]},\"id\":\"prvkwcfzqljyxgtc\",\"name\":\"heyd\",\"type\":\"sdshmkxmaehvb\"},{\"properties\":{\"clusterType\":\"ripltf\",\"clusterVersion\":\"tbaxk\",\"ossVersion\":\"ywrckp\",\"clusterPoolVersion\":\"lyhpluodpvruud\",\"isPreview\":false,\"components\":[{\"name\":\"hostgktstvdxecl\",\"version\":\"dqbcvhzlhplod\"}]},\"id\":\"dlwwqfbumlkxt\",\"name\":\"qjfsmlmbtxhw\",\"type\":\"fwsrtawcoezbrhu\"}],\"nextLink\":\"kh\"}") .toObject(ClusterVersionsListResult.class); - Assertions.assertEquals("vyqia", model.value().get(0).properties().clusterType()); - Assertions.assertEquals("zwpcnpwzcjaesg", model.value().get(0).properties().clusterVersion()); - Assertions.assertEquals("sccyajguqf", model.value().get(0).properties().ossVersion()); - Assertions.assertEquals("ygz", model.value().get(0).properties().clusterPoolVersion()); + Assertions.assertEquals("fzg", model.value().get(0).properties().clusterType()); + Assertions.assertEquals("jdftuljltd", model.value().get(0).properties().clusterVersion()); + Assertions.assertEquals("eamtmcz", model.value().get(0).properties().ossVersion()); + Assertions.assertEquals("m", model.value().get(0).properties().clusterPoolVersion()); Assertions.assertEquals(false, model.value().get(0).properties().isPreview()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClusterVersionsListResult model = new ClusterVersionsListResult().withValue(Arrays.asList( - new ClusterVersionInner().withProperties( - new ClusterVersionProperties().withClusterType("vyqia").withClusterVersion("zwpcnpwzcjaesg") - .withOssVersion("sccyajguqf").withClusterPoolVersion("ygz").withIsPreview(false)), - new ClusterVersionInner().withProperties( - new ClusterVersionProperties().withClusterType("qwkyhkobop").withClusterVersion("edkowepbqpcrfk") - .withOssVersion("ccsnjvcdwxlpq").withClusterPoolVersion("ftnkhtj").withIsPreview(false)))); + new ClusterVersionInner().withProperties(new ClusterVersionProperties().withClusterType("fzg") + .withClusterVersion("jdftuljltd") + .withOssVersion("eamtmcz") + .withClusterPoolVersion("m") + .withIsPreview(false)), + new ClusterVersionInner().withProperties(new ClusterVersionProperties().withClusterType("ripltf") + .withClusterVersion("tbaxk") + .withOssVersion("ywrckp") + .withClusterPoolVersion("lyhpluodpvruud") + .withIsPreview(false)))); model = BinaryData.fromObject(model).toObject(ClusterVersionsListResult.class); - Assertions.assertEquals("vyqia", model.value().get(0).properties().clusterType()); - Assertions.assertEquals("zwpcnpwzcjaesg", model.value().get(0).properties().clusterVersion()); - Assertions.assertEquals("sccyajguqf", model.value().get(0).properties().ossVersion()); - Assertions.assertEquals("ygz", model.value().get(0).properties().clusterPoolVersion()); + Assertions.assertEquals("fzg", model.value().get(0).properties().clusterType()); + Assertions.assertEquals("jdftuljltd", model.value().get(0).properties().clusterVersion()); + Assertions.assertEquals("eamtmcz", model.value().get(0).properties().ossVersion()); + Assertions.assertEquals("m", model.value().get(0).properties().clusterPoolVersion()); Assertions.assertEquals(false, model.value().get(0).properties().isPreview()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteMockTests.java index f5614d90d1906..8bd1117a7b6cd 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersDeleteMockTests.java @@ -6,46 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClustersDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.clusters().delete("wpfaj", "jwltlwtjjgu", "talhsnvkcdmxzr", com.azure.core.util.Context.NONE); + manager.clusters().delete("jqlafcbahhpzp", "foiyjwpfilk", "kkholvdndvia", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewWithResponseMockTests.java index 5ec4cebfa7435..92f9b68ac5753 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewWithResponseMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersGetInstanceViewWithResponseMockTests.java @@ -6,58 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewResult; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClustersGetInstanceViewWithResponseMockTests { @Test public void testGetInstanceViewWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"name\":\"ypoh\",\"properties\":{\"status\":{\"ready\":\"uemsly\",\"reason\":\"qyrp\",\"message\":\"obrltt\"},\"serviceStatuses\":[{\"kind\":\"sjnygqdnfwqzdzgt\",\"ready\":\"la\",\"message\":\"nfhqlyvijouwivk\"},{\"kind\":\"oyzunbixxr\",\"ready\":\"ikvcpwp\",\"message\":\"lrcivtsoxfrke\"},{\"kind\":\"xpmyyefrpmpdnq\",\"ready\":\"skawaoqvmmb\",\"message\":\"qfr\"}]}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"name\":\"tu\",\"properties\":{\"status\":{\"ready\":\"o\",\"reason\":\"e\",\"message\":\"ncnwfepbnwgf\"},\"serviceStatuses\":[{\"kind\":\"jgcgbjbgdlfgtdys\",\"ready\":\"aquflqbctqha\",\"message\":\"jrwdkqz\"}]}}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); ClusterInstanceViewResult response = manager.clusters() - .getInstanceViewWithResponse("pmuneqsx", "mhfbuzjy", "hsasbhu", com.azure.core.util.Context.NONE) + .getInstanceViewWithResponse("hwpusxj", "aqehg", "dohzjq", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ypoh", response.name()); - Assertions.assertEquals("uemsly", response.properties().status().ready()); - Assertions.assertEquals("qyrp", response.properties().status().reason()); - Assertions.assertEquals("obrltt", response.properties().status().message()); - Assertions.assertEquals("sjnygqdnfwqzdzgt", response.properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("la", response.properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("nfhqlyvijouwivk", response.properties().serviceStatuses().get(0).message()); + Assertions.assertEquals("tu", response.name()); + Assertions.assertEquals("o", response.properties().status().ready()); + Assertions.assertEquals("e", response.properties().status().reason()); + Assertions.assertEquals("ncnwfepbnwgf", response.properties().status().message()); + Assertions.assertEquals("jgcgbjbgdlfgtdys", response.properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("aquflqbctqha", response.properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("jrwdkqz", response.properties().serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsMockTests.java index 9f2cecd2fe72c..e0a9b7fedf1d3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ClustersListInstanceViewsMockTests.java @@ -6,59 +6,41 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.ClusterInstanceViewResult; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ClustersListInstanceViewsMockTests { @Test public void testListInstanceViews() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"name\":\"tgguwpijrajcivmm\",\"properties\":{\"status\":{\"ready\":\"hfcf\",\"reason\":\"rxgkne\",\"message\":\"yinzqodfvpgs\"},\"serviceStatuses\":[{\"kind\":\"xgsg\",\"ready\":\"p\",\"message\":\"zdjtxvzflbqv\"},{\"kind\":\"aqvlgafcqusr\",\"ready\":\"vetnwsdtutn\",\"message\":\"duy\"},{\"kind\":\"vuzhyr\",\"ready\":\"ewipm\",\"message\":\"k\"},{\"kind\":\"xukuqgsj\",\"ready\":\"xundxgk\",\"message\":\"wzhhzjhfjmhvvmuv\"}]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"name\":\"ons\",\"properties\":{\"status\":{\"ready\":\"onwpnga\",\"reason\":\"n\",\"message\":\"xjawrt\"},\"serviceStatuses\":[{\"kind\":\"fjmyccxlzhco\",\"ready\":\"ovne\",\"message\":\"enlusfn\"},{\"kind\":\"dtjxtxrdcqt\",\"ready\":\"vidttgepuslvyjt\",\"message\":\"uwkasiz\"},{\"kind\":\"esfuught\",\"ready\":\"qfecjxeygtuhx\",\"message\":\"cbuewmrswnjlxuz\"}]}}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response - = manager.clusters().listInstanceViews("pxtgqscjav", "t", "uhdqazk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tgguwpijrajcivmm", response.iterator().next().name()); - Assertions.assertEquals("hfcf", response.iterator().next().properties().status().ready()); - Assertions.assertEquals("rxgkne", response.iterator().next().properties().status().reason()); - Assertions.assertEquals("yinzqodfvpgs", response.iterator().next().properties().status().message()); - Assertions.assertEquals("xgsg", response.iterator().next().properties().serviceStatuses().get(0).kind()); - Assertions.assertEquals("p", response.iterator().next().properties().serviceStatuses().get(0).ready()); - Assertions.assertEquals("zdjtxvzflbqv", - response.iterator().next().properties().serviceStatuses().get(0).message()); + PagedIterable response = manager.clusters() + .listInstanceViews("fjgtixrjvzuy", "urmlmuo", "olbauirop", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ons", response.iterator().next().name()); + Assertions.assertEquals("onwpnga", response.iterator().next().properties().status().ready()); + Assertions.assertEquals("n", response.iterator().next().properties().status().reason()); + Assertions.assertEquals("xjawrt", response.iterator().next().properties().status().message()); + Assertions.assertEquals("fjmyccxlzhco", + response.iterator().next().properties().serviceStatuses().get(0).kind()); + Assertions.assertEquals("ovne", response.iterator().next().properties().serviceStatuses().get(0).ready()); + Assertions.assertEquals("enlusfn", response.iterator().next().properties().serviceStatuses().get(0).message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComparisonRuleTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComparisonRuleTests.java index fe0b275b982ca..97efd8e36675f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComparisonRuleTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComparisonRuleTests.java @@ -12,18 +12,18 @@ public final class ComparisonRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ComparisonRule model = BinaryData.fromString("{\"operator\":\"lessThanOrEqual\",\"threshold\":22.792763}") + ComparisonRule model = BinaryData.fromString("{\"operator\":\"lessThan\",\"threshold\":38.544758}") .toObject(ComparisonRule.class); - Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, model.operator()); - Assertions.assertEquals(22.792763f, model.threshold()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.operator()); + Assertions.assertEquals(38.544758f, model.threshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ComparisonRule model - = new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN_OR_EQUAL).withThreshold(22.792763f); + = new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN).withThreshold(38.544758f); model = BinaryData.fromObject(model).toObject(ComparisonRule.class); - Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, model.operator()); - Assertions.assertEquals(22.792763f, model.threshold()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.operator()); + Assertions.assertEquals(38.544758f, model.threshold()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeProfileTests.java index 0fcae5dc2ce56..eea3345a7fbcb 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeProfileTests.java @@ -14,21 +14,27 @@ public final class ComputeProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ComputeProfile model = BinaryData.fromString( - "{\"nodes\":[{\"type\":\"zrvqdr\",\"vmSize\":\"bhj\",\"count\":792570944},{\"type\":\"igeho\",\"vmSize\":\"fbowskanyk\",\"count\":1937589018}]}") + "{\"nodes\":[{\"type\":\"dnfyhxdeoejzicwi\",\"vmSize\":\"sjttgzfbish\",\"count\":643021552},{\"type\":\"khaj\",\"vmSize\":\"eyeam\",\"count\":128550194},{\"type\":\"hagalpbuxwgipwh\",\"vmSize\":\"nowkgshw\",\"count\":248274393},{\"type\":\"kix\",\"vmSize\":\"bin\",\"count\":1868038426}],\"availabilityZones\":[\"ttmrywnuzoqf\",\"iyqzrnk\",\"qvyxlwhzlsicoho\",\"qnwvlrya\"]}") .toObject(ComputeProfile.class); - Assertions.assertEquals("zrvqdr", model.nodes().get(0).type()); - Assertions.assertEquals("bhj", model.nodes().get(0).vmSize()); - Assertions.assertEquals(792570944, model.nodes().get(0).count()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.nodes().get(0).type()); + Assertions.assertEquals("sjttgzfbish", model.nodes().get(0).vmSize()); + Assertions.assertEquals(643021552, model.nodes().get(0).count()); + Assertions.assertEquals("ttmrywnuzoqf", model.availabilityZones().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ComputeProfile model = new ComputeProfile() - .withNodes(Arrays.asList(new NodeProfile().withType("zrvqdr").withVmSize("bhj").withCount(792570944), - new NodeProfile().withType("igeho").withVmSize("fbowskanyk").withCount(1937589018))); + .withNodes(Arrays.asList( + new NodeProfile().withType("dnfyhxdeoejzicwi").withVmSize("sjttgzfbish").withCount(643021552), + new NodeProfile().withType("khaj").withVmSize("eyeam").withCount(128550194), + new NodeProfile().withType("hagalpbuxwgipwh").withVmSize("nowkgshw").withCount(248274393), + new NodeProfile().withType("kix").withVmSize("bin").withCount(1868038426))) + .withAvailabilityZones(Arrays.asList("ttmrywnuzoqf", "iyqzrnk", "qvyxlwhzlsicoho", "qnwvlrya")); model = BinaryData.fromObject(model).toObject(ComputeProfile.class); - Assertions.assertEquals("zrvqdr", model.nodes().get(0).type()); - Assertions.assertEquals("bhj", model.nodes().get(0).vmSize()); - Assertions.assertEquals(792570944, model.nodes().get(0).count()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.nodes().get(0).type()); + Assertions.assertEquals("sjttgzfbish", model.nodes().get(0).vmSize()); + Assertions.assertEquals(643021552, model.nodes().get(0).count()); + Assertions.assertEquals("ttmrywnuzoqf", model.availabilityZones().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeResourceDefinitionTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeResourceDefinitionTests.java index 167fce6b3c85b..37da6b3f388f4 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeResourceDefinitionTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ComputeResourceDefinitionTests.java @@ -11,18 +11,18 @@ public final class ComputeResourceDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ComputeResourceDefinition model = BinaryData.fromString("{\"cpu\":20.272476,\"memory\":6504833090063292182}") + ComputeResourceDefinition model = BinaryData.fromString("{\"cpu\":97.30686,\"memory\":2120097512911222232}") .toObject(ComputeResourceDefinition.class); - Assertions.assertEquals(20.272476f, model.cpu()); - Assertions.assertEquals(6504833090063292182L, model.memory()); + Assertions.assertEquals(97.30686f, model.cpu()); + Assertions.assertEquals(2120097512911222232L, model.memory()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ComputeResourceDefinition model - = new ComputeResourceDefinition().withCpu(20.272476f).withMemory(6504833090063292182L); + = new ComputeResourceDefinition().withCpu(97.30686f).withMemory(2120097512911222232L); model = BinaryData.fromObject(model).toObject(ComputeResourceDefinition.class); - Assertions.assertEquals(20.272476f, model.cpu()); - Assertions.assertEquals(6504833090063292182L, model.memory()); + Assertions.assertEquals(97.30686f, model.cpu()); + Assertions.assertEquals(2120097512911222232L, model.memory()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileTests.java index f57fa8643a89d..976b2541de038 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileTests.java @@ -15,27 +15,27 @@ public final class ConnectivityProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectivityProfile model = BinaryData.fromString( - "{\"web\":{\"fqdn\":\"jdeyeamdpha\",\"privateFqdn\":\"lpbuxwgipwhonowk\"},\"ssh\":[{\"endpoint\":\"wankixzbi\",\"privateSshEndpoint\":\"eputtmrywnuzoqf\"},{\"endpoint\":\"iyqzrnk\",\"privateSshEndpoint\":\"vyxlwhzlsicohoqq\"},{\"endpoint\":\"wvl\",\"privateSshEndpoint\":\"avwhheunm\"},{\"endpoint\":\"qhgyxzkonocukok\",\"privateSshEndpoint\":\"axuconuq\"}]}") + "{\"web\":{\"fqdn\":\"eli\",\"privateFqdn\":\"nr\"},\"ssh\":[{\"endpoint\":\"o\",\"privateSshEndpoint\":\"bnxknalaulppg\"},{\"endpoint\":\"dtpnapnyiropuhp\",\"privateSshEndpoint\":\"vpgylgqgitxmed\"},{\"endpoint\":\"v\",\"privateSshEndpoint\":\"lynqwwncwzzh\"}]}") .toObject(ConnectivityProfile.class); - Assertions.assertEquals("jdeyeamdpha", model.web().fqdn()); - Assertions.assertEquals("lpbuxwgipwhonowk", model.web().privateFqdn()); - Assertions.assertEquals("wankixzbi", model.ssh().get(0).endpoint()); - Assertions.assertEquals("eputtmrywnuzoqf", model.ssh().get(0).privateSshEndpoint()); + Assertions.assertEquals("eli", model.web().fqdn()); + Assertions.assertEquals("nr", model.web().privateFqdn()); + Assertions.assertEquals("o", model.ssh().get(0).endpoint()); + Assertions.assertEquals("bnxknalaulppg", model.ssh().get(0).privateSshEndpoint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectivityProfile model = new ConnectivityProfile() - .withWeb(new ConnectivityProfileWeb().withFqdn("jdeyeamdpha").withPrivateFqdn("lpbuxwgipwhonowk")) - .withSsh(Arrays.asList( - new SshConnectivityEndpoint().withEndpoint("wankixzbi").withPrivateSshEndpoint("eputtmrywnuzoqf"), - new SshConnectivityEndpoint().withEndpoint("iyqzrnk").withPrivateSshEndpoint("vyxlwhzlsicohoqq"), - new SshConnectivityEndpoint().withEndpoint("wvl").withPrivateSshEndpoint("avwhheunm"), - new SshConnectivityEndpoint().withEndpoint("qhgyxzkonocukok").withPrivateSshEndpoint("axuconuq"))); + ConnectivityProfile model + = new ConnectivityProfile().withWeb(new ConnectivityProfileWeb().withFqdn("eli").withPrivateFqdn("nr")) + .withSsh(Arrays.asList( + new SshConnectivityEndpoint().withEndpoint("o").withPrivateSshEndpoint("bnxknalaulppg"), + new SshConnectivityEndpoint().withEndpoint("dtpnapnyiropuhp") + .withPrivateSshEndpoint("vpgylgqgitxmed"), + new SshConnectivityEndpoint().withEndpoint("v").withPrivateSshEndpoint("lynqwwncwzzh"))); model = BinaryData.fromObject(model).toObject(ConnectivityProfile.class); - Assertions.assertEquals("jdeyeamdpha", model.web().fqdn()); - Assertions.assertEquals("lpbuxwgipwhonowk", model.web().privateFqdn()); - Assertions.assertEquals("wankixzbi", model.ssh().get(0).endpoint()); - Assertions.assertEquals("eputtmrywnuzoqf", model.ssh().get(0).privateSshEndpoint()); + Assertions.assertEquals("eli", model.web().fqdn()); + Assertions.assertEquals("nr", model.web().privateFqdn()); + Assertions.assertEquals("o", model.ssh().get(0).endpoint()); + Assertions.assertEquals("bnxknalaulppg", model.ssh().get(0).privateSshEndpoint()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileWebTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileWebTests.java index a2838b9fffbc3..934d0532bacf1 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileWebTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ConnectivityProfileWebTests.java @@ -12,16 +12,18 @@ public final class ConnectivityProfileWebTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectivityProfileWeb model - = BinaryData.fromString("{\"fqdn\":\"zf\",\"privateFqdn\":\"eyp\"}").toObject(ConnectivityProfileWeb.class); - Assertions.assertEquals("zf", model.fqdn()); - Assertions.assertEquals("eyp", model.privateFqdn()); + = BinaryData.fromString("{\"fqdn\":\"gktrmgucnapkte\",\"privateFqdn\":\"llwptfdy\"}") + .toObject(ConnectivityProfileWeb.class); + Assertions.assertEquals("gktrmgucnapkte", model.fqdn()); + Assertions.assertEquals("llwptfdy", model.privateFqdn()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectivityProfileWeb model = new ConnectivityProfileWeb().withFqdn("zf").withPrivateFqdn("eyp"); + ConnectivityProfileWeb model + = new ConnectivityProfileWeb().withFqdn("gktrmgucnapkte").withPrivateFqdn("llwptfdy"); model = BinaryData.fromObject(model).toObject(ConnectivityProfileWeb.class); - Assertions.assertEquals("zf", model.fqdn()); - Assertions.assertEquals("eyp", model.privateFqdn()); + Assertions.assertEquals("gktrmgucnapkte", model.fqdn()); + Assertions.assertEquals("llwptfdy", model.privateFqdn()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/DiskStorageProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/DiskStorageProfileTests.java index 4aeef5405d5ab..7bd0ef749d5cf 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/DiskStorageProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/DiskStorageProfileTests.java @@ -13,18 +13,18 @@ public final class DiskStorageProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DiskStorageProfile model - = BinaryData.fromString("{\"dataDiskSize\":1565866782,\"dataDiskType\":\"Standard_HDD_LRS\"}") + = BinaryData.fromString("{\"dataDiskSize\":220182660,\"dataDiskType\":\"Premium_SSD_LRS\"}") .toObject(DiskStorageProfile.class); - Assertions.assertEquals(1565866782, model.dataDiskSize()); - Assertions.assertEquals(DataDiskType.STANDARD_HDD_LRS, model.dataDiskType()); + Assertions.assertEquals(220182660, model.dataDiskSize()); + Assertions.assertEquals(DataDiskType.PREMIUM_SSD_LRS, model.dataDiskType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DiskStorageProfile model - = new DiskStorageProfile().withDataDiskSize(1565866782).withDataDiskType(DataDiskType.STANDARD_HDD_LRS); + = new DiskStorageProfile().withDataDiskSize(220182660).withDataDiskType(DataDiskType.PREMIUM_SSD_LRS); model = BinaryData.fromObject(model).toObject(DiskStorageProfile.class); - Assertions.assertEquals(1565866782, model.dataDiskSize()); - Assertions.assertEquals(DataDiskType.STANDARD_HDD_LRS, model.dataDiskType()); + Assertions.assertEquals(220182660, model.dataDiskSize()); + Assertions.assertEquals(DataDiskType.PREMIUM_SSD_LRS, model.dataDiskType()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobProfileTests.java index 9efe89f5782bc..3c672bca63186 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobProfileTests.java @@ -13,27 +13,30 @@ public final class FlinkJobProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FlinkJobProfile model = BinaryData.fromString( - "{\"jobJarDirectory\":\"aofmxagkvtme\",\"jarName\":\"mqkrhahvljuahaqu\",\"entryClass\":\"dhmdua\",\"args\":\"exq\",\"savePointName\":\"fadmws\",\"upgradeMode\":\"UPDATE\"}") + "{\"jobJarDirectory\":\"ohfwds\",\"jarName\":\"n\",\"entryClass\":\"ljuti\",\"args\":\"wacf\",\"savePointName\":\"dkzzewkfvhqcrail\",\"upgradeMode\":\"STATELESS_UPDATE\"}") .toObject(FlinkJobProfile.class); - Assertions.assertEquals("aofmxagkvtme", model.jobJarDirectory()); - Assertions.assertEquals("mqkrhahvljuahaqu", model.jarName()); - Assertions.assertEquals("dhmdua", model.entryClass()); - Assertions.assertEquals("exq", model.args()); - Assertions.assertEquals("fadmws", model.savePointName()); - Assertions.assertEquals(UpgradeMode.UPDATE, model.upgradeMode()); + Assertions.assertEquals("ohfwds", model.jobJarDirectory()); + Assertions.assertEquals("n", model.jarName()); + Assertions.assertEquals("ljuti", model.entryClass()); + Assertions.assertEquals("wacf", model.args()); + Assertions.assertEquals("dkzzewkfvhqcrail", model.savePointName()); + Assertions.assertEquals(UpgradeMode.STATELESS_UPDATE, model.upgradeMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FlinkJobProfile model = new FlinkJobProfile().withJobJarDirectory("aofmxagkvtme") - .withJarName("mqkrhahvljuahaqu").withEntryClass("dhmdua").withArgs("exq").withSavePointName("fadmws") - .withUpgradeMode(UpgradeMode.UPDATE); + FlinkJobProfile model = new FlinkJobProfile().withJobJarDirectory("ohfwds") + .withJarName("n") + .withEntryClass("ljuti") + .withArgs("wacf") + .withSavePointName("dkzzewkfvhqcrail") + .withUpgradeMode(UpgradeMode.STATELESS_UPDATE); model = BinaryData.fromObject(model).toObject(FlinkJobProfile.class); - Assertions.assertEquals("aofmxagkvtme", model.jobJarDirectory()); - Assertions.assertEquals("mqkrhahvljuahaqu", model.jarName()); - Assertions.assertEquals("dhmdua", model.entryClass()); - Assertions.assertEquals("exq", model.args()); - Assertions.assertEquals("fadmws", model.savePointName()); - Assertions.assertEquals(UpgradeMode.UPDATE, model.upgradeMode()); + Assertions.assertEquals("ohfwds", model.jobJarDirectory()); + Assertions.assertEquals("n", model.jarName()); + Assertions.assertEquals("ljuti", model.entryClass()); + Assertions.assertEquals("wacf", model.args()); + Assertions.assertEquals("dkzzewkfvhqcrail", model.savePointName()); + Assertions.assertEquals(UpgradeMode.STATELESS_UPDATE, model.upgradeMode()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobPropertiesTests.java index 7b45659f637c2..11f736eeca8d9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobPropertiesTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/FlinkJobPropertiesTests.java @@ -15,34 +15,41 @@ public final class FlinkJobPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FlinkJobProperties model = BinaryData.fromString( - "{\"jobType\":\"FlinkJob\",\"runId\":\"tronzmyhgfi\",\"jobName\":\"sxkm\",\"jobJarDirectory\":\"a\",\"jarName\":\"rrjreafxtsgu\",\"entryClass\":\"jglikkxwslolb\",\"args\":\"vuzlm\",\"savePointName\":\"elfk\",\"action\":\"SAVEPOINT\",\"flinkConfiguration\":{\"xeznoi\":\"rpw\"},\"jobId\":\"rnjwmw\",\"status\":\"nbsazejjoqkag\",\"jobOutput\":\"sxtta\",\"actionResult\":\"zxnfaaz\",\"lastSavePoint\":\"dtnkdmkq\"}") + "{\"jobType\":\"FlinkJob\",\"runId\":\"bzevwrd\",\"jobName\":\"fukuvsjcswsmystu\",\"jobJarDirectory\":\"qypfcv\",\"jarName\":\"rchpqbmfpjbabwid\",\"entryClass\":\"xsspuunnoxyhk\",\"args\":\"qddrihpfhoqcaae\",\"savePointName\":\"aomdjvlpjxx\",\"action\":\"START\",\"flinkConfiguration\":{\"zkdnc\":\"sgeivsiy\",\"wyrpgogtqxepnyl\":\"dxonbzoggculap\",\"tlvofq\":\"fuajly\"},\"jobId\":\"vfcibyfmowux\",\"status\":\"jpvd\",\"jobOutput\":\"fzwiivwzjbhyz\",\"actionResult\":\"jrkambtrnegvmnv\",\"lastSavePoint\":\"eqvldspast\"}") .toObject(FlinkJobProperties.class); - Assertions.assertEquals("tronzmyhgfi", model.runId()); - Assertions.assertEquals("sxkm", model.jobName()); - Assertions.assertEquals("a", model.jobJarDirectory()); - Assertions.assertEquals("rrjreafxtsgu", model.jarName()); - Assertions.assertEquals("jglikkxwslolb", model.entryClass()); - Assertions.assertEquals("vuzlm", model.args()); - Assertions.assertEquals("elfk", model.savePointName()); - Assertions.assertEquals(Action.SAVEPOINT, model.action()); - Assertions.assertEquals("rpw", model.flinkConfiguration().get("xeznoi")); + Assertions.assertEquals("bzevwrd", model.runId()); + Assertions.assertEquals("fukuvsjcswsmystu", model.jobName()); + Assertions.assertEquals("qypfcv", model.jobJarDirectory()); + Assertions.assertEquals("rchpqbmfpjbabwid", model.jarName()); + Assertions.assertEquals("xsspuunnoxyhk", model.entryClass()); + Assertions.assertEquals("qddrihpfhoqcaae", model.args()); + Assertions.assertEquals("aomdjvlpjxx", model.savePointName()); + Assertions.assertEquals(Action.START, model.action()); + Assertions.assertEquals("sgeivsiy", model.flinkConfiguration().get("zkdnc")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FlinkJobProperties model = new FlinkJobProperties().withRunId("tronzmyhgfi").withJobName("sxkm") - .withJobJarDirectory("a").withJarName("rrjreafxtsgu").withEntryClass("jglikkxwslolb").withArgs("vuzlm") - .withSavePointName("elfk").withAction(Action.SAVEPOINT).withFlinkConfiguration(mapOf("xeznoi", "rpw")); + FlinkJobProperties model = new FlinkJobProperties().withRunId("bzevwrd") + .withJobName("fukuvsjcswsmystu") + .withJobJarDirectory("qypfcv") + .withJarName("rchpqbmfpjbabwid") + .withEntryClass("xsspuunnoxyhk") + .withArgs("qddrihpfhoqcaae") + .withSavePointName("aomdjvlpjxx") + .withAction(Action.START) + .withFlinkConfiguration( + mapOf("zkdnc", "sgeivsiy", "wyrpgogtqxepnyl", "dxonbzoggculap", "tlvofq", "fuajly")); model = BinaryData.fromObject(model).toObject(FlinkJobProperties.class); - Assertions.assertEquals("tronzmyhgfi", model.runId()); - Assertions.assertEquals("sxkm", model.jobName()); - Assertions.assertEquals("a", model.jobJarDirectory()); - Assertions.assertEquals("rrjreafxtsgu", model.jarName()); - Assertions.assertEquals("jglikkxwslolb", model.entryClass()); - Assertions.assertEquals("vuzlm", model.args()); - Assertions.assertEquals("elfk", model.savePointName()); - Assertions.assertEquals(Action.SAVEPOINT, model.action()); - Assertions.assertEquals("rpw", model.flinkConfiguration().get("xeznoi")); + Assertions.assertEquals("bzevwrd", model.runId()); + Assertions.assertEquals("fukuvsjcswsmystu", model.jobName()); + Assertions.assertEquals("qypfcv", model.jobJarDirectory()); + Assertions.assertEquals("rchpqbmfpjbabwid", model.jarName()); + Assertions.assertEquals("xsspuunnoxyhk", model.entryClass()); + Assertions.assertEquals("qddrihpfhoqcaae", model.args()); + Assertions.assertEquals("aomdjvlpjxx", model.savePointName()); + Assertions.assertEquals(Action.START, model.action()); + Assertions.assertEquals("sgeivsiy", model.flinkConfiguration().get("zkdnc")); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IdentityProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IdentityProfileTests.java index fdfbca1d66207..cb15f57168ca8 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IdentityProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IdentityProfileTests.java @@ -12,20 +12,22 @@ public final class IdentityProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IdentityProfile model = BinaryData - .fromString("{\"msiResourceId\":\"dphlxaolt\",\"msiClientId\":\"qtrgqjbpfzfsinzg\",\"msiObjectId\":\"f\"}") + .fromString( + "{\"msiResourceId\":\"yqduujit\",\"msiClientId\":\"jczdzevndh\",\"msiObjectId\":\"rwpdappdsbdkvwrw\"}") .toObject(IdentityProfile.class); - Assertions.assertEquals("dphlxaolt", model.msiResourceId()); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.msiClientId()); - Assertions.assertEquals("f", model.msiObjectId()); + Assertions.assertEquals("yqduujit", model.msiResourceId()); + Assertions.assertEquals("jczdzevndh", model.msiClientId()); + Assertions.assertEquals("rwpdappdsbdkvwrw", model.msiObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IdentityProfile model = new IdentityProfile().withMsiResourceId("dphlxaolt").withMsiClientId("qtrgqjbpfzfsinzg") - .withMsiObjectId("f"); + IdentityProfile model = new IdentityProfile().withMsiResourceId("yqduujit") + .withMsiClientId("jczdzevndh") + .withMsiObjectId("rwpdappdsbdkvwrw"); model = BinaryData.fromObject(model).toObject(IdentityProfile.class); - Assertions.assertEquals("dphlxaolt", model.msiResourceId()); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.msiClientId()); - Assertions.assertEquals("f", model.msiObjectId()); + Assertions.assertEquals("yqduujit", model.msiResourceId()); + Assertions.assertEquals("jczdzevndh", model.msiClientId()); + Assertions.assertEquals("rwpdappdsbdkvwrw", model.msiObjectId()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IpTagTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IpTagTests.java new file mode 100644 index 0000000000000..8f7a96ec0b5dc --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/IpTagTests.java @@ -0,0 +1,26 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.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\":\"jrwzox\",\"tag\":\"j\"}").toObject(IpTag.class); + Assertions.assertEquals("jrwzox", model.ipTagType()); + Assertions.assertEquals("j", model.tag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpTag model = new IpTag().withIpTagType("jrwzox").withTag("j"); + model = BinaryData.fromObject(model).toObject(IpTag.class); + Assertions.assertEquals("jrwzox", model.ipTagType()); + Assertions.assertEquals("j", model.tag()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaConnectivityEndpointsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaConnectivityEndpointsTests.java index 6fbb297f8fe7a..67d6755765154 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaConnectivityEndpointsTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaConnectivityEndpointsTests.java @@ -12,19 +12,19 @@ public final class KafkaConnectivityEndpointsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - KafkaConnectivityEndpoints model - = BinaryData.fromString("{\"bootstrapServerEndpoint\":\"qik\",\"brokerEndpoints\":[\"ovplw\",\"bhvgy\"]}") - .toObject(KafkaConnectivityEndpoints.class); - Assertions.assertEquals("qik", model.bootstrapServerEndpoint()); - Assertions.assertEquals("ovplw", model.brokerEndpoints().get(0)); + KafkaConnectivityEndpoints model = BinaryData.fromString( + "{\"bootstrapServerEndpoint\":\"wyhzdx\",\"brokerEndpoints\":[\"dbzm\",\"vdfznudaodvxzb\",\"cblylpstdbhhxsr\",\"dzu\"]}") + .toObject(KafkaConnectivityEndpoints.class); + Assertions.assertEquals("wyhzdx", model.bootstrapServerEndpoint()); + Assertions.assertEquals("dbzm", model.brokerEndpoints().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - KafkaConnectivityEndpoints model = new KafkaConnectivityEndpoints().withBootstrapServerEndpoint("qik") - .withBrokerEndpoints(Arrays.asList("ovplw", "bhvgy")); + KafkaConnectivityEndpoints model = new KafkaConnectivityEndpoints().withBootstrapServerEndpoint("wyhzdx") + .withBrokerEndpoints(Arrays.asList("dbzm", "vdfznudaodvxzb", "cblylpstdbhhxsr", "dzu")); model = BinaryData.fromObject(model).toObject(KafkaConnectivityEndpoints.class); - Assertions.assertEquals("qik", model.bootstrapServerEndpoint()); - Assertions.assertEquals("ovplw", model.brokerEndpoints().get(0)); + Assertions.assertEquals("wyhzdx", model.bootstrapServerEndpoint()); + Assertions.assertEquals("dbzm", model.brokerEndpoints().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaProfileTests.java index 13c301831888d..09232310add02 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/KafkaProfileTests.java @@ -14,25 +14,27 @@ public final class KafkaProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { KafkaProfile model = BinaryData.fromString( - "{\"enableKRaft\":true,\"enablePublicEndpoints\":true,\"remoteStorageUri\":\"kzjancuxrhdwbav\",\"diskStorage\":{\"dataDiskSize\":1605187994,\"dataDiskType\":\"Premium_SSD_v2_LRS\"},\"clusterIdentity\":{\"msiResourceId\":\"wd\",\"msiClientId\":\"swzts\",\"msiObjectId\":\"bpg\"},\"connectivityEndpoints\":{\"bootstrapServerEndpoint\":\"txhp\",\"brokerEndpoints\":[\"zpfzabglc\",\"hxw\"]}}") + "{\"enableKRaft\":true,\"enablePublicEndpoints\":false,\"remoteStorageUri\":\"kthumaqolbgycdui\",\"diskStorage\":{\"dataDiskSize\":178501813,\"dataDiskType\":\"Premium_SSD_LRS\"},\"connectivityEndpoints\":{\"bootstrapServerEndpoint\":\"cym\",\"brokerEndpoints\":[\"l\",\"ssl\",\"lfmmdnbbglzpswi\"]}}") .toObject(KafkaProfile.class); Assertions.assertEquals(true, model.enableKRaft()); - Assertions.assertEquals(true, model.enablePublicEndpoints()); - Assertions.assertEquals("kzjancuxrhdwbav", model.remoteStorageUri()); - Assertions.assertEquals(1605187994, model.diskStorage().dataDiskSize()); - Assertions.assertEquals(DataDiskType.PREMIUM_SSD_V2_LRS, model.diskStorage().dataDiskType()); + Assertions.assertEquals(false, model.enablePublicEndpoints()); + Assertions.assertEquals("kthumaqolbgycdui", model.remoteStorageUri()); + Assertions.assertEquals(178501813, model.diskStorage().dataDiskSize()); + Assertions.assertEquals(DataDiskType.PREMIUM_SSD_LRS, model.diskStorage().dataDiskType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - KafkaProfile model = new KafkaProfile().withEnableKRaft(true).withEnablePublicEndpoints(true) - .withRemoteStorageUri("kzjancuxrhdwbav").withDiskStorage(new DiskStorageProfile() - .withDataDiskSize(1605187994).withDataDiskType(DataDiskType.PREMIUM_SSD_V2_LRS)); + KafkaProfile model = new KafkaProfile().withEnableKRaft(true) + .withEnablePublicEndpoints(false) + .withRemoteStorageUri("kthumaqolbgycdui") + .withDiskStorage( + new DiskStorageProfile().withDataDiskSize(178501813).withDataDiskType(DataDiskType.PREMIUM_SSD_LRS)); model = BinaryData.fromObject(model).toObject(KafkaProfile.class); Assertions.assertEquals(true, model.enableKRaft()); - Assertions.assertEquals(true, model.enablePublicEndpoints()); - Assertions.assertEquals("kzjancuxrhdwbav", model.remoteStorageUri()); - Assertions.assertEquals(1605187994, model.diskStorage().dataDiskSize()); - Assertions.assertEquals(DataDiskType.PREMIUM_SSD_V2_LRS, model.diskStorage().dataDiskType()); + Assertions.assertEquals(false, model.enablePublicEndpoints()); + Assertions.assertEquals("kthumaqolbgycdui", model.remoteStorageUri()); + Assertions.assertEquals(178501813, model.diskStorage().dataDiskSize()); + Assertions.assertEquals(DataDiskType.PREMIUM_SSD_LRS, model.diskStorage().dataDiskType()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LoadBasedConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LoadBasedConfigTests.java index 83d7da790868e..3c40af7c0a22f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LoadBasedConfigTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LoadBasedConfigTests.java @@ -17,50 +17,47 @@ public final class LoadBasedConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LoadBasedConfig model = BinaryData.fromString( - "{\"minNodes\":1358628547,\"maxNodes\":113016072,\"pollInterval\":393084907,\"cooldownPeriod\":1346758763,\"scalingRules\":[{\"actionType\":\"scaledown\",\"evaluationCount\":2142840160,\"scalingMetric\":\"fkts\",\"comparisonRule\":{\"operator\":\"greaterThanOrEqual\",\"threshold\":94.88104}},{\"actionType\":\"scaleup\",\"evaluationCount\":801364840,\"scalingMetric\":\"ocmnyyazttbtwwrq\",\"comparisonRule\":{\"operator\":\"greaterThanOrEqual\",\"threshold\":92.70088}},{\"actionType\":\"scaledown\",\"evaluationCount\":1640743814,\"scalingMetric\":\"kzywbiex\",\"comparisonRule\":{\"operator\":\"greaterThan\",\"threshold\":78.08101}},{\"actionType\":\"scaledown\",\"evaluationCount\":315634017,\"scalingMetric\":\"eaxib\",\"comparisonRule\":{\"operator\":\"greaterThan\",\"threshold\":67.12364}}]}") + "{\"minNodes\":385457826,\"maxNodes\":395045632,\"pollInterval\":1463995661,\"cooldownPeriod\":2026519653,\"scalingRules\":[{\"actionType\":\"scaledown\",\"evaluationCount\":948183907,\"scalingMetric\":\"rvnaenqpeh\",\"comparisonRule\":{\"operator\":\"lessThanOrEqual\",\"threshold\":15.866309}},{\"actionType\":\"scaleup\",\"evaluationCount\":895776000,\"scalingMetric\":\"gmifthnzd\",\"comparisonRule\":{\"operator\":\"lessThanOrEqual\",\"threshold\":6.8623724}}]}") .toObject(LoadBasedConfig.class); - Assertions.assertEquals(1358628547, model.minNodes()); - Assertions.assertEquals(113016072, model.maxNodes()); - Assertions.assertEquals(393084907, model.pollInterval()); - Assertions.assertEquals(1346758763, model.cooldownPeriod()); + Assertions.assertEquals(385457826, model.minNodes()); + Assertions.assertEquals(395045632, model.maxNodes()); + Assertions.assertEquals(1463995661, model.pollInterval()); + Assertions.assertEquals(2026519653, model.cooldownPeriod()); Assertions.assertEquals(ScaleActionType.SCALEDOWN, model.scalingRules().get(0).actionType()); - Assertions.assertEquals(2142840160, model.scalingRules().get(0).evaluationCount()); - Assertions.assertEquals("fkts", model.scalingRules().get(0).scalingMetric()); - Assertions.assertEquals(ComparisonOperator.GREATER_THAN_OR_EQUAL, + Assertions.assertEquals(948183907, model.scalingRules().get(0).evaluationCount()); + Assertions.assertEquals("rvnaenqpeh", model.scalingRules().get(0).scalingMetric()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, model.scalingRules().get(0).comparisonRule().operator()); - Assertions.assertEquals(94.88104f, model.scalingRules().get(0).comparisonRule().threshold()); + Assertions.assertEquals(15.866309f, model.scalingRules().get(0).comparisonRule().threshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LoadBasedConfig model - = new LoadBasedConfig().withMinNodes(1358628547).withMaxNodes(113016072).withPollInterval(393084907) - .withCooldownPeriod(1346758763).withScalingRules( - Arrays.asList( - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(2142840160) - .withScalingMetric("fkts") - .withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.GREATER_THAN_OR_EQUAL).withThreshold(94.88104f)), - new ScalingRule().withActionType(ScaleActionType.SCALEUP).withEvaluationCount(801364840) - .withScalingMetric("ocmnyyazttbtwwrq").withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.GREATER_THAN_OR_EQUAL).withThreshold(92.70088f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(1640743814) - .withScalingMetric("kzywbiex") - .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN) - .withThreshold(78.08101f)), - new ScalingRule().withActionType(ScaleActionType.SCALEDOWN).withEvaluationCount(315634017) - .withScalingMetric("eaxib").withComparisonRule(new ComparisonRule() - .withOperator(ComparisonOperator.GREATER_THAN).withThreshold(67.12364f)))); + LoadBasedConfig model = new LoadBasedConfig().withMinNodes(385457826) + .withMaxNodes(395045632) + .withPollInterval(1463995661) + .withCooldownPeriod(2026519653) + .withScalingRules(Arrays.asList( + new ScalingRule().withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(948183907) + .withScalingMetric("rvnaenqpeh") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN_OR_EQUAL) + .withThreshold(15.866309f)), + new ScalingRule().withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(895776000) + .withScalingMetric("gmifthnzd") + .withComparisonRule(new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN_OR_EQUAL) + .withThreshold(6.8623724f)))); model = BinaryData.fromObject(model).toObject(LoadBasedConfig.class); - Assertions.assertEquals(1358628547, model.minNodes()); - Assertions.assertEquals(113016072, model.maxNodes()); - Assertions.assertEquals(393084907, model.pollInterval()); - Assertions.assertEquals(1346758763, model.cooldownPeriod()); + Assertions.assertEquals(385457826, model.minNodes()); + Assertions.assertEquals(395045632, model.maxNodes()); + Assertions.assertEquals(1463995661, model.pollInterval()); + Assertions.assertEquals(2026519653, model.cooldownPeriod()); Assertions.assertEquals(ScaleActionType.SCALEDOWN, model.scalingRules().get(0).actionType()); - Assertions.assertEquals(2142840160, model.scalingRules().get(0).evaluationCount()); - Assertions.assertEquals("fkts", model.scalingRules().get(0).scalingMetric()); - Assertions.assertEquals(ComparisonOperator.GREATER_THAN_OR_EQUAL, + Assertions.assertEquals(948183907, model.scalingRules().get(0).evaluationCount()); + Assertions.assertEquals("rvnaenqpeh", model.scalingRules().get(0).scalingMetric()); + Assertions.assertEquals(ComparisonOperator.LESS_THAN_OR_EQUAL, model.scalingRules().get(0).comparisonRule().operator()); - Assertions.assertEquals(94.88104f, model.scalingRules().get(0).comparisonRule().threshold()); + Assertions.assertEquals(15.866309f, model.scalingRules().get(0).comparisonRule().threshold()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java index 4eeb0570143ca..f32832f3f26ca 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java @@ -6,55 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.NameAvailabilityParameters; import com.azure.resourcemanager.hdinsight.containers.models.NameAvailabilityResult; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LocationsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr = "{\"nameAvailable\":true,\"reason\":\"qbawpcbbnzqcykn\",\"message\":\"qofyuicdhzbdy\"}"; - String responseStr = "{\"nameAvailable\":true,\"reason\":\"vpdvjdhttzae\",\"message\":\"dxihc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); NameAvailabilityResult response = manager.locations() - .checkNameAvailabilityWithResponse("vyc", - new NameAvailabilityParameters().withName("dclxgc").withType("nfnw"), com.azure.core.util.Context.NONE) + .checkNameAvailabilityWithResponse("xnazpmkml", + new NameAvailabilityParameters().withName("evfxzopjhbzxlioh").withType("dd"), + com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("vpdvjdhttzae", response.reason()); - Assertions.assertEquals("dxihc", response.message()); + Assertions.assertEquals("qbawpcbbnzqcykn", response.reason()); + Assertions.assertEquals("qofyuicdhzbdy", response.message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentityProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentityProfileTests.java new file mode 100644 index 0000000000000..30bcabec0ffc6 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentityProfileTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityProfile; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentitySpec; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ManagedIdentityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedIdentityProfile model = BinaryData.fromString( + "{\"identityList\":[{\"type\":\"user\",\"resourceId\":\"ik\",\"clientId\":\"drgvtqagn\",\"objectId\":\"uynhijg\"},{\"type\":\"user\",\"resourceId\":\"ebf\",\"clientId\":\"iarbutrcvpna\",\"objectId\":\"zmhjrunmp\"},{\"type\":\"user\",\"resourceId\":\"tdbhrbnla\",\"clientId\":\"kx\",\"objectId\":\"yskpbhen\"}]}") + .toObject(ManagedIdentityProfile.class); + Assertions.assertEquals(ManagedIdentityType.USER, model.identityList().get(0).type()); + Assertions.assertEquals("ik", model.identityList().get(0).resourceId()); + Assertions.assertEquals("drgvtqagn", model.identityList().get(0).clientId()); + Assertions.assertEquals("uynhijg", model.identityList().get(0).objectId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedIdentityProfile model = new ManagedIdentityProfile().withIdentityList(Arrays.asList( + new ManagedIdentitySpec().withType(ManagedIdentityType.USER) + .withResourceId("ik") + .withClientId("drgvtqagn") + .withObjectId("uynhijg"), + new ManagedIdentitySpec().withType(ManagedIdentityType.USER) + .withResourceId("ebf") + .withClientId("iarbutrcvpna") + .withObjectId("zmhjrunmp"), + new ManagedIdentitySpec().withType(ManagedIdentityType.USER) + .withResourceId("tdbhrbnla") + .withClientId("kx") + .withObjectId("yskpbhen"))); + model = BinaryData.fromObject(model).toObject(ManagedIdentityProfile.class); + Assertions.assertEquals(ManagedIdentityType.USER, model.identityList().get(0).type()); + Assertions.assertEquals("ik", model.identityList().get(0).resourceId()); + Assertions.assertEquals("drgvtqagn", model.identityList().get(0).clientId()); + Assertions.assertEquals("uynhijg", model.identityList().get(0).objectId()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentitySpecTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentitySpecTests.java new file mode 100644 index 0000000000000..b5ed9c8db3477 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ManagedIdentitySpecTests.java @@ -0,0 +1,37 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentitySpec; +import com.azure.resourcemanager.hdinsight.containers.models.ManagedIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedIdentitySpecTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedIdentitySpec model = BinaryData + .fromString( + "{\"type\":\"internal\",\"resourceId\":\"kcxywnyt\",\"clientId\":\"rsyn\",\"objectId\":\"qidybyx\"}") + .toObject(ManagedIdentitySpec.class); + Assertions.assertEquals(ManagedIdentityType.INTERNAL, model.type()); + Assertions.assertEquals("kcxywnyt", model.resourceId()); + Assertions.assertEquals("rsyn", model.clientId()); + Assertions.assertEquals("qidybyx", model.objectId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedIdentitySpec model = new ManagedIdentitySpec().withType(ManagedIdentityType.INTERNAL) + .withResourceId("kcxywnyt") + .withClientId("rsyn") + .withObjectId("qidybyx"); + model = BinaryData.fromObject(model).toObject(ManagedIdentitySpec.class); + Assertions.assertEquals(ManagedIdentityType.INTERNAL, model.type()); + Assertions.assertEquals("kcxywnyt", model.resourceId()); + Assertions.assertEquals("rsyn", model.clientId()); + Assertions.assertEquals("qidybyx", model.objectId()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/MavenLibraryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/MavenLibraryPropertiesTests.java new file mode 100644 index 0000000000000..cf66e9bd7914a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/MavenLibraryPropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.MavenLibraryProperties; +import org.junit.jupiter.api.Assertions; + +public final class MavenLibraryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MavenLibraryProperties model = BinaryData.fromString( + "{\"type\":\"maven\",\"groupId\":\"izxfpxt\",\"name\":\"qscjavftjuh\",\"version\":\"azkmtgguwp\",\"remarks\":\"r\",\"timestamp\":\"2021-11-12T08:33:33Z\",\"status\":\"INSTALLED\",\"message\":\"mghfcfiwrxgkne\"}") + .toObject(MavenLibraryProperties.class); + Assertions.assertEquals("r", model.remarks()); + Assertions.assertEquals("izxfpxt", model.groupId()); + Assertions.assertEquals("qscjavftjuh", model.name()); + Assertions.assertEquals("azkmtgguwp", model.version()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MavenLibraryProperties model = new MavenLibraryProperties().withRemarks("r") + .withGroupId("izxfpxt") + .withName("qscjavftjuh") + .withVersion("azkmtgguwp"); + model = BinaryData.fromObject(model).toObject(MavenLibraryProperties.class); + Assertions.assertEquals("r", model.remarks()); + Assertions.assertEquals("izxfpxt", model.groupId()); + Assertions.assertEquals("qscjavftjuh", model.name()); + Assertions.assertEquals("azkmtgguwp", model.version()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityParametersTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityParametersTests.java index 8324673f6a2e7..dce6426513a80 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityParametersTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityParametersTests.java @@ -11,17 +11,18 @@ public final class NameAvailabilityParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NameAvailabilityParameters model = BinaryData.fromString("{\"name\":\"xitc\",\"type\":\"fcktqumiekke\"}") + NameAvailabilityParameters model = BinaryData.fromString("{\"name\":\"tkzwpcnpwzc\",\"type\":\"esgvvsccyaj\"}") .toObject(NameAvailabilityParameters.class); - Assertions.assertEquals("xitc", model.name()); - Assertions.assertEquals("fcktqumiekke", model.type()); + Assertions.assertEquals("tkzwpcnpwzc", model.name()); + Assertions.assertEquals("esgvvsccyaj", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameAvailabilityParameters model = new NameAvailabilityParameters().withName("xitc").withType("fcktqumiekke"); + NameAvailabilityParameters model + = new NameAvailabilityParameters().withName("tkzwpcnpwzc").withType("esgvvsccyaj"); model = BinaryData.fromObject(model).toObject(NameAvailabilityParameters.class); - Assertions.assertEquals("xitc", model.name()); - Assertions.assertEquals("fcktqumiekke", model.type()); + Assertions.assertEquals("tkzwpcnpwzc", model.name()); + Assertions.assertEquals("esgvvsccyaj", model.type()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityResultInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityResultInnerTests.java index a54e9f8b6bfb5..64ffc670b3e32 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityResultInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NameAvailabilityResultInnerTests.java @@ -12,20 +12,20 @@ public final class NameAvailabilityResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityResultInner model - = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"hlyfjhdgqgg\",\"message\":\"dunyg\"}") + = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"hwyg\",\"message\":\"vdnkfxusem\"}") .toObject(NameAvailabilityResultInner.class); Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("hlyfjhdgqgg", model.reason()); - Assertions.assertEquals("dunyg", model.message()); + Assertions.assertEquals("hwyg", model.reason()); + Assertions.assertEquals("vdnkfxusem", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NameAvailabilityResultInner model - = new NameAvailabilityResultInner().withNameAvailable(false).withReason("hlyfjhdgqgg").withMessage("dunyg"); + = new NameAvailabilityResultInner().withNameAvailable(false).withReason("hwyg").withMessage("vdnkfxusem"); model = BinaryData.fromObject(model).toObject(NameAvailabilityResultInner.class); Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("hlyfjhdgqgg", model.reason()); - Assertions.assertEquals("dunyg", model.message()); + Assertions.assertEquals("hwyg", model.reason()); + Assertions.assertEquals("vdnkfxusem", model.message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NodeProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NodeProfileTests.java index ffd9181ec7775..b357d68c5c52f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NodeProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/NodeProfileTests.java @@ -11,20 +11,19 @@ public final class NodeProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NodeProfile model - = BinaryData.fromString("{\"type\":\"lcuiywgqywgndr\",\"vmSize\":\"ynhz\",\"count\":299078768}") - .toObject(NodeProfile.class); - Assertions.assertEquals("lcuiywgqywgndr", model.type()); - Assertions.assertEquals("ynhz", model.vmSize()); - Assertions.assertEquals(299078768, model.count()); + NodeProfile model = BinaryData.fromString("{\"type\":\"w\",\"vmSize\":\"heun\",\"count\":1346564492}") + .toObject(NodeProfile.class); + Assertions.assertEquals("w", model.type()); + Assertions.assertEquals("heun", model.vmSize()); + Assertions.assertEquals(1346564492, model.count()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NodeProfile model = new NodeProfile().withType("lcuiywgqywgndr").withVmSize("ynhz").withCount(299078768); + NodeProfile model = new NodeProfile().withType("w").withVmSize("heun").withCount(1346564492); model = BinaryData.fromObject(model).toObject(NodeProfile.class); - Assertions.assertEquals("lcuiywgqywgndr", model.type()); - Assertions.assertEquals("ynhz", model.vmSize()); - Assertions.assertEquals(299078768, model.count()); + Assertions.assertEquals("w", model.type()); + Assertions.assertEquals("heun", model.vmSize()); + Assertions.assertEquals(1346564492, model.count()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationDisplayTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationDisplayTests.java index 9c23942de42b6..a071ba3b79f67 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationDisplayTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationDisplayTests.java @@ -11,7 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"zeeyebi\",\"resource\":\"kayuhqlbjbs\",\"operation\":\"bqwrvtldgm\",\"description\":\"gvmpipaslthaqfx\"}") + "{\"provider\":\"jlihhyus\",\"resource\":\"kasdvlm\",\"operation\":\"dgzxulucvpamrsr\",\"description\":\"zvxurisjnhny\"}") .toObject(OperationDisplay.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationInnerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationInnerTests.java index 1799c7d442b63..7d40dfdaba33a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationInnerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationInnerTests.java @@ -12,7 +12,7 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"bibsystawfsdjpvk\",\"isDataAction\":true,\"display\":{\"provider\":\"bkzbzkd\",\"resource\":\"cjabudurgkakmo\",\"operation\":\"hjjklff\",\"description\":\"ouw\"},\"origin\":\"system\",\"actionType\":\"Internal\"}") + "{\"name\":\"mvzzbtdcqvp\",\"isDataAction\":true,\"display\":{\"provider\":\"viylwdshfssnrbgy\",\"resource\":\"rymsgaojfmw\",\"operation\":\"otmrfhir\",\"description\":\"ymoxoftpipiwyczu\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationListResultTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationListResultTests.java index 5c83ccc9d6028..499f684dc8819 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationListResultTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationListResultTests.java @@ -11,7 +11,7 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"lstvlzywe\",\"isDataAction\":false,\"display\":{\"provider\":\"csdtclusiypbs\",\"resource\":\"ytguslf\",\"operation\":\"dcygqukyhejhz\",\"description\":\"xgfpelolppv\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"ujzra\",\"isDataAction\":false,\"display\":{\"provider\":\"wrft\",\"resource\":\"iby\",\"operation\":\"dl\",\"description\":\"shfwpracstwity\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"cedcpnmdy\",\"isDataAction\":true,\"display\":{\"provider\":\"xltjcvnhltiu\",\"resource\":\"xnavvwxq\",\"operation\":\"y\",\"description\":\"nyowxwlmdjrkvfg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"bodacizsjq\",\"isDataAction\":true,\"display\":{\"provider\":\"ibdeibq\",\"resource\":\"qkgh\",\"operation\":\"ndzwmkrefa\",\"description\":\"jorwkqnyhgbij\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"zs\"}") + "{\"value\":[{\"name\":\"ydxtqm\",\"isDataAction\":false,\"display\":{\"provider\":\"rgguf\",\"resource\":\"aomtbghhavgrvkff\",\"operation\":\"jzhpjbibgjmfx\",\"description\":\"vfcluyovwxnbkfe\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"hwzdgirujbz\"}") .toObject(OperationListResult.class); } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListMockTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListMockTests.java index 6a1f37c5732f7..40a430991e202 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListMockTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/OperationsListMockTests.java @@ -6,45 +6,27 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hdinsight.containers.HDInsightContainersManager; import com.azure.resourcemanager.hdinsight.containers.models.Operation; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"name\":\"phkmcrjdqnsdfz\",\"isDataAction\":true,\"display\":{\"provider\":\"kylkdghrj\",\"resource\":\"utlwxezwzhok\",\"operation\":\"wnhhtqlgehgppip\",\"description\":\"hpfeoajvgcxtxjc\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"name\":\"wgbdvibidmhmwffp\",\"isDataAction\":false,\"display\":{\"provider\":\"apckccrrvw\",\"resource\":\"oxoyyukp\",\"operation\":\"immoiroqboshbrag\",\"description\":\"yyrmfsvbp\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - HDInsightContainersManager manager = HDInsightContainersManager.configure().withHttpClient(httpClient) + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HDInsightContainersManager manager = HDInsightContainersManager.configure() + .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/PyPiLibraryPropertiesTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/PyPiLibraryPropertiesTests.java new file mode 100644 index 0000000000000..55560c9128abb --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/PyPiLibraryPropertiesTests.java @@ -0,0 +1,31 @@ +// 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.containers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hdinsight.containers.models.PyPiLibraryProperties; +import org.junit.jupiter.api.Assertions; + +public final class PyPiLibraryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PyPiLibraryProperties model = BinaryData.fromString( + "{\"type\":\"pypi\",\"name\":\"wlyxgncxyk\",\"version\":\"djhlimm\",\"remarks\":\"x\",\"timestamp\":\"2021-11-18T02:45:39Z\",\"status\":\"UNINSTALL_FAILED\",\"message\":\"rxvxcjzh\"}") + .toObject(PyPiLibraryProperties.class); + Assertions.assertEquals("x", model.remarks()); + Assertions.assertEquals("wlyxgncxyk", model.name()); + Assertions.assertEquals("djhlimm", model.version()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PyPiLibraryProperties model + = new PyPiLibraryProperties().withRemarks("x").withName("wlyxgncxyk").withVersion("djhlimm"); + model = BinaryData.fromObject(model).toObject(PyPiLibraryProperties.class); + Assertions.assertEquals("x", model.remarks()); + Assertions.assertEquals("wlyxgncxyk", model.name()); + Assertions.assertEquals("djhlimm", model.version()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerAuditSpecTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerAuditSpecTests.java index 40bc14119788d..cbb48f8632cc9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerAuditSpecTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerAuditSpecTests.java @@ -11,15 +11,14 @@ public final class RangerAuditSpecTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RangerAuditSpec model - = BinaryData.fromString("{\"storageAccount\":\"zjuzgwyz\"}").toObject(RangerAuditSpec.class); - Assertions.assertEquals("zjuzgwyz", model.storageAccount()); + RangerAuditSpec model = BinaryData.fromString("{\"storageAccount\":\"vmkcx\"}").toObject(RangerAuditSpec.class); + Assertions.assertEquals("vmkcx", model.storageAccount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RangerAuditSpec model = new RangerAuditSpec().withStorageAccount("zjuzgwyz"); + RangerAuditSpec model = new RangerAuditSpec().withStorageAccount("vmkcx"); model = BinaryData.fromObject(model).toObject(RangerAuditSpec.class); - Assertions.assertEquals("zjuzgwyz", model.storageAccount()); + Assertions.assertEquals("vmkcx", model.storageAccount()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerUsersyncSpecTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerUsersyncSpecTests.java index 4c37113e7496a..64d48784d9fb9 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerUsersyncSpecTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/RangerUsersyncSpecTests.java @@ -14,25 +14,27 @@ public final class RangerUsersyncSpecTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RangerUsersyncSpec model = BinaryData.fromString( - "{\"enabled\":false,\"groups\":[\"ngmtsavjcb\",\"wxqpsrknftguvri\"],\"mode\":\"automatic\",\"userMappingLocation\":\"wmdyvxqtay\",\"users\":[\"wroyqbexrmcq\"]}") + "{\"enabled\":true,\"groups\":[\"helxprglya\",\"dd\",\"kcbcue\",\"rjxgciqib\"],\"mode\":\"static\",\"userMappingLocation\":\"xsdqrhzoymibmrqy\",\"users\":[\"hwflu\",\"zdtmhrkwofy\",\"voqacpiexpbt\",\"iwbwoenwashrtdtk\"]}") .toObject(RangerUsersyncSpec.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ngmtsavjcb", model.groups().get(0)); - Assertions.assertEquals(RangerUsersyncMode.AUTOMATIC, model.mode()); - Assertions.assertEquals("wmdyvxqtay", model.userMappingLocation()); - Assertions.assertEquals("wroyqbexrmcq", model.users().get(0)); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("helxprglya", model.groups().get(0)); + Assertions.assertEquals(RangerUsersyncMode.STATIC, model.mode()); + Assertions.assertEquals("xsdqrhzoymibmrqy", model.userMappingLocation()); + Assertions.assertEquals("hwflu", model.users().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RangerUsersyncSpec model = new RangerUsersyncSpec().withEnabled(false) - .withGroups(Arrays.asList("ngmtsavjcb", "wxqpsrknftguvri")).withMode(RangerUsersyncMode.AUTOMATIC) - .withUserMappingLocation("wmdyvxqtay").withUsers(Arrays.asList("wroyqbexrmcq")); + RangerUsersyncSpec model = new RangerUsersyncSpec().withEnabled(true) + .withGroups(Arrays.asList("helxprglya", "dd", "kcbcue", "rjxgciqib")) + .withMode(RangerUsersyncMode.STATIC) + .withUserMappingLocation("xsdqrhzoymibmrqy") + .withUsers(Arrays.asList("hwflu", "zdtmhrkwofy", "voqacpiexpbt", "iwbwoenwashrtdtk")); model = BinaryData.fromObject(model).toObject(RangerUsersyncSpec.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ngmtsavjcb", model.groups().get(0)); - Assertions.assertEquals(RangerUsersyncMode.AUTOMATIC, model.mode()); - Assertions.assertEquals("wmdyvxqtay", model.userMappingLocation()); - Assertions.assertEquals("wroyqbexrmcq", model.users().get(0)); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("helxprglya", model.groups().get(0)); + Assertions.assertEquals(RangerUsersyncMode.STATIC, model.mode()); + Assertions.assertEquals("xsdqrhzoymibmrqy", model.userMappingLocation()); + Assertions.assertEquals("hwflu", model.users().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScalingRuleTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScalingRuleTests.java index c900b594aeb50..654c05b718f93 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScalingRuleTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScalingRuleTests.java @@ -15,25 +15,27 @@ public final class ScalingRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScalingRule model = BinaryData.fromString( - "{\"actionType\":\"scaleup\",\"evaluationCount\":1281560612,\"scalingMetric\":\"hqwa\",\"comparisonRule\":{\"operator\":\"lessThan\",\"threshold\":44.0332}}") + "{\"actionType\":\"scaleup\",\"evaluationCount\":962281735,\"scalingMetric\":\"nayqi\",\"comparisonRule\":{\"operator\":\"greaterThanOrEqual\",\"threshold\":83.24161}}") .toObject(ScalingRule.class); Assertions.assertEquals(ScaleActionType.SCALEUP, model.actionType()); - Assertions.assertEquals(1281560612, model.evaluationCount()); - Assertions.assertEquals("hqwa", model.scalingMetric()); - Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.comparisonRule().operator()); - Assertions.assertEquals(44.0332f, model.comparisonRule().threshold()); + Assertions.assertEquals(962281735, model.evaluationCount()); + Assertions.assertEquals("nayqi", model.scalingMetric()); + Assertions.assertEquals(ComparisonOperator.GREATER_THAN_OR_EQUAL, model.comparisonRule().operator()); + Assertions.assertEquals(83.24161f, model.comparisonRule().threshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingRule model = new ScalingRule().withActionType(ScaleActionType.SCALEUP).withEvaluationCount(1281560612) - .withScalingMetric("hqwa").withComparisonRule( - new ComparisonRule().withOperator(ComparisonOperator.LESS_THAN).withThreshold(44.0332f)); + ScalingRule model = new ScalingRule().withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(962281735) + .withScalingMetric("nayqi") + .withComparisonRule( + new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN_OR_EQUAL).withThreshold(83.24161f)); model = BinaryData.fromObject(model).toObject(ScalingRule.class); Assertions.assertEquals(ScaleActionType.SCALEUP, model.actionType()); - Assertions.assertEquals(1281560612, model.evaluationCount()); - Assertions.assertEquals("hqwa", model.scalingMetric()); - Assertions.assertEquals(ComparisonOperator.LESS_THAN, model.comparisonRule().operator()); - Assertions.assertEquals(44.0332f, model.comparisonRule().threshold()); + Assertions.assertEquals(962281735, model.evaluationCount()); + Assertions.assertEquals("nayqi", model.scalingMetric()); + Assertions.assertEquals(ComparisonOperator.GREATER_THAN_OR_EQUAL, model.comparisonRule().operator()); + Assertions.assertEquals(83.24161f, model.comparisonRule().threshold()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleBasedConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleBasedConfigTests.java index 647e78ca4c980..71649d9d268ae 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleBasedConfigTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleBasedConfigTests.java @@ -15,32 +15,31 @@ public final class ScheduleBasedConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleBasedConfig model = BinaryData.fromString( - "{\"timeZone\":\"y\",\"defaultCount\":1035885378,\"schedules\":[{\"startTime\":\"bnuqqkpik\",\"endTime\":\"drgvtqagn\",\"count\":1873718862,\"days\":[\"Saturday\",\"Wednesday\",\"Wednesday\"]},{\"startTime\":\"jggmebfsiarbu\",\"endTime\":\"rcvpnazzmhjrunmp\",\"count\":185169787,\"days\":[\"Tuesday\",\"Friday\",\"Tuesday\"]},{\"startTime\":\"rbnlankxmyskp\",\"endTime\":\"henbtkcxywnytn\",\"count\":1863766018,\"days\":[\"Thursday\"]}]}") + "{\"timeZone\":\"bsrfbj\",\"defaultCount\":891212878,\"schedules\":[{\"startTime\":\"w\",\"endTime\":\"sotftpvj\",\"count\":1235013026,\"days\":[\"Tuesday\",\"Wednesday\",\"Monday\",\"Thursday\"]}]}") .toObject(ScheduleBasedConfig.class); - Assertions.assertEquals("y", model.timeZone()); - Assertions.assertEquals(1035885378, model.defaultCount()); - Assertions.assertEquals("bnuqqkpik", model.schedules().get(0).startTime()); - Assertions.assertEquals("drgvtqagn", model.schedules().get(0).endTime()); - Assertions.assertEquals(1873718862, model.schedules().get(0).count()); - Assertions.assertEquals(ScheduleDay.SATURDAY, model.schedules().get(0).days().get(0)); + Assertions.assertEquals("bsrfbj", model.timeZone()); + Assertions.assertEquals(891212878, model.defaultCount()); + Assertions.assertEquals("w", model.schedules().get(0).startTime()); + Assertions.assertEquals("sotftpvj", model.schedules().get(0).endTime()); + Assertions.assertEquals(1235013026, model.schedules().get(0).count()); + Assertions.assertEquals(ScheduleDay.TUESDAY, model.schedules().get(0).days().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleBasedConfig model = new ScheduleBasedConfig().withTimeZone("y").withDefaultCount(1035885378) - .withSchedules(Arrays.asList( - new Schedule().withStartTime("bnuqqkpik").withEndTime("drgvtqagn").withCount(1873718862) - .withDays(Arrays.asList(ScheduleDay.SATURDAY, ScheduleDay.WEDNESDAY, ScheduleDay.WEDNESDAY)), - new Schedule().withStartTime("jggmebfsiarbu").withEndTime("rcvpnazzmhjrunmp").withCount(185169787) - .withDays(Arrays.asList(ScheduleDay.TUESDAY, ScheduleDay.FRIDAY, ScheduleDay.TUESDAY)), - new Schedule().withStartTime("rbnlankxmyskp").withEndTime("henbtkcxywnytn").withCount(1863766018) - .withDays(Arrays.asList(ScheduleDay.THURSDAY)))); + ScheduleBasedConfig model = new ScheduleBasedConfig().withTimeZone("bsrfbj") + .withDefaultCount(891212878) + .withSchedules(Arrays.asList(new Schedule().withStartTime("w") + .withEndTime("sotftpvj") + .withCount(1235013026) + .withDays(Arrays.asList(ScheduleDay.TUESDAY, ScheduleDay.WEDNESDAY, ScheduleDay.MONDAY, + ScheduleDay.THURSDAY)))); model = BinaryData.fromObject(model).toObject(ScheduleBasedConfig.class); - Assertions.assertEquals("y", model.timeZone()); - Assertions.assertEquals(1035885378, model.defaultCount()); - Assertions.assertEquals("bnuqqkpik", model.schedules().get(0).startTime()); - Assertions.assertEquals("drgvtqagn", model.schedules().get(0).endTime()); - Assertions.assertEquals(1873718862, model.schedules().get(0).count()); - Assertions.assertEquals(ScheduleDay.SATURDAY, model.schedules().get(0).days().get(0)); + Assertions.assertEquals("bsrfbj", model.timeZone()); + Assertions.assertEquals(891212878, model.defaultCount()); + Assertions.assertEquals("w", model.schedules().get(0).startTime()); + Assertions.assertEquals("sotftpvj", model.schedules().get(0).endTime()); + Assertions.assertEquals(1235013026, model.schedules().get(0).count()); + Assertions.assertEquals(ScheduleDay.TUESDAY, model.schedules().get(0).days().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleTests.java index efcce59bedda4..7aefd8191619a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScheduleTests.java @@ -14,22 +14,24 @@ public final class ScheduleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Schedule model = BinaryData.fromString( - "{\"startTime\":\"lqidyby\",\"endTime\":\"czfc\",\"count\":751467546,\"days\":[\"Monday\",\"Thursday\",\"Tuesday\",\"Wednesday\"]}") + "{\"startTime\":\"znfqqnvwpmqtar\",\"endTime\":\"oujmkcjhwqytj\",\"count\":734102755,\"days\":[\"Saturday\"]}") .toObject(Schedule.class); - Assertions.assertEquals("lqidyby", model.startTime()); - Assertions.assertEquals("czfc", model.endTime()); - Assertions.assertEquals(751467546, model.count()); - Assertions.assertEquals(ScheduleDay.MONDAY, model.days().get(0)); + Assertions.assertEquals("znfqqnvwpmqtar", model.startTime()); + Assertions.assertEquals("oujmkcjhwqytj", model.endTime()); + Assertions.assertEquals(734102755, model.count()); + Assertions.assertEquals(ScheduleDay.SATURDAY, model.days().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Schedule model = new Schedule().withStartTime("lqidyby").withEndTime("czfc").withCount(751467546).withDays( - Arrays.asList(ScheduleDay.MONDAY, ScheduleDay.THURSDAY, ScheduleDay.TUESDAY, ScheduleDay.WEDNESDAY)); + Schedule model = new Schedule().withStartTime("znfqqnvwpmqtar") + .withEndTime("oujmkcjhwqytj") + .withCount(734102755) + .withDays(Arrays.asList(ScheduleDay.SATURDAY)); model = BinaryData.fromObject(model).toObject(Schedule.class); - Assertions.assertEquals("lqidyby", model.startTime()); - Assertions.assertEquals("czfc", model.endTime()); - Assertions.assertEquals(751467546, model.count()); - Assertions.assertEquals(ScheduleDay.MONDAY, model.days().get(0)); + Assertions.assertEquals("znfqqnvwpmqtar", model.startTime()); + Assertions.assertEquals("oujmkcjhwqytj", model.endTime()); + Assertions.assertEquals(734102755, model.count()); + Assertions.assertEquals(ScheduleDay.SATURDAY, model.days().get(0)); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScriptActionProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScriptActionProfileTests.java index 535be15f10542..d365d5ed90f05 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScriptActionProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ScriptActionProfileTests.java @@ -13,29 +13,33 @@ public final class ScriptActionProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScriptActionProfile model = BinaryData.fromString( - "{\"type\":\"bycnojvkn\",\"name\":\"e\",\"url\":\"qsgzvahapj\",\"parameters\":\"hpvgqz\",\"services\":[\"rvxdjzlmw\"],\"timeoutInMinutes\":2136070791,\"shouldPersist\":false}") + "{\"type\":\"nqxwbp\",\"name\":\"kulpiujwaasi\",\"url\":\"qiiobyuqer\",\"parameters\":\"lp\",\"services\":[\"cciuqgbdbutau\",\"fbtkuwhhmhyk\",\"joxafnndlpi\"],\"timeoutInMinutes\":1639639314,\"shouldPersist\":false}") .toObject(ScriptActionProfile.class); - Assertions.assertEquals("bycnojvkn", model.type()); - Assertions.assertEquals("e", model.name()); - Assertions.assertEquals("qsgzvahapj", model.url()); - Assertions.assertEquals("hpvgqz", model.parameters()); - Assertions.assertEquals("rvxdjzlmw", model.services().get(0)); - Assertions.assertEquals(2136070791, model.timeoutInMinutes()); + Assertions.assertEquals("nqxwbp", model.type()); + Assertions.assertEquals("kulpiujwaasi", model.name()); + Assertions.assertEquals("qiiobyuqer", model.url()); + Assertions.assertEquals("lp", model.parameters()); + Assertions.assertEquals("cciuqgbdbutau", model.services().get(0)); + Assertions.assertEquals(1639639314, model.timeoutInMinutes()); Assertions.assertEquals(false, model.shouldPersist()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScriptActionProfile model = new ScriptActionProfile().withType("bycnojvkn").withName("e").withUrl("qsgzvahapj") - .withParameters("hpvgqz").withServices(Arrays.asList("rvxdjzlmw")).withTimeoutInMinutes(2136070791) + ScriptActionProfile model = new ScriptActionProfile().withType("nqxwbp") + .withName("kulpiujwaasi") + .withUrl("qiiobyuqer") + .withParameters("lp") + .withServices(Arrays.asList("cciuqgbdbutau", "fbtkuwhhmhyk", "joxafnndlpi")) + .withTimeoutInMinutes(1639639314) .withShouldPersist(false); model = BinaryData.fromObject(model).toObject(ScriptActionProfile.class); - Assertions.assertEquals("bycnojvkn", model.type()); - Assertions.assertEquals("e", model.name()); - Assertions.assertEquals("qsgzvahapj", model.url()); - Assertions.assertEquals("hpvgqz", model.parameters()); - Assertions.assertEquals("rvxdjzlmw", model.services().get(0)); - Assertions.assertEquals(2136070791, model.timeoutInMinutes()); + Assertions.assertEquals("nqxwbp", model.type()); + Assertions.assertEquals("kulpiujwaasi", model.name()); + Assertions.assertEquals("qiiobyuqer", model.url()); + Assertions.assertEquals("lp", model.parameters()); + Assertions.assertEquals("cciuqgbdbutau", model.services().get(0)); + Assertions.assertEquals(1639639314, model.timeoutInMinutes()); Assertions.assertEquals(false, model.shouldPersist()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceConfigListResultValueEntityTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceConfigListResultValueEntityTests.java index 0f09cc1658ee4..366adf1011953 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceConfigListResultValueEntityTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceConfigListResultValueEntityTests.java @@ -12,18 +12,18 @@ public final class ServiceConfigListResultValueEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceConfigListResultValueEntity model - = BinaryData.fromString("{\"value\":\"ag\",\"description\":\"vimjwos\"}") + = BinaryData.fromString("{\"value\":\"kfwynw\",\"description\":\"tbvkayhmtnvyq\"}") .toObject(ServiceConfigListResultValueEntity.class); - Assertions.assertEquals("ag", model.value()); - Assertions.assertEquals("vimjwos", model.description()); + Assertions.assertEquals("kfwynw", model.value()); + Assertions.assertEquals("tbvkayhmtnvyq", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceConfigListResultValueEntity model - = new ServiceConfigListResultValueEntity().withValue("ag").withDescription("vimjwos"); + = new ServiceConfigListResultValueEntity().withValue("kfwynw").withDescription("tbvkayhmtnvyq"); model = BinaryData.fromObject(model).toObject(ServiceConfigListResultValueEntity.class); - Assertions.assertEquals("ag", model.value()); - Assertions.assertEquals("vimjwos", model.description()); + Assertions.assertEquals("kfwynw", model.value()); + Assertions.assertEquals("tbvkayhmtnvyq", model.description()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceStatusTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceStatusTests.java index edc19fc4a84ff..4678e24f4807d 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceStatusTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/ServiceStatusTests.java @@ -12,19 +12,20 @@ public final class ServiceStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceStatus model - = BinaryData.fromString("{\"kind\":\"z\",\"ready\":\"wmsweypqwd\",\"message\":\"gicccnxqhuex\"}") + = BinaryData.fromString("{\"kind\":\"wnopqgikyzirtx\",\"ready\":\"yuxzejntpsewgi\",\"message\":\"l\"}") .toObject(ServiceStatus.class); - Assertions.assertEquals("z", model.kind()); - Assertions.assertEquals("wmsweypqwd", model.ready()); - Assertions.assertEquals("gicccnxqhuex", model.message()); + Assertions.assertEquals("wnopqgikyzirtx", model.kind()); + Assertions.assertEquals("yuxzejntpsewgi", model.ready()); + Assertions.assertEquals("l", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceStatus model = new ServiceStatus().withKind("z").withReady("wmsweypqwd").withMessage("gicccnxqhuex"); + ServiceStatus model + = new ServiceStatus().withKind("wnopqgikyzirtx").withReady("yuxzejntpsewgi").withMessage("l"); model = BinaryData.fromObject(model).toObject(ServiceStatus.class); - Assertions.assertEquals("z", model.kind()); - Assertions.assertEquals("wmsweypqwd", model.ready()); - Assertions.assertEquals("gicccnxqhuex", model.message()); + Assertions.assertEquals("wnopqgikyzirtx", model.kind()); + Assertions.assertEquals("yuxzejntpsewgi", model.ready()); + Assertions.assertEquals("l", model.message()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginTests.java index b2da8944b26f7..a9661d5a23c6c 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginTests.java @@ -11,14 +11,14 @@ public final class SparkUserPluginTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SparkUserPlugin model = BinaryData.fromString("{\"path\":\"nrjawgqwg\"}").toObject(SparkUserPlugin.class); - Assertions.assertEquals("nrjawgqwg", model.path()); + SparkUserPlugin model = BinaryData.fromString("{\"path\":\"mutwuoe\"}").toObject(SparkUserPlugin.class); + Assertions.assertEquals("mutwuoe", model.path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SparkUserPlugin model = new SparkUserPlugin().withPath("nrjawgqwg"); + SparkUserPlugin model = new SparkUserPlugin().withPath("mutwuoe"); model = BinaryData.fromObject(model).toObject(SparkUserPlugin.class); - Assertions.assertEquals("nrjawgqwg", model.path()); + Assertions.assertEquals("mutwuoe", model.path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginsTests.java index d9e92ae7a05bb..c0fdb6ae4121a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginsTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SparkUserPluginsTests.java @@ -14,16 +14,15 @@ public final class SparkUserPluginsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SparkUserPlugins model - = BinaryData.fromString("{\"plugins\":[{\"path\":\"ojgjrwjueiotwmc\"},{\"path\":\"ytdxwit\"}]}") - .toObject(SparkUserPlugins.class); - Assertions.assertEquals("ojgjrwjueiotwmc", model.plugins().get(0).path()); + = BinaryData.fromString("{\"plugins\":[{\"path\":\"xcxrsl\"}]}").toObject(SparkUserPlugins.class); + Assertions.assertEquals("xcxrsl", model.plugins().get(0).path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SparkUserPlugins model = new SparkUserPlugins().withPlugins(Arrays - .asList(new SparkUserPlugin().withPath("ojgjrwjueiotwmc"), new SparkUserPlugin().withPath("ytdxwit"))); + SparkUserPlugins model + = new SparkUserPlugins().withPlugins(Arrays.asList(new SparkUserPlugin().withPath("xcxrsl"))); model = BinaryData.fromObject(model).toObject(SparkUserPlugins.class); - Assertions.assertEquals("ojgjrwjueiotwmc", model.plugins().get(0).path()); + Assertions.assertEquals("xcxrsl", model.plugins().get(0).path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshConnectivityEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshConnectivityEndpointTests.java index e16e42b678e04..15c48b334e1bf 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshConnectivityEndpointTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshConnectivityEndpointTests.java @@ -12,18 +12,18 @@ public final class SshConnectivityEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SshConnectivityEndpoint model - = BinaryData.fromString("{\"endpoint\":\"frzpwvlqdqgb\",\"privateSshEndpoint\":\"ylihkaetckt\"}") + = BinaryData.fromString("{\"endpoint\":\"ppcqeqxolz\",\"privateSshEndpoint\":\"hzxct\"}") .toObject(SshConnectivityEndpoint.class); - Assertions.assertEquals("frzpwvlqdqgb", model.endpoint()); - Assertions.assertEquals("ylihkaetckt", model.privateSshEndpoint()); + Assertions.assertEquals("ppcqeqxolz", model.endpoint()); + Assertions.assertEquals("hzxct", model.privateSshEndpoint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SshConnectivityEndpoint model - = new SshConnectivityEndpoint().withEndpoint("frzpwvlqdqgb").withPrivateSshEndpoint("ylihkaetckt"); + = new SshConnectivityEndpoint().withEndpoint("ppcqeqxolz").withPrivateSshEndpoint("hzxct"); model = BinaryData.fromObject(model).toObject(SshConnectivityEndpoint.class); - Assertions.assertEquals("frzpwvlqdqgb", model.endpoint()); - Assertions.assertEquals("ylihkaetckt", model.privateSshEndpoint()); + Assertions.assertEquals("ppcqeqxolz", model.endpoint()); + Assertions.assertEquals("hzxct", model.privateSshEndpoint()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshProfileTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshProfileTests.java index 7b5c0d880ab69..cc78d08477486 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshProfileTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/SshProfileTests.java @@ -12,14 +12,17 @@ public final class SshProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SshProfile model - = BinaryData.fromString("{\"count\":1278137451,\"podPrefix\":\"erfuwuttt\"}").toObject(SshProfile.class); - Assertions.assertEquals(1278137451, model.count()); + = BinaryData.fromString("{\"count\":1194461063,\"podPrefix\":\"fqjhhkxbpvjymj\",\"vmSize\":\"xjyngudivk\"}") + .toObject(SshProfile.class); + Assertions.assertEquals(1194461063, model.count()); + Assertions.assertEquals("xjyngudivk", model.vmSize()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SshProfile model = new SshProfile().withCount(1278137451); + SshProfile model = new SshProfile().withCount(1194461063).withVmSize("xjyngudivk"); model = BinaryData.fromObject(model).toObject(SshProfile.class); - Assertions.assertEquals(1278137451, model.count()); + Assertions.assertEquals(1194461063, model.count()); + Assertions.assertEquals("xjyngudivk", model.vmSize()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TagsObjectTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TagsObjectTests.java index 0176b63533f2f..32242ac7618ca 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TagsObjectTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TagsObjectTests.java @@ -13,17 +13,16 @@ public final class TagsObjectTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagsObject model - = BinaryData.fromString("{\"tags\":{\"v\":\"xqeofjaeqjhqjba\",\"zgcwrw\":\"smjqulngsntnbyb\"}}") - .toObject(TagsObject.class); - Assertions.assertEquals("xqeofjaeqjhqjba", model.tags().get("v")); + TagsObject model = BinaryData.fromString("{\"tags\":{\"zndlikwy\":\"gou\",\"bmadgak\":\"kgfg\"}}") + .toObject(TagsObject.class); + Assertions.assertEquals("gou", model.tags().get("zndlikwy")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagsObject model = new TagsObject().withTags(mapOf("v", "xqeofjaeqjhqjba", "zgcwrw", "smjqulngsntnbyb")); + TagsObject model = new TagsObject().withTags(mapOf("zndlikwy", "gou", "bmadgak", "kgfg")); model = BinaryData.fromObject(model).toObject(TagsObject.class); - Assertions.assertEquals("xqeofjaeqjhqjba", model.tags().get("v")); + Assertions.assertEquals("gou", model.tags().get("zndlikwy")); } // Use "Map.of" if available diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoCoordinatorTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoCoordinatorTests.java index 003744a1c3cbb..d61b976253270 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoCoordinatorTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoCoordinatorTests.java @@ -14,23 +14,23 @@ public final class TrinoCoordinatorTests { public void testDeserialize() throws Exception { TrinoCoordinator model = BinaryData .fromString( - "{\"debug\":{\"enable\":true,\"port\":1650881541,\"suspend\":true},\"highAvailabilityEnabled\":true}") + "{\"debug\":{\"enable\":true,\"port\":353281330,\"suspend\":false},\"highAvailabilityEnabled\":false}") .toObject(TrinoCoordinator.class); Assertions.assertEquals(true, model.debug().enable()); - Assertions.assertEquals(1650881541, model.debug().port()); - Assertions.assertEquals(true, model.debug().suspend()); - Assertions.assertEquals(true, model.highAvailabilityEnabled()); + Assertions.assertEquals(353281330, model.debug().port()); + Assertions.assertEquals(false, model.debug().suspend()); + Assertions.assertEquals(false, model.highAvailabilityEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TrinoCoordinator model = new TrinoCoordinator() - .withDebug(new TrinoDebugConfig().withEnable(true).withPort(1650881541).withSuspend(true)) - .withHighAvailabilityEnabled(true); + .withDebug(new TrinoDebugConfig().withEnable(true).withPort(353281330).withSuspend(false)) + .withHighAvailabilityEnabled(false); model = BinaryData.fromObject(model).toObject(TrinoCoordinator.class); Assertions.assertEquals(true, model.debug().enable()); - Assertions.assertEquals(1650881541, model.debug().port()); - Assertions.assertEquals(true, model.debug().suspend()); - Assertions.assertEquals(true, model.highAvailabilityEnabled()); + Assertions.assertEquals(353281330, model.debug().port()); + Assertions.assertEquals(false, model.debug().suspend()); + Assertions.assertEquals(false, model.highAvailabilityEnabled()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoDebugConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoDebugConfigTests.java index 9160c9c0a3070..63ddec2191a92 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoDebugConfigTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoDebugConfigTests.java @@ -11,19 +11,19 @@ public final class TrinoDebugConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TrinoDebugConfig model = BinaryData.fromString("{\"enable\":true,\"port\":726916833,\"suspend\":true}") + TrinoDebugConfig model = BinaryData.fromString("{\"enable\":true,\"port\":1319718925,\"suspend\":true}") .toObject(TrinoDebugConfig.class); Assertions.assertEquals(true, model.enable()); - Assertions.assertEquals(726916833, model.port()); + Assertions.assertEquals(1319718925, model.port()); Assertions.assertEquals(true, model.suspend()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrinoDebugConfig model = new TrinoDebugConfig().withEnable(true).withPort(726916833).withSuspend(true); + TrinoDebugConfig model = new TrinoDebugConfig().withEnable(true).withPort(1319718925).withSuspend(true); model = BinaryData.fromObject(model).toObject(TrinoDebugConfig.class); Assertions.assertEquals(true, model.enable()); - Assertions.assertEquals(726916833, model.port()); + Assertions.assertEquals(1319718925, model.port()); Assertions.assertEquals(true, model.suspend()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoTelemetryConfigTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoTelemetryConfigTests.java index ce6a7f074f8f0..27c21e4d4dc91 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoTelemetryConfigTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoTelemetryConfigTests.java @@ -12,22 +12,24 @@ public final class TrinoTelemetryConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrinoTelemetryConfig model = BinaryData.fromString( - "{\"hivecatalogName\":\"ccm\",\"hivecatalogSchema\":\"udxytlmoyrx\",\"partitionRetentionInDays\":2130871697,\"path\":\"dw\"}") + "{\"hivecatalogName\":\"eotg\",\"hivecatalogSchema\":\"l\",\"partitionRetentionInDays\":1147743130,\"path\":\"wlauwzizxbmpg\"}") .toObject(TrinoTelemetryConfig.class); - Assertions.assertEquals("ccm", model.hivecatalogName()); - Assertions.assertEquals("udxytlmoyrx", model.hivecatalogSchema()); - Assertions.assertEquals(2130871697, model.partitionRetentionInDays()); - Assertions.assertEquals("dw", model.path()); + Assertions.assertEquals("eotg", model.hivecatalogName()); + Assertions.assertEquals("l", model.hivecatalogSchema()); + Assertions.assertEquals(1147743130, model.partitionRetentionInDays()); + Assertions.assertEquals("wlauwzizxbmpg", model.path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrinoTelemetryConfig model = new TrinoTelemetryConfig().withHivecatalogName("ccm") - .withHivecatalogSchema("udxytlmoyrx").withPartitionRetentionInDays(2130871697).withPath("dw"); + TrinoTelemetryConfig model = new TrinoTelemetryConfig().withHivecatalogName("eotg") + .withHivecatalogSchema("l") + .withPartitionRetentionInDays(1147743130) + .withPath("wlauwzizxbmpg"); model = BinaryData.fromObject(model).toObject(TrinoTelemetryConfig.class); - Assertions.assertEquals("ccm", model.hivecatalogName()); - Assertions.assertEquals("udxytlmoyrx", model.hivecatalogSchema()); - Assertions.assertEquals(2130871697, model.partitionRetentionInDays()); - Assertions.assertEquals("dw", model.path()); + Assertions.assertEquals("eotg", model.hivecatalogName()); + Assertions.assertEquals("l", model.hivecatalogSchema()); + Assertions.assertEquals(1147743130, model.partitionRetentionInDays()); + Assertions.assertEquals("wlauwzizxbmpg", model.path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginTests.java index f14bbfad74fb9..795f0def36e98 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginTests.java @@ -12,20 +12,19 @@ public final class TrinoUserPluginTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrinoUserPlugin model - = BinaryData.fromString("{\"enabled\":true,\"name\":\"ermclfplphoxuscr\",\"path\":\"bgyepsbj\"}") + = BinaryData.fromString("{\"enabled\":false,\"name\":\"kwobdagxtibq\",\"path\":\"bxwakbog\"}") .toObject(TrinoUserPlugin.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ermclfplphoxuscr", model.name()); - Assertions.assertEquals("bgyepsbj", model.path()); + Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("kwobdagxtibq", model.name()); + Assertions.assertEquals("bxwakbog", model.path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrinoUserPlugin model - = new TrinoUserPlugin().withEnabled(true).withName("ermclfplphoxuscr").withPath("bgyepsbj"); + TrinoUserPlugin model = new TrinoUserPlugin().withEnabled(false).withName("kwobdagxtibq").withPath("bxwakbog"); model = BinaryData.fromObject(model).toObject(TrinoUserPlugin.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ermclfplphoxuscr", model.name()); - Assertions.assertEquals("bgyepsbj", model.path()); + Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("kwobdagxtibq", model.name()); + Assertions.assertEquals("bxwakbog", model.path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginsTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginsTests.java index 03de418ef7612..a56890957cfbc 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginsTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserPluginsTests.java @@ -13,24 +13,21 @@ public final class TrinoUserPluginsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TrinoUserPlugins model = BinaryData.fromString( - "{\"plugins\":[{\"enabled\":true,\"name\":\"sapskr\",\"path\":\"mhjjdhtldwkyzx\"},{\"enabled\":false,\"name\":\"ncwscwsvlxoto\",\"path\":\"wrupqsxvnmicykvc\"},{\"enabled\":false,\"name\":\"ilovnot\",\"path\":\"jfcn\"},{\"enabled\":false,\"name\":\"nxdhbt\",\"path\":\"phywpnvj\"}]}") + TrinoUserPlugins model = BinaryData + .fromString("{\"plugins\":[{\"enabled\":false,\"name\":\"nsikvmkqzeqqkdl\",\"path\":\"zxmhhvhgu\"}]}") .toObject(TrinoUserPlugins.class); - Assertions.assertEquals(true, model.plugins().get(0).enabled()); - Assertions.assertEquals("sapskr", model.plugins().get(0).name()); - Assertions.assertEquals("mhjjdhtldwkyzx", model.plugins().get(0).path()); + Assertions.assertEquals(false, model.plugins().get(0).enabled()); + Assertions.assertEquals("nsikvmkqzeqqkdl", model.plugins().get(0).name()); + Assertions.assertEquals("zxmhhvhgu", model.plugins().get(0).path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TrinoUserPlugins model = new TrinoUserPlugins().withPlugins( - Arrays.asList(new TrinoUserPlugin().withEnabled(true).withName("sapskr").withPath("mhjjdhtldwkyzx"), - new TrinoUserPlugin().withEnabled(false).withName("ncwscwsvlxoto").withPath("wrupqsxvnmicykvc"), - new TrinoUserPlugin().withEnabled(false).withName("ilovnot").withPath("jfcn"), - new TrinoUserPlugin().withEnabled(false).withName("nxdhbt").withPath("phywpnvj"))); + Arrays.asList(new TrinoUserPlugin().withEnabled(false).withName("nsikvmkqzeqqkdl").withPath("zxmhhvhgu"))); model = BinaryData.fromObject(model).toObject(TrinoUserPlugins.class); - Assertions.assertEquals(true, model.plugins().get(0).enabled()); - Assertions.assertEquals("sapskr", model.plugins().get(0).name()); - Assertions.assertEquals("mhjjdhtldwkyzx", model.plugins().get(0).path()); + Assertions.assertEquals(false, model.plugins().get(0).enabled()); + Assertions.assertEquals("nsikvmkqzeqqkdl", model.plugins().get(0).name()); + Assertions.assertEquals("zxmhhvhgu", model.plugins().get(0).path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserTelemetryTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserTelemetryTests.java index 5a6b7608a9213..389ca03138de3 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserTelemetryTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoUserTelemetryTests.java @@ -13,23 +13,25 @@ public final class TrinoUserTelemetryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrinoUserTelemetry model = BinaryData.fromString( - "{\"storage\":{\"hivecatalogName\":\"qugxywpmueefjzwf\",\"hivecatalogSchema\":\"q\",\"partitionRetentionInDays\":640895390,\"path\":\"suyonobglaocq\"}}") + "{\"storage\":{\"hivecatalogName\":\"dlkzgxhuri\",\"hivecatalogSchema\":\"bpodxunkbebxm\",\"partitionRetentionInDays\":1347899854,\"path\":\"ntwlrbqtkoie\"}}") .toObject(TrinoUserTelemetry.class); - Assertions.assertEquals("qugxywpmueefjzwf", model.storage().hivecatalogName()); - Assertions.assertEquals("q", model.storage().hivecatalogSchema()); - Assertions.assertEquals(640895390, model.storage().partitionRetentionInDays()); - Assertions.assertEquals("suyonobglaocq", model.storage().path()); + Assertions.assertEquals("dlkzgxhuri", model.storage().hivecatalogName()); + Assertions.assertEquals("bpodxunkbebxm", model.storage().hivecatalogSchema()); + Assertions.assertEquals(1347899854, model.storage().partitionRetentionInDays()); + Assertions.assertEquals("ntwlrbqtkoie", model.storage().path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TrinoUserTelemetry model - = new TrinoUserTelemetry().withStorage(new TrinoTelemetryConfig().withHivecatalogName("qugxywpmueefjzwf") - .withHivecatalogSchema("q").withPartitionRetentionInDays(640895390).withPath("suyonobglaocq")); + = new TrinoUserTelemetry().withStorage(new TrinoTelemetryConfig().withHivecatalogName("dlkzgxhuri") + .withHivecatalogSchema("bpodxunkbebxm") + .withPartitionRetentionInDays(1347899854) + .withPath("ntwlrbqtkoie")); model = BinaryData.fromObject(model).toObject(TrinoUserTelemetry.class); - Assertions.assertEquals("qugxywpmueefjzwf", model.storage().hivecatalogName()); - Assertions.assertEquals("q", model.storage().hivecatalogSchema()); - Assertions.assertEquals(640895390, model.storage().partitionRetentionInDays()); - Assertions.assertEquals("suyonobglaocq", model.storage().path()); + Assertions.assertEquals("dlkzgxhuri", model.storage().hivecatalogName()); + Assertions.assertEquals("bpodxunkbebxm", model.storage().hivecatalogSchema()); + Assertions.assertEquals(1347899854, model.storage().partitionRetentionInDays()); + Assertions.assertEquals("ntwlrbqtkoie", model.storage().path()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoWorkerTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoWorkerTests.java index bfaf4f9a58124..8b08117b2bf7a 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoWorkerTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/TrinoWorkerTests.java @@ -12,21 +12,20 @@ public final class TrinoWorkerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TrinoWorker model - = BinaryData.fromString("{\"debug\":{\"enable\":false,\"port\":1949820387,\"suspend\":false}}") - .toObject(TrinoWorker.class); - Assertions.assertEquals(false, model.debug().enable()); - Assertions.assertEquals(1949820387, model.debug().port()); + TrinoWorker model = BinaryData.fromString("{\"debug\":{\"enable\":true,\"port\":1935648017,\"suspend\":false}}") + .toObject(TrinoWorker.class); + Assertions.assertEquals(true, model.debug().enable()); + Assertions.assertEquals(1935648017, model.debug().port()); Assertions.assertEquals(false, model.debug().suspend()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TrinoWorker model = new TrinoWorker() - .withDebug(new TrinoDebugConfig().withEnable(false).withPort(1949820387).withSuspend(false)); + .withDebug(new TrinoDebugConfig().withEnable(true).withPort(1935648017).withSuspend(false)); model = BinaryData.fromObject(model).toObject(TrinoWorker.class); - Assertions.assertEquals(false, model.debug().enable()); - Assertions.assertEquals(1949820387, model.debug().port()); + Assertions.assertEquals(true, model.debug().enable()); + Assertions.assertEquals(1935648017, model.debug().port()); Assertions.assertEquals(false, model.debug().suspend()); } } diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/WebConnectivityEndpointTests.java b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/WebConnectivityEndpointTests.java index 2559b4d5a2540..16b8333ee2d21 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/WebConnectivityEndpointTests.java +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/src/test/java/com/azure/resourcemanager/hdinsight/containers/generated/WebConnectivityEndpointTests.java @@ -11,19 +11,17 @@ public final class WebConnectivityEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WebConnectivityEndpoint model - = BinaryData.fromString("{\"fqdn\":\"wrmjmwvvjektc\",\"privateFqdn\":\"enhwlrs\"}") - .toObject(WebConnectivityEndpoint.class); - Assertions.assertEquals("wrmjmwvvjektc", model.fqdn()); - Assertions.assertEquals("enhwlrs", model.privateFqdn()); + WebConnectivityEndpoint model = BinaryData.fromString("{\"fqdn\":\"pfqbuaceopzf\",\"privateFqdn\":\"hhuao\"}") + .toObject(WebConnectivityEndpoint.class); + Assertions.assertEquals("pfqbuaceopzf", model.fqdn()); + Assertions.assertEquals("hhuao", model.privateFqdn()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WebConnectivityEndpoint model - = new WebConnectivityEndpoint().withFqdn("wrmjmwvvjektc").withPrivateFqdn("enhwlrs"); + WebConnectivityEndpoint model = new WebConnectivityEndpoint().withFqdn("pfqbuaceopzf").withPrivateFqdn("hhuao"); model = BinaryData.fromObject(model).toObject(WebConnectivityEndpoint.class); - Assertions.assertEquals("wrmjmwvvjektc", model.fqdn()); - Assertions.assertEquals("enhwlrs", model.privateFqdn()); + Assertions.assertEquals("pfqbuaceopzf", model.fqdn()); + Assertions.assertEquals("hhuao", model.privateFqdn()); } }