From c2cfa097695579f881079498ad1ce0bbdbbac109 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 11 Nov 2024 16:23:48 +0000 Subject: [PATCH] CodeGen from PR 31270 in Azure/azure-rest-api-specs Merge c2c50614de07fa8b86d5ed0670fe45b285bd7810 into 100f67b7fdcd3460bb2b83ae525fa8a428f30fbb --- .../CHANGELOG.md | 833 ++++- .../README.md | 17 +- .../SAMPLE.md | 3277 ++++++++++------- .../pom.xml | 6 +- .../networkcloud/NetworkCloudManager.java | 78 +- .../networkcloud/fluent/AgentPoolsClient.java | 128 +- .../fluent/BareMetalMachineKeySetsClient.java | 136 +- .../fluent/BareMetalMachinesClient.java | 413 +-- .../networkcloud/fluent/BmcKeySetsClient.java | 123 +- .../fluent/CloudServicesNetworksClient.java | 170 +- .../fluent/ClusterManagersClient.java | 138 +- .../networkcloud/fluent/ClustersClient.java | 342 +- .../networkcloud/fluent/ConsolesClient.java | 128 +- .../KubernetesClusterFeaturesClient.java | 309 ++ .../fluent/KubernetesClustersClient.java | 177 +- .../networkcloud/fluent/L2NetworksClient.java | 139 +- .../networkcloud/fluent/L3NetworksClient.java | 139 +- .../fluent/MetricsConfigurationsClient.java | 136 +- .../networkcloud/fluent/NetworkCloud.java | 59 +- .../networkcloud/fluent/OperationsClient.java | 18 +- .../networkcloud/fluent/RackSkusClient.java | 28 +- .../networkcloud/fluent/RacksClient.java | 153 +- .../fluent/StorageAppliancesClient.java | 217 +- .../fluent/TrunkedNetworksClient.java | 138 +- .../fluent/VirtualMachinesClient.java | 241 +- .../networkcloud/fluent/VolumesClient.java | 125 +- .../fluent/models/AgentPoolInner.java | 249 +- .../models/AgentPoolPatchProperties.java | 113 +- .../fluent/models/AgentPoolProperties.java | 221 +- .../fluent/models/BareMetalMachineInner.java | 318 +- .../models/BareMetalMachineKeySetInner.java | 198 +- ...BareMetalMachineKeySetPatchProperties.java | 80 +- .../BareMetalMachineKeySetProperties.java | 165 +- .../BareMetalMachinePatchProperties.java | 68 +- .../models/BareMetalMachineProperties.java | 406 +- .../fluent/models/BmcKeySetInner.java | 188 +- .../models/BmcKeySetPatchProperties.java | 72 +- .../fluent/models/BmcKeySetProperties.java | 139 +- .../models/CloudServicesNetworkInner.java | 191 +- .../CloudServicesNetworkPatchProperties.java | 71 +- .../CloudServicesNetworkProperties.java | 127 +- .../fluent/models/ClusterInner.java | 516 ++- .../fluent/models/ClusterManagerInner.java | 219 +- .../models/ClusterManagerProperties.java | 153 +- .../ClusterMetricsConfigurationInner.java | 181 +- ...erMetricsConfigurationPatchProperties.java | 68 +- ...ClusterMetricsConfigurationProperties.java | 95 +- .../fluent/models/ClusterPatchProperties.java | 382 +- .../fluent/models/ClusterProperties.java | 565 ++- .../fluent/models/ConsoleInner.java | 198 +- .../fluent/models/ConsolePatchProperties.java | 103 +- .../fluent/models/ConsoleProperties.java | 130 +- .../models/KubernetesClusterFeatureInner.java | 266 ++ ...bernetesClusterFeaturePatchProperties.java | 102 + .../KubernetesClusterFeatureProperties.java | 207 ++ .../fluent/models/KubernetesClusterInner.java | 277 +- .../KubernetesClusterPatchProperties.java | 127 +- .../models/KubernetesClusterProperties.java | 286 +- .../fluent/models/L2NetworkInner.java | 187 +- .../fluent/models/L2NetworkProperties.java | 123 +- .../fluent/models/L3NetworkInner.java | 219 +- .../fluent/models/L3NetworkProperties.java | 182 +- .../fluent/models/MachineSkuProperties.java | 114 +- .../fluent/models/OperationInner.java | 79 +- .../models/OperationStatusResultInner.java | 304 +- .../OperationStatusResultProperties.java | 132 + .../networkcloud/fluent/models/RackInner.java | 184 +- .../fluent/models/RackProperties.java | 122 +- .../fluent/models/RackSkuInner.java | 139 +- .../fluent/models/RackSkuProperties.java | 95 +- .../fluent/models/RacksPatchProperties.java | 67 +- .../fluent/models/StorageApplianceInner.java | 255 +- .../StorageAppliancePatchProperties.java | 60 +- .../models/StorageApplianceProperties.java | 257 +- .../models/StorageApplianceSkuProperties.java | 66 +- .../fluent/models/TrunkedNetworkInner.java | 188 +- .../models/TrunkedNetworkProperties.java | 139 +- .../fluent/models/VirtualMachineInner.java | 303 +- .../models/VirtualMachinePatchProperties.java | 75 +- .../models/VirtualMachineProperties.java | 339 +- .../fluent/models/VolumeInner.java | 174 +- .../fluent/models/VolumeProperties.java | 87 +- .../fluent/models/package-info.java | 6 +- .../networkcloud/fluent/package-info.java | 5 +- .../implementation/AgentPoolImpl.java | 13 +- .../implementation/AgentPoolsClientImpl.java | 371 +- .../implementation/AgentPoolsImpl.java | 59 +- .../implementation/BareMetalMachineImpl.java | 37 +- .../BareMetalMachineKeySetImpl.java | 7 +- .../BareMetalMachineKeySetsClientImpl.java | 428 +-- .../BareMetalMachineKeySetsImpl.java | 59 +- .../BareMetalMachinesClientImpl.java | 1240 +++---- .../implementation/BareMetalMachinesImpl.java | 51 +- .../implementation/BmcKeySetImpl.java | 6 +- .../implementation/BmcKeySetsClientImpl.java | 398 +- .../implementation/BmcKeySetsImpl.java | 58 +- .../CloudServicesNetworkImpl.java | 5 +- .../CloudServicesNetworksClientImpl.java | 505 +-- .../CloudServicesNetworksImpl.java | 53 +- .../implementation/ClusterImpl.java | 151 +- .../implementation/ClusterManagerImpl.java | 19 +- .../ClusterManagersClientImpl.java | 413 ++- .../implementation/ClusterManagersImpl.java | 52 +- .../ClusterMetricsConfigurationImpl.java | 7 +- .../implementation/ClustersClientImpl.java | 1217 ++++-- .../implementation/ClustersImpl.java | 94 +- .../implementation/ConsoleImpl.java | 6 +- .../implementation/ConsolesClientImpl.java | 398 +- .../implementation/ConsolesImpl.java | 59 +- .../KubernetesClusterFeatureImpl.java | 225 ++ .../KubernetesClusterFeaturesClientImpl.java | 1389 +++++++ .../KubernetesClusterFeaturesImpl.java | 176 + .../implementation/KubernetesClusterImpl.java | 11 +- .../KubernetesClustersClientImpl.java | 533 +-- .../KubernetesClustersImpl.java | 51 +- .../implementation/L2NetworkImpl.java | 4 +- .../implementation/L2NetworksClientImpl.java | 417 ++- .../implementation/L2NetworksImpl.java | 52 +- .../implementation/L3NetworkImpl.java | 4 +- .../implementation/L3NetworksClientImpl.java | 417 ++- .../implementation/L3NetworksImpl.java | 52 +- .../MetricsConfigurationsClientImpl.java | 399 +- .../MetricsConfigurationsImpl.java | 61 +- .../implementation/NetworkCloudBuilder.java | 18 +- .../implementation/NetworkCloudImpl.java | 185 +- .../OperationStatusResultImpl.java | 54 +- .../implementation/OperationsClientImpl.java | 74 +- .../implementation/OperationsImpl.java | 4 +- .../networkcloud/implementation/RackImpl.java | 4 +- .../implementation/RackSkusClientImpl.java | 106 +- .../implementation/RackSkusImpl.java | 4 +- .../implementation/RacksClientImpl.java | 481 +-- .../implementation/RacksImpl.java | 52 +- .../{Utils.java => ResourceManagerUtils.java} | 24 +- .../implementation/StorageApplianceImpl.java | 27 +- .../StorageAppliancesClientImpl.java | 646 ++-- .../implementation/StorageAppliancesImpl.java | 51 +- .../implementation/TrunkedNetworkImpl.java | 4 +- .../TrunkedNetworksClientImpl.java | 403 +- .../implementation/TrunkedNetworksImpl.java | 52 +- .../implementation/VirtualMachineImpl.java | 13 +- .../VirtualMachinesClientImpl.java | 742 ++-- .../implementation/VirtualMachinesImpl.java | 50 +- .../implementation/VolumeImpl.java | 4 +- .../implementation/VolumesClientImpl.java | 390 +- .../implementation/VolumesImpl.java | 52 +- .../implementation/package-info.java | 5 +- .../networkcloud/models/AadConfiguration.java | 67 +- .../networkcloud/models/ActionType.java | 16 +- .../models/AdministrativeCredentials.java | 74 +- .../models/AdministratorConfiguration.java | 64 +- .../AdministratorConfigurationPatch.java | 101 + .../models/AdvertiseToFabric.java | 16 +- .../networkcloud/models/AgentOptions.java | 68 +- .../networkcloud/models/AgentPool.java | 305 +- .../models/AgentPoolDetailedStatus.java | 24 +- .../networkcloud/models/AgentPoolList.java | 68 +- .../networkcloud/models/AgentPoolMode.java | 20 +- .../models/AgentPoolPatchParameters.java | 117 +- .../models/AgentPoolProvisioningState.java | 40 +- .../models/AgentPoolUpgradeSettings.java | 139 +- .../networkcloud/models/AgentPools.java | 87 +- .../models/AnalyticsOutputSettings.java | 130 + .../models/AttachedNetworkConfiguration.java | 82 +- .../models/AvailabilityLifecycle.java | 20 +- .../networkcloud/models/AvailableUpgrade.java | 62 +- .../networkcloud/models/BareMetalMachine.java | 442 ++- .../BareMetalMachineCommandSpecification.java | 72 +- .../BareMetalMachineConfigurationData.java | 158 +- .../BareMetalMachineCordonParameters.java | 57 +- .../models/BareMetalMachineCordonStatus.java | 20 +- .../BareMetalMachineDetailedStatus.java | 36 +- .../models/BareMetalMachineEvacuate.java | 20 +- ...eMetalMachineHardwareValidationResult.java | 20 +- .../models/BareMetalMachineKeySet.java | 195 +- .../BareMetalMachineKeySetDetailedStatus.java | 28 +- .../models/BareMetalMachineKeySetList.java | 69 +- ...BareMetalMachineKeySetPatchParameters.java | 91 +- .../BareMetalMachineKeySetPrivilegeLevel.java | 20 +- ...reMetalMachineKeySetProvisioningState.java | 32 +- ...BareMetalMachineKeySetUserSetupStatus.java | 20 +- .../models/BareMetalMachineKeySets.java | 87 +- .../models/BareMetalMachineList.java | 69 +- .../BareMetalMachinePatchParameters.java | 89 +- .../BareMetalMachinePowerOffParameters.java | 61 +- .../models/BareMetalMachinePowerState.java | 20 +- .../BareMetalMachineProvisioningState.java | 32 +- .../models/BareMetalMachineReadyState.java | 20 +- .../BareMetalMachineReplaceParameters.java | 112 +- .../BareMetalMachineRunCommandParameters.java | 92 +- ...MetalMachineRunDataExtractsParameters.java | 85 +- ...MetalMachineRunReadCommandsParameters.java | 85 +- .../models/BareMetalMachineSkipShutdown.java | 20 +- .../models/BareMetalMachines.java | 240 +- .../networkcloud/models/BfdEnabled.java | 20 +- .../networkcloud/models/BgpAdvertisement.java | 98 +- .../networkcloud/models/BgpMultiHop.java | 20 +- .../BgpServiceLoadBalancerConfiguration.java | 100 +- .../networkcloud/models/BmcKeySet.java | 167 +- .../models/BmcKeySetDetailedStatus.java | 28 +- .../networkcloud/models/BmcKeySetList.java | 68 +- .../models/BmcKeySetPatchParameters.java | 84 +- .../models/BmcKeySetPrivilegeLevel.java | 20 +- .../models/BmcKeySetProvisioningState.java | 32 +- .../networkcloud/models/BmcKeySets.java | 82 +- .../models/BootstrapProtocol.java | 16 +- .../models/CloudServicesNetwork.java | 161 +- .../CloudServicesNetworkDetailedStatus.java | 24 +- ...esNetworkEnableDefaultEgressEndpoints.java | 20 +- .../models/CloudServicesNetworkList.java | 69 +- .../CloudServicesNetworkPatchParameters.java | 87 +- ...CloudServicesNetworkProvisioningState.java | 32 +- .../models/CloudServicesNetworks.java | 106 +- .../networkcloud/models/Cluster.java | 792 ++-- .../ClusterAvailableUpgradeVersion.java | 86 +- .../models/ClusterAvailableVersion.java | 57 +- .../networkcloud/models/ClusterCapacity.java | 153 +- .../models/ClusterConnectionStatus.java | 29 +- ...pdateVersionMachineGroupTargetingMode.java | 47 + ...lusterContinueUpdateVersionParameters.java | 101 + .../models/ClusterDeployParameters.java | 61 +- .../models/ClusterDetailedStatus.java | 49 +- .../networkcloud/models/ClusterList.java | 68 +- .../networkcloud/models/ClusterManager.java | 212 +- .../ClusterManagerConnectionStatus.java | 20 +- .../models/ClusterManagerDetailedStatus.java | 36 +- .../models/ClusterManagerList.java | 69 +- .../models/ClusterManagerPatchParameters.java | 94 +- .../ClusterManagerProvisioningState.java | 36 +- .../networkcloud/models/ClusterManagers.java | 98 +- .../models/ClusterMetricsConfiguration.java | 147 +- ...terMetricsConfigurationDetailedStatus.java | 24 +- .../ClusterMetricsConfigurationList.java | 70 +- ...erMetricsConfigurationPatchParameters.java | 83 +- ...MetricsConfigurationProvisioningState.java | 32 +- .../models/ClusterPatchParameters.java | 336 +- .../models/ClusterProvisioningState.java | 36 +- .../models/ClusterScanRuntimeParameters.java | 94 + ...sterScanRuntimeParametersScanActivity.java | 52 + .../models/ClusterSecretArchive.java | 133 + .../models/ClusterSecretArchiveEnabled.java | 51 + .../networkcloud/models/ClusterType.java | 20 +- .../models/ClusterUpdateStrategy.java | 226 ++ .../models/ClusterUpdateStrategyType.java | 51 + .../ClusterUpdateVersionParameters.java | 66 +- .../networkcloud/models/Clusters.java | 186 +- .../models/CommandOutputSettings.java | 130 + .../networkcloud/models/Console.java | 202 +- .../models/ConsoleDetailedStatus.java | 20 +- .../networkcloud/models/ConsoleEnabled.java | 20 +- .../networkcloud/models/ConsoleList.java | 68 +- .../models/ConsolePatchParameters.java | 107 +- .../models/ConsoleProvisioningState.java | 32 +- .../networkcloud/models/Consoles.java | 79 +- .../networkcloud/models/ControlImpact.java | 20 +- .../models/ControlPlaneNodeConfiguration.java | 104 +- .../ControlPlaneNodePatchConfiguration.java | 91 +- .../networkcloud/models/DefaultGateway.java | 21 +- .../models/DeviceConnectionType.java | 16 +- .../networkcloud/models/DiskType.java | 20 +- .../networkcloud/models/EgressEndpoint.java | 74 +- .../models/EndpointDependency.java | 72 +- .../networkcloud/models/ExtendedLocation.java | 76 +- .../models/FabricPeeringEnabled.java | 20 +- .../models/FeatureDetailedStatus.java | 24 +- .../networkcloud/models/FeatureStatus.java | 71 +- .../models/HardwareInventory.java | 65 +- .../HardwareInventoryNetworkInterface.java | 72 +- .../models/HardwareValidationStatus.java | 64 +- .../networkcloud/models/HugepagesSize.java | 20 +- .../models/HybridAksIpamEnabled.java | 16 +- .../models/HybridAksPluginType.java | 20 +- .../networkcloud/models/IdentitySelector.java | 124 + .../models/ImageRepositoryCredentials.java | 91 +- .../models/InitialAgentPoolConfiguration.java | 212 +- .../networkcloud/models/IpAddressPool.java | 107 +- .../networkcloud/models/IpAllocationType.java | 24 +- .../networkcloud/models/KeySetUser.java | 130 +- .../networkcloud/models/KeySetUserStatus.java | 67 +- .../models/KubernetesCluster.java | 347 +- .../KubernetesClusterDetailedStatus.java | 24 +- .../models/KubernetesClusterFeature.java | 310 ++ ...esClusterFeatureAvailabilityLifecycle.java | 53 + ...ubernetesClusterFeatureDetailedStatus.java | 57 + .../models/KubernetesClusterFeatureList.java | 128 + ...bernetesClusterFeaturePatchParameters.java | 143 + ...rnetesClusterFeatureProvisioningState.java | 72 + .../KubernetesClusterFeatureRequired.java | 52 + .../models/KubernetesClusterFeatures.java | 171 + .../models/KubernetesClusterList.java | 69 +- .../models/KubernetesClusterNode.java | 156 +- .../KubernetesClusterNodeDetailedStatus.java | 44 +- .../KubernetesClusterPatchParameters.java | 127 +- .../KubernetesClusterProvisioningState.java | 44 +- ...ubernetesClusterRestartNodeParameters.java | 63 +- .../models/KubernetesClusters.java | 118 +- .../networkcloud/models/KubernetesLabel.java | 76 +- .../models/KubernetesNodePowerState.java | 24 +- .../models/KubernetesNodeRole.java | 20 +- .../models/KubernetesPluginType.java | 32 +- .../networkcloud/models/L2Network.java | 149 +- .../L2NetworkAttachmentConfiguration.java | 75 +- .../models/L2NetworkDetailedStatus.java | 24 +- .../networkcloud/models/L2NetworkList.java | 68 +- .../models/L2NetworkPatchParameters.java | 62 +- .../models/L2NetworkProvisioningState.java | 32 +- .../networkcloud/models/L2Networks.java | 106 +- .../L2ServiceLoadBalancerConfiguration.java | 102 + .../networkcloud/models/L3Network.java | 211 +- .../L3NetworkAttachmentConfiguration.java | 84 +- .../L3NetworkConfigurationIpamEnabled.java | 16 +- .../models/L3NetworkDetailedStatus.java | 24 +- .../networkcloud/models/L3NetworkList.java | 68 +- .../models/L3NetworkPatchParameters.java | 62 +- .../models/L3NetworkProvisioningState.java | 32 +- .../networkcloud/models/L3Networks.java | 106 +- .../networkcloud/models/LldpNeighbor.java | 67 +- .../networkcloud/models/MachineDisk.java | 70 +- .../models/MachineSkuDiskConnectionType.java | 28 +- .../networkcloud/models/MachineSkuSlot.java | 92 +- .../ManagedResourceGroupConfiguration.java | 68 +- .../models/ManagedServiceIdentity.java | 190 + .../ManagedServiceIdentitySelectorType.java | 52 + .../models/ManagedServiceIdentityType.java | 62 + .../models/MetricsConfigurations.java | 87 +- .../models/NetworkAttachment.java | 230 +- .../models/NetworkConfiguration.java | 191 +- .../networkcloud/models/NetworkInterface.java | 95 +- .../networkcloud/models/Nic.java | 74 +- ...dePoolAdministratorConfigurationPatch.java | 102 + .../networkcloud/models/Operation.java | 16 +- .../networkcloud/models/OperationDisplay.java | 83 +- .../models/OperationListResult.java | 58 +- .../models/OperationStatusResult.java | 92 +- .../networkcloud/models/Operations.java | 18 +- .../networkcloud/models/Origin.java | 20 +- .../networkcloud/models/OsDisk.java | 84 +- .../models/OsDiskCreateOption.java | 21 +- .../models/OsDiskDeleteOption.java | 16 +- .../networkcloud/models/Rack.java | 167 +- .../networkcloud/models/RackDefinition.java | 127 +- .../models/RackDetailedStatus.java | 24 +- .../networkcloud/models/RackList.java | 68 +- .../models/RackPatchParameters.java | 82 +- .../models/RackProvisioningState.java | 32 +- .../networkcloud/models/RackSku.java | 30 +- .../networkcloud/models/RackSkuList.java | 68 +- .../models/RackSkuProvisioningState.java | 26 +- .../networkcloud/models/RackSkuType.java | 24 +- .../networkcloud/models/RackSkus.java | 28 +- .../networkcloud/models/Racks.java | 98 +- .../models/RemoteVendorManagementFeature.java | 20 +- .../models/RemoteVendorManagementStatus.java | 20 +- .../RuntimeProtectionConfiguration.java | 96 + .../RuntimeProtectionEnforcementLevel.java | 66 + .../models/RuntimeProtectionStatus.java | 154 + .../models/SecretArchiveReference.java | 113 + .../models/SecretArchiveSettings.java | 127 + .../models/SecretRotationStatus.java | 151 + .../models/ServiceLoadBalancerBgpPeer.java | 152 +- .../models/ServicePrincipalInformation.java | 100 +- .../networkcloud/models/SkipShutdown.java | 20 +- .../networkcloud/models/SshPublicKey.java | 64 +- .../networkcloud/models/StorageAppliance.java | 246 +- .../StorageApplianceConfigurationData.java | 119 +- .../StorageApplianceDetailedStatus.java | 33 +- ...nableRemoteVendorManagementParameters.java | 65 +- .../models/StorageApplianceList.java | 69 +- .../StorageAppliancePatchParameters.java | 81 +- .../StorageApplianceProvisioningState.java | 32 +- .../models/StorageApplianceSkuSlot.java | 76 +- .../models/StorageAppliances.java | 138 +- .../networkcloud/models/StorageProfile.java | 84 +- .../models/StringKeyValuePair.java | 133 + .../networkcloud/models/TrunkedNetwork.java | 161 +- ...TrunkedNetworkAttachmentConfiguration.java | 76 +- .../models/TrunkedNetworkDetailedStatus.java | 24 +- .../models/TrunkedNetworkList.java | 69 +- .../models/TrunkedNetworkPatchParameters.java | 63 +- .../TrunkedNetworkProvisioningState.java | 32 +- .../networkcloud/models/TrunkedNetworks.java | 98 +- .../models/UserAssignedIdentity.java | 100 + .../models/ValidationThreshold.java | 85 +- .../models/ValidationThresholdGrouping.java | 20 +- .../models/ValidationThresholdType.java | 20 +- .../networkcloud/models/VirtualMachine.java | 413 ++- .../models/VirtualMachineBootMethod.java | 20 +- .../models/VirtualMachineDetailedStatus.java | 44 +- .../models/VirtualMachineDeviceModelType.java | 25 +- .../VirtualMachineIpAllocationMethod.java | 25 +- .../VirtualMachineIsolateEmulatorThread.java | 16 +- .../models/VirtualMachineList.java | 69 +- .../models/VirtualMachinePatchParameters.java | 93 +- .../models/VirtualMachinePlacementHint.java | 110 +- ...lMachinePlacementHintPodAffinityScope.java | 16 +- .../VirtualMachinePlacementHintType.java | 20 +- .../VirtualMachinePowerOffParameters.java | 61 +- .../models/VirtualMachinePowerState.java | 24 +- .../VirtualMachineProvisioningState.java | 32 +- .../VirtualMachineSchedulingExecution.java | 20 +- .../VirtualMachineVirtioInterfaceType.java | 20 +- .../networkcloud/models/VirtualMachines.java | 146 +- .../networkcloud/models/Volume.java | 125 +- .../models/VolumeDetailedStatus.java | 24 +- .../networkcloud/models/VolumeList.java | 68 +- .../models/VolumePatchParameters.java | 62 +- .../models/VolumeProvisioningState.java | 32 +- .../networkcloud/models/Volumes.java | 90 +- .../models/VulnerabilityScanningSettings.java | 96 + ...rabilityScanningSettingsContainerScan.java | 52 + .../VulnerabilityScanningSettingsPatch.java | 97 + .../networkcloud/models/WorkloadImpact.java | 20 +- .../networkcloud/models/package-info.java | 5 +- .../networkcloud/package-info.java | 5 +- .../src/main/java/module-info.java | 4 +- .../proxy-config.json | 1 + .../reflect-config.json | 1 + .../AgentPoolsCreateOrUpdateSamples.java | 72 +- .../generated/AgentPoolsDeleteSamples.java | 17 +- .../generated/AgentPoolsGetSamples.java | 21 +- ...ntPoolsListByKubernetesClusterSamples.java | 17 +- .../generated/AgentPoolsUpdateSamples.java | 35 +- ...alMachineKeySetsCreateOrUpdateSamples.java | 41 +- .../BareMetalMachineKeySetsDeleteSamples.java | 17 +- .../BareMetalMachineKeySetsGetSamples.java | 21 +- ...talMachineKeySetsListByClusterSamples.java | 17 +- .../BareMetalMachineKeySetsUpdateSamples.java | 47 +- .../BareMetalMachinesCordonSamples.java | 17 +- ...areMetalMachinesCreateOrUpdateSamples.java | 25 +- .../BareMetalMachinesDeleteSamples.java | 13 +- ...etalMachinesGetByResourceGroupSamples.java | 17 +- ...talMachinesListByResourceGroupSamples.java | 14 +- .../BareMetalMachinesListSamples.java | 14 +- .../BareMetalMachinesPowerOffSamples.java | 17 +- .../BareMetalMachinesReimageSamples.java | 13 +- .../BareMetalMachinesReplaceSamples.java | 17 +- .../BareMetalMachinesRestartSamples.java | 13 +- .../BareMetalMachinesRunCommandSamples.java | 24 +- ...reMetalMachinesRunDataExtractsSamples.java | 31 +- ...reMetalMachinesRunReadCommandsSamples.java | 32 +- .../BareMetalMachinesStartSamples.java | 13 +- .../BareMetalMachinesUncordonSamples.java | 13 +- .../BareMetalMachinesUpdateSamples.java | 23 +- .../BmcKeySetsCreateOrUpdateSamples.java | 41 +- .../generated/BmcKeySetsDeleteSamples.java | 13 +- .../generated/BmcKeySetsGetSamples.java | 13 +- .../BmcKeySetsListByClusterSamples.java | 10 +- .../generated/BmcKeySetsUpdateSamples.java | 41 +- ...ServicesNetworksCreateOrUpdateSamples.java | 39 +- .../CloudServicesNetworksDeleteSamples.java | 13 +- ...icesNetworksGetByResourceGroupSamples.java | 17 +- ...cesNetworksListByResourceGroupSamples.java | 14 +- .../CloudServicesNetworksListSamples.java | 14 +- .../CloudServicesNetworksUpdateSamples.java | 37 +- .../ClusterManagersCreateOrUpdateSamples.java | 49 +- .../ClusterManagersDeleteSamples.java | 10 +- ...sterManagersGetByResourceGroupSamples.java | 17 +- ...terManagersListByResourceGroupSamples.java | 14 +- .../generated/ClusterManagersListSamples.java | 14 +- .../ClusterManagersUpdateSamples.java | 32 +- .../ClustersContinueUpdateVersionSamples.java | 32 + .../ClustersCreateOrUpdateSamples.java | 211 +- .../generated/ClustersDeleteSamples.java | 10 +- .../generated/ClustersDeploySamples.java | 34 +- .../ClustersGetByResourceGroupSamples.java | 13 +- .../ClustersListByResourceGroupSamples.java | 14 +- .../generated/ClustersListSamples.java | 10 +- .../generated/ClustersScanRuntimeSamples.java | 31 + .../generated/ClustersUpdateSamples.java | 270 +- .../ClustersUpdateVersionSamples.java | 20 +- .../ConsolesCreateOrUpdateSamples.java | 25 +- .../generated/ConsolesDeleteSamples.java | 13 +- .../generated/ConsolesGetSamples.java | 13 +- .../ConsolesListByVirtualMachineSamples.java | 17 +- .../generated/ConsolesUpdateSamples.java | 21 +- ...sClusterFeaturesCreateOrUpdateSamples.java | 49 + ...ubernetesClusterFeaturesDeleteSamples.java | 26 + .../KubernetesClusterFeaturesGetSamples.java | 26 + ...eaturesListByKubernetesClusterSamples.java | 26 + ...ubernetesClusterFeaturesUpdateSamples.java | 51 + ...bernetesClustersCreateOrUpdateSamples.java | 308 +- .../KubernetesClustersDeleteSamples.java | 13 +- ...etesClustersGetByResourceGroupSamples.java | 17 +- ...tesClustersListByResourceGroupSamples.java | 14 +- .../KubernetesClustersListSamples.java | 14 +- .../KubernetesClustersRestartNodeSamples.java | 21 +- .../KubernetesClustersUpdateSamples.java | 35 +- .../L2NetworksCreateOrUpdateSamples.java | 21 +- .../generated/L2NetworksDeleteSamples.java | 10 +- .../L2NetworksGetByResourceGroupSamples.java | 13 +- .../L2NetworksListByResourceGroupSamples.java | 14 +- .../generated/L2NetworksListSamples.java | 14 +- .../generated/L2NetworksUpdateSamples.java | 18 +- .../L3NetworksCreateOrUpdateSamples.java | 21 +- .../generated/L3NetworksDeleteSamples.java | 10 +- .../L3NetworksGetByResourceGroupSamples.java | 13 +- .../L3NetworksListByResourceGroupSamples.java | 14 +- .../generated/L3NetworksListSamples.java | 14 +- .../generated/L3NetworksUpdateSamples.java | 18 +- ...csConfigurationsCreateOrUpdateSamples.java | 21 +- .../MetricsConfigurationsDeleteSamples.java | 17 +- .../MetricsConfigurationsGetSamples.java | 17 +- ...icsConfigurationsListByClusterSamples.java | 17 +- .../MetricsConfigurationsUpdateSamples.java | 25 +- .../generated/OperationsListSamples.java | 14 +- .../generated/RackSkusGetSamples.java | 10 +- .../generated/RackSkusListSamples.java | 10 +- .../generated/RacksCreateOrUpdateSamples.java | 24 +- .../generated/RacksDeleteSamples.java | 10 +- .../RacksGetByResourceGroupSamples.java | 13 +- .../RacksListByResourceGroupSamples.java | 10 +- .../generated/RacksListSamples.java | 10 +- .../generated/RacksUpdateSamples.java | 21 +- ...torageAppliancesCreateOrUpdateSamples.java | 25 +- .../StorageAppliancesDeleteSamples.java | 13 +- ...sDisableRemoteVendorManagementSamples.java | 17 +- ...esEnableRemoteVendorManagementSamples.java | 17 +- ...geAppliancesGetByResourceGroupSamples.java | 17 +- ...eAppliancesListByResourceGroupSamples.java | 14 +- .../StorageAppliancesListSamples.java | 14 +- .../StorageAppliancesUpdateSamples.java | 23 +- .../TrunkedNetworksCreateOrUpdateSamples.java | 33 +- .../TrunkedNetworksDeleteSamples.java | 10 +- ...nkedNetworksGetByResourceGroupSamples.java | 17 +- ...kedNetworksListByResourceGroupSamples.java | 14 +- .../generated/TrunkedNetworksListSamples.java | 14 +- .../TrunkedNetworksUpdateSamples.java | 19 +- .../VirtualMachinesCreateOrUpdateSamples.java | 91 +- .../VirtualMachinesDeleteSamples.java | 10 +- ...tualMachinesGetByResourceGroupSamples.java | 17 +- ...ualMachinesListByResourceGroupSamples.java | 14 +- .../generated/VirtualMachinesListSamples.java | 14 +- .../VirtualMachinesPowerOffSamples.java | 17 +- .../VirtualMachinesReimageSamples.java | 10 +- .../VirtualMachinesRestartSamples.java | 10 +- .../VirtualMachinesStartSamples.java | 10 +- .../VirtualMachinesUpdateSamples.java | 30 +- .../VolumesCreateOrUpdateSamples.java | 21 +- .../generated/VolumesDeleteSamples.java | 10 +- .../VolumesGetByResourceGroupSamples.java | 13 +- .../VolumesListByResourceGroupSamples.java | 10 +- .../generated/VolumesListSamples.java | 10 +- .../generated/VolumesUpdateSamples.java | 18 +- .../generated/AadConfigurationTests.java | 27 - .../generated/AgentOptionsTests.java | 29 - .../AgentPoolPatchParametersTests.java | 48 - .../AgentPoolPatchPropertiesTests.java | 30 - .../AgentPoolUpgradeSettingsTests.java | 25 - .../generated/AgentPoolsDeleteMockTests.java | 51 - .../AttachedNetworkConfigurationTests.java | 63 - .../generated/AvailableUpgradeTests.java | 23 - ...MetalMachineCommandSpecificationTests.java | 30 - ...BareMetalMachineCordonParametersTests.java | 27 - ...areMetalMachineKeySetsDeleteMockTests.java | 52 - .../BareMetalMachinePatchParametersTests.java | 45 - .../BareMetalMachinePatchPropertiesTests.java | 25 - ...reMetalMachinePowerOffParametersTests.java | 27 - ...MetalMachineRunCommandParametersTests.java | 34 - ...MachineRunDataExtractsParametersTests.java | 35 - ...MachineRunReadCommandsParametersTests.java | 42 - .../BareMetalMachinesCordonMockTests.java | 82 - .../BareMetalMachinesDeleteMockTests.java | 51 - .../BareMetalMachinesPowerOffMockTests.java | 82 - .../BareMetalMachinesReimageMockTests.java | 78 - .../BareMetalMachinesRestartMockTests.java | 77 - .../BareMetalMachinesRunCommandMockTests.java | 84 - ...MetalMachinesRunDataExtractsMockTests.java | 95 - ...MetalMachinesRunReadCommandsMockTests.java | 93 - .../BareMetalMachinesStartMockTests.java | 78 - .../BareMetalMachinesUncordonMockTests.java | 77 - .../generated/BgpAdvertisementTests.java | 37 - .../generated/BmcKeySetsDeleteMockTests.java | 51 - .../CloudServicesNetworkInnerTests.java | 80 - .../CloudServicesNetworkListTests.java | 70 - ...udServicesNetworkPatchParametersTests.java | 76 - ...udServicesNetworkPatchPropertiesTests.java | 73 - .../CloudServicesNetworkPropertiesTests.java | 60 - ...rvicesNetworksCreateOrUpdateMockTests.java | 98 - .../CloudServicesNetworksDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 66 - ...sNetworksListByResourceGroupMockTests.java | 68 - .../CloudServicesNetworksListMockTests.java | 67 - .../ClusterAvailableUpgradeVersionTests.java | 23 - .../ClusterAvailableVersionTests.java | 23 - .../generated/ClusterCapacityTests.java | 47 - .../ClusterDeployParametersTests.java | 28 - .../generated/ClusterManagerInnerTests.java | 63 - .../generated/ClusterManagerListTests.java | 93 - .../ClusterManagerPatchParametersTests.java | 41 - .../ClusterManagerPropertiesTests.java | 43 - ...lusterManagersCreateOrUpdateMockTests.java | 90 - .../ClusterManagersDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 65 - ...rManagersListByResourceGroupMockTests.java | 66 - .../ClusterManagersListMockTests.java | 65 - ...ClusterMetricsConfigurationInnerTests.java | 56 - .../ClusterMetricsConfigurationListTests.java | 66 - ...ricsConfigurationPatchParametersTests.java | 48 - ...ricsConfigurationPatchPropertiesTests.java | 31 - ...erMetricsConfigurationPropertiesTests.java | 31 - .../ClusterUpdateVersionParametersTests.java | 26 - .../generated/ClustersDeleteMockTests.java | 51 - .../generated/ClustersDeployMockTests.java | 81 - .../ClustersUpdateVersionMockTests.java | 80 - .../generated/ConsolesDeleteMockTests.java | 51 - ...ntrolPlaneNodePatchConfigurationTests.java | 26 - .../generated/EgressEndpointTests.java | 37 - .../generated/EndpointDependencyTests.java | 27 - .../generated/ExtendedLocationTests.java | 27 - .../generated/FeatureStatusTests.java | 23 - ...ardwareInventoryNetworkInterfaceTests.java | 23 - .../generated/HardwareInventoryTests.java | 23 - .../HardwareValidationStatusTests.java | 23 - .../generated/IpAddressPoolTests.java | 38 - .../generated/KeySetUserStatusTests.java | 23 - ...KubernetesClusterPatchParametersTests.java | 49 - ...KubernetesClusterPatchPropertiesTests.java | 31 - ...etesClusterRestartNodeParametersTests.java | 26 - .../KubernetesClustersDeleteMockTests.java | 51 - ...ubernetesClustersRestartNodeMockTests.java | 81 - ...L2NetworkAttachmentConfigurationTests.java | 30 - .../generated/L2NetworkInnerTests.java | 60 - .../generated/L2NetworkListTests.java | 83 - .../L2NetworkPatchParametersTests.java | 41 - .../generated/L2NetworkPropertiesTests.java | 33 - .../L2NetworksCreateOrUpdateMockTests.java | 87 - .../generated/L2NetworksDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 65 - ...2NetworksListByResourceGroupMockTests.java | 65 - .../generated/L2NetworksListMockTests.java | 64 - ...L3NetworkAttachmentConfigurationTests.java | 35 - .../generated/L3NetworkInnerTests.java | 76 - .../generated/L3NetworkListTests.java | 98 - .../L3NetworkPatchParametersTests.java | 40 - .../generated/L3NetworkPropertiesTests.java | 50 - .../L3NetworksCreateOrUpdateMockTests.java | 99 - .../generated/L3NetworksDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 72 - ...3NetworksListByResourceGroupMockTests.java | 72 - .../generated/L3NetworksListMockTests.java | 71 - .../generated/LldpNeighborTests.java | 23 - .../generated/MachineDiskTests.java | 23 - .../generated/MachineSkuPropertiesTests.java | 23 - .../generated/MachineSkuSlotTests.java | 23 - ...anagedResourceGroupConfigurationTests.java | 28 - ...ConfigurationsCreateOrUpdateMockTests.java | 85 - .../MetricsConfigurationsDeleteMockTests.java | 51 - ...onfigurationsGetWithResponseMockTests.java | 63 - ...sConfigurationsListByClusterMockTests.java | 63 - .../generated/NetworkAttachmentTests.java | 43 - .../generated/NetworkInterfaceTests.java | 23 - .../networkcloud/generated/NicTests.java | 23 - .../generated/OperationDisplayTests.java | 23 - .../generated/OperationInnerTests.java | 24 - .../generated/OperationListResultTests.java | 23 - .../OperationStatusResultInnerTests.java | 161 - .../generated/OperationsListMockTests.java | 54 - .../networkcloud/generated/OsDiskTests.java | 35 - .../generated/RackInnerTests.java | 61 - .../networkcloud/generated/RackListTests.java | 94 - .../generated/RackPatchParametersTests.java | 47 - .../generated/RackPropertiesTests.java | 35 - .../generated/RackSkuInnerTests.java | 23 - .../generated/RackSkuListTests.java | 29 - .../generated/RackSkuPropertiesTests.java | 23 - .../RackSkusGetWithResponseMockTests.java | 53 - .../generated/RackSkusListMockTests.java | 54 - .../RacksCreateOrUpdateMockTests.java | 89 - .../generated/RacksDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 65 - .../RacksListByResourceGroupMockTests.java | 64 - .../generated/RacksListMockTests.java | 64 - .../generated/RacksPatchPropertiesTests.java | 29 - ...RemoteVendorManagementParametersTests.java | 28 - .../StorageAppliancePatchParametersTests.java | 44 - .../StorageAppliancePatchPropertiesTests.java | 26 - .../StorageApplianceSkuPropertiesTests.java | 23 - .../StorageApplianceSkuSlotTests.java | 23 - .../StorageAppliancesDeleteMockTests.java | 51 - ...isableRemoteVendorManagementMockTests.java | 78 - ...EnableRemoteVendorManagementMockTests.java | 83 - .../generated/StorageProfileTests.java | 40 - ...edNetworkAttachmentConfigurationTests.java | 31 - .../generated/TrunkedNetworkInnerTests.java | 63 - .../generated/TrunkedNetworkListTests.java | 77 - .../TrunkedNetworkPatchParametersTests.java | 41 - .../TrunkedNetworkPropertiesTests.java | 39 - ...runkedNetworksCreateOrUpdateMockTests.java | 90 - .../TrunkedNetworksDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 66 - ...dNetworksListByResourceGroupMockTests.java | 66 - .../TrunkedNetworksListMockTests.java | 65 - .../generated/ValidationThresholdTests.java | 34 - .../VirtualMachinePlacementHintTests.java | 39 - ...VirtualMachinePowerOffParametersTests.java | 27 - .../VirtualMachinesDeleteMockTests.java | 51 - .../VirtualMachinesPowerOffMockTests.java | 80 - .../VirtualMachinesReimageMockTests.java | 77 - .../VirtualMachinesRestartMockTests.java | 77 - .../VirtualMachinesStartMockTests.java | 78 - .../generated/VolumeInnerTests.java | 52 - .../generated/VolumeListTests.java | 57 - .../generated/VolumePatchParametersTests.java | 39 - .../generated/VolumePropertiesTests.java | 26 - .../VolumesCreateOrUpdateMockTests.java | 82 - .../generated/VolumesDeleteMockTests.java | 51 - ...tByResourceGroupWithResponseMockTests.java | 62 - .../VolumesListByResourceGroupMockTests.java | 62 - .../generated/VolumesListMockTests.java | 61 - 709 files changed, 38951 insertions(+), 25608 deletions(-) create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClusterFeaturesClient.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureInner.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeaturePatchProperties.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureProperties.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultProperties.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeatureImpl.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesClientImpl.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesImpl.java rename sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/{Utils.java => ResourceManagerUtils.java} (88%) create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfigurationPatch.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AnalyticsOutputSettings.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionMachineGroupTargetingMode.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionParameters.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParameters.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParametersScanActivity.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchive.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchiveEnabled.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategy.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategyType.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommandOutputSettings.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IdentitySelector.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeature.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureAvailabilityLifecycle.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureDetailedStatus.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureList.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeaturePatchParameters.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureProvisioningState.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureRequired.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatures.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2ServiceLoadBalancerConfiguration.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentity.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentitySelectorType.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentityType.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodePoolAdministratorConfigurationPatch.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionConfiguration.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionEnforcementLevel.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionStatus.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveReference.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveSettings.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretRotationStatus.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StringKeyValuePair.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/UserAssignedIdentity.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettings.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsContainerScan.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsPatch.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/proxy-config.json create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/reflect-config.json create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersContinueUpdateVersionSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersScanRuntimeSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesCreateOrUpdateSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesDeleteSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesGetSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesListByKubernetesClusterSamples.java create mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesUpdateSamples.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AadConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentOptionsTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolUpgradeSettingsTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AttachedNetworkConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AvailableUpgradeTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCommandSpecificationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCordonParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePowerOffParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunCommandParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunDataExtractsParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunReadCommandsParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BgpAdvertisementTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableUpgradeVersionTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableVersionTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterCapacityTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterDeployParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterUpdateVersionParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeployMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ControlPlaneNodePatchConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EgressEndpointTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EndpointDependencyTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ExtendedLocationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/FeatureStatusTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryNetworkInterfaceTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareValidationStatusTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/IpAddressPoolTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KeySetUserStatusTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterRestartNodeParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkAttachmentConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkAttachmentConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/LldpNeighborTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineDiskTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuSlotTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ManagedResourceGroupConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkAttachmentTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkInterfaceTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NicTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationDisplayTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationListResultTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationStatusResultInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationsListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OsDiskTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksPatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceEnableRemoteVendorManagementParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuSlotTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageProfileTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkAttachmentConfigurationTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ValidationThresholdTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePlacementHintTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePowerOffParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeInnerTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeListTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePatchParametersTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePropertiesTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupMockTests.java delete mode 100644 sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListMockTests.java diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md index 9abe365c4653d..5dfa855693095 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md @@ -1,14 +1,839 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-11-11) -### Features Added +- Azure Resource Manager NetworkCloud client library for Java. This package contains Microsoft Azure SDK for NetworkCloud Management SDK. The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, hardware resources, and workload infrastructure resources. Package tag package-2024-10-01-preview. 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.BareMetalMachineKeySets` was modified + +* `void delete(java.lang.String,java.lang.String,java.lang.String)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.Racks` was modified + +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.StorageAppliances` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` + +#### `models.Clusters` was modified + +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.MetricsConfigurations` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,java.lang.String)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.Volumes` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` + +#### `models.KubernetesClusters` was modified + +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.Consoles` was modified + +* `void delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,java.lang.String)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.L3Networks` was modified + +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.CloudServicesNetworks` was modified + +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.ClusterManagers` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.AgentPools` was modified + +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,java.lang.String)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.BmcKeySets` was modified + +* `void delete(java.lang.String,java.lang.String,java.lang.String)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.BareMetalMachines` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` + +#### `models.VirtualMachines` was modified + +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` + +#### `models.TrunkedNetworks` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +#### `models.L2Networks` was modified + +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `void delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.OperationStatusResult delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` +* `void deleteByResourceGroup(java.lang.String,java.lang.String)` -> `models.OperationStatusResult deleteByResourceGroup(java.lang.String,java.lang.String)` +* `void deleteById(java.lang.String)` -> `models.OperationStatusResult deleteById(java.lang.String)` + +### Features Added + +* `models.ClusterContinueUpdateVersionParameters` was added + +* `models.KubernetesClusterFeatureProvisioningState` was added + +* `models.ClusterUpdateStrategyType` was added + +* `models.VulnerabilityScanningSettingsPatch` was added + +* `models.RuntimeProtectionConfiguration` was added + +* `models.NodePoolAdministratorConfigurationPatch` was added + +* `models.KubernetesClusterFeature$Update` was added + +* `models.UserAssignedIdentity` was added + +* `models.KubernetesClusterFeatureAvailabilityLifecycle` was added + +* `models.AdministratorConfigurationPatch` was added + +* `models.IdentitySelector` was added + +* `models.VulnerabilityScanningSettingsContainerScan` was added + +* `models.ClusterScanRuntimeParametersScanActivity` was added + +* `models.L2ServiceLoadBalancerConfiguration` was added + +* `models.KubernetesClusterFeatureRequired` was added + +* `models.KubernetesClusterFeatureDetailedStatus` was added + +* `models.KubernetesClusterFeatures` was added + +* `models.ClusterUpdateStrategy` was added + +* `models.KubernetesClusterFeaturePatchParameters` was added + +* `models.KubernetesClusterFeature$Definition` was added + +* `models.KubernetesClusterFeature$UpdateStages` was added + +* `models.KubernetesClusterFeature$DefinitionStages` was added + +* `models.ManagedServiceIdentitySelectorType` was added + +* `models.ManagedServiceIdentity` was added + +* `models.RuntimeProtectionEnforcementLevel` was added + +* `models.ClusterScanRuntimeParameters` was added + +* `models.SecretRotationStatus` was added + +* `models.KubernetesClusterFeature` was added + +* `models.StringKeyValuePair` was added + +* `models.VulnerabilityScanningSettings` was added + +* `models.SecretArchiveReference` was added + +* `models.KubernetesClusterFeatureList` was added + +* `models.SecretArchiveSettings` was added + +* `models.CommandOutputSettings` was added + +* `models.AnalyticsOutputSettings` was added + +* `models.ClusterContinueUpdateVersionMachineGroupTargetingMode` was added + +* `models.RuntimeProtectionStatus` was added + +* `models.ClusterSecretArchive` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.ClusterSecretArchiveEnabled` was added + +#### `models.VirtualMachinePatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EndpointDependency` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachineKeySetList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BareMetalMachinePowerOffParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BareMetalMachineCordonParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Nic` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AgentPool$Update` was modified + +* `withAdministratorConfiguration(models.NodePoolAdministratorConfigurationPatch)` was added + +#### `models.ServicePrincipalInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterMetricsConfigurationList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachine` was modified + +* `secretRotationStatus()` was added +* `runtimeProtectionStatus()` was added +* `machineRoles()` was added +* `machineClusterVersion()` was added + +#### `models.TrunkedNetworkAttachmentConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BmcKeySetList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageApplianceEnableRemoteVendorManagementParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterManagerList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KeySetUserStatus` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterDeployParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterCapacity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterAvailableUpgradeVersion` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MachineDisk` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KubernetesClusterList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CloudServicesNetworkList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachineKeySetPatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NetworkConfiguration` was modified + +* `l2ServiceLoadBalancerConfiguration()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withL2ServiceLoadBalancerConfiguration(models.L2ServiceLoadBalancerConfiguration)` was added + +#### `models.IpAddressPool` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AgentOptions` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RackPatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterManagerPatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `identity()` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.BareMetalMachineCommandSpecification` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Cluster` was modified + +* `runtimeProtectionConfiguration()` was added +* `commandOutputSettings()` was added +* `analyticsOutputSettings()` was added +* `secretArchiveSettings()` was added +* `secretArchive()` was added +* `identity()` was added +* `continueUpdateVersion(models.ClusterContinueUpdateVersionParameters,com.azure.core.util.Context)` was added +* `updateStrategy()` was added +* `scanRuntime(models.ClusterScanRuntimeParameters,com.azure.core.util.Context)` was added +* `vulnerabilityScanningSettings()` was added +* `scanRuntime()` was added +* `continueUpdateVersion(models.ClusterContinueUpdateVersionParameters)` was added + +#### `models.AadConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BareMetalMachineRunReadCommandsParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConsolePatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Clusters` was modified + +* `continueUpdateVersion(java.lang.String,java.lang.String,models.ClusterContinueUpdateVersionParameters)` was added +* `continueUpdateVersion(java.lang.String,java.lang.String,models.ClusterContinueUpdateVersionParameters,com.azure.core.util.Context)` was added +* `scanRuntime(java.lang.String,java.lang.String)` was added +* `scanRuntime(java.lang.String,java.lang.String,models.ClusterScanRuntimeParameters,com.azure.core.util.Context)` was added + +#### `models.HardwareValidationStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ControlPlaneNodeConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BgpAdvertisement` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KubernetesLabel` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachineReplaceParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationStatusResult` was modified + +* `resultUrl()` was added +* `resultRef()` was added +* `exitCode()` was added +* `outputHead()` was added + +#### `models.BareMetalMachineList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LldpNeighbor` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageAppliance` was modified + +* `model()` was added +* `manufacturer()` was added +* `version()` was added +* `secretRotationStatus()` was added + +#### `models.AgentPoolPatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withAdministratorConfiguration(models.NodePoolAdministratorConfigurationPatch)` was added +* `administratorConfiguration()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualMachinePowerOffParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CloudServicesNetworkPatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageApplianceList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ValidationThreshold` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FeatureStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachinePatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ExtendedLocation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BareMetalMachine$Definition` was modified + +* `withMachineClusterVersion(java.lang.String)` was added + +#### `models.TrunkedNetworkList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedResourceGroupConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TrunkedNetworkPatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HardwareInventory` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageRepositoryCredentials` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachineRunDataExtractsParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BareMetalMachineRunCommandParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterPatchParameters` was modified + +* `withSecretArchive(models.ClusterSecretArchive)` was added +* `withSecretArchiveSettings(models.SecretArchiveSettings)` was added +* `vulnerabilityScanningSettings()` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `updateStrategy()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `commandOutputSettings()` was added +* `withVulnerabilityScanningSettings(models.VulnerabilityScanningSettingsPatch)` was added +* `analyticsOutputSettings()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `runtimeProtectionConfiguration()` was added +* `secretArchiveSettings()` was added +* `withRuntimeProtectionConfiguration(models.RuntimeProtectionConfiguration)` was added +* `identity()` was added +* `withUpdateStrategy(models.ClusterUpdateStrategy)` was added +* `secretArchive()` was added +* `withCommandOutputSettings(models.CommandOutputSettings)` was added +* `withAnalyticsOutputSettings(models.AnalyticsOutputSettings)` was added + +#### `models.VirtualMachine$Definition` was modified + +* `withConsoleExtendedLocation(models.ExtendedLocation)` was added + +#### `models.OsDisk` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterManager$Update` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.ControlPlaneNodePatchConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withAdministratorConfiguration(models.AdministratorConfigurationPatch)` was added +* `administratorConfiguration()` was added + +#### `models.RackList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.L3NetworkPatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `NetworkCloudManager` was modified + +* `kubernetesClusterFeatures()` was added + +#### `models.BgpServiceLoadBalancerConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AdministratorConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VolumeList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterAvailableVersion` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageApplianceSkuSlot` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AdministrativeCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualMachineList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BareMetalMachineConfigurationData` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BmcKeySetPatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshPublicKey` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RackSkuList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClusterUpdateVersionParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConsoleList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AgentPoolUpgradeSettings` was modified + +* `maxUnavailable()` was added +* `withMaxUnavailable(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withDrainTimeout(java.lang.Long)` was added +* `drainTimeout()` was added + +#### `models.ClusterManager$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.KeySetUser` was modified + +* `userPrincipalName()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withUserPrincipalName(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VolumePatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualMachine` was modified + +* `consoleExtendedLocation()` was added + +#### `models.AgentPoolList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NetworkAttachment` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HardwareInventoryNetworkInterface` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KubernetesCluster$Update` was modified + +* `withAdministratorConfiguration(models.AdministratorConfigurationPatch)` was added + +#### `models.AvailableUpgrade` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Cluster$Definition` was modified + +* `withVulnerabilityScanningSettings(models.VulnerabilityScanningSettings)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSecretArchiveSettings(models.SecretArchiveSettings)` was added +* `withRuntimeProtectionConfiguration(models.RuntimeProtectionConfiguration)` was added +* `withCommandOutputSettings(models.CommandOutputSettings)` was added +* `withUpdateStrategy(models.ClusterUpdateStrategy)` was added +* `withSecretArchive(models.ClusterSecretArchive)` was added +* `withAnalyticsOutputSettings(models.AnalyticsOutputSettings)` was added + +#### `models.KubernetesClusterRestartNodeParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EgressEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.L3NetworkAttachmentConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Cluster$Update` was modified + +* `withVulnerabilityScanningSettings(models.VulnerabilityScanningSettingsPatch)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSecretArchive(models.ClusterSecretArchive)` was added +* `withSecretArchiveSettings(models.SecretArchiveSettings)` was added +* `withAnalyticsOutputSettings(models.AnalyticsOutputSettings)` was added +* `withUpdateStrategy(models.ClusterUpdateStrategy)` was added +* `withRuntimeProtectionConfiguration(models.RuntimeProtectionConfiguration)` was added +* `withCommandOutputSettings(models.CommandOutputSettings)` was added + +#### `models.StorageApplianceConfigurationData` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AttachedNetworkConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.L3NetworkList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MachineSkuSlot` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.L2NetworkPatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.StorageAppliancePatchParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KubernetesClusterPatchParameters` was modified + +* `administratorConfiguration()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withAdministratorConfiguration(models.AdministratorConfigurationPatch)` was added + +#### `models.RackDefinition` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualMachinePlacementHint` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterMetricsConfigurationPatchParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.L2NetworkAttachmentConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.L2NetworkList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KubernetesClusterNode` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NetworkInterface` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationDisplay` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterManager` was modified + +* `identity()` was added + +#### `models.ServiceLoadBalancerBgpPeer` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.InitialAgentPoolConfiguration` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.0.0 (2023-08-25) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md index b475ca1675701..72e5eb984cbea 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md @@ -2,7 +2,7 @@ Azure Resource Manager NetworkCloud client library for Java. -This package contains Microsoft Azure SDK for NetworkCloud Management SDK. The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. Package tag package-2023-07-01. 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 NetworkCloud Management SDK. The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, hardware resources, and workload infrastructure resources. Package tag package-2024-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-networkcloud - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +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); @@ -94,9 +90,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_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/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md index 73e1682809540..465ec957ff09a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md @@ -64,12 +64,14 @@ ## Clusters +- [ContinueUpdateVersion](#clusters_continueupdateversion) - [CreateOrUpdate](#clusters_createorupdate) - [Delete](#clusters_delete) - [Deploy](#clusters_deploy) - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) +- [ScanRuntime](#clusters_scanruntime) - [Update](#clusters_update) - [UpdateVersion](#clusters_updateversion) @@ -81,6 +83,14 @@ - [ListByVirtualMachine](#consoles_listbyvirtualmachine) - [Update](#consoles_update) +## KubernetesClusterFeatures + +- [CreateOrUpdate](#kubernetesclusterfeatures_createorupdate) +- [Delete](#kubernetesclusterfeatures_delete) +- [Get](#kubernetesclusterfeatures_get) +- [ListByKubernetesCluster](#kubernetesclusterfeatures_listbykubernetescluster) +- [Update](#kubernetesclusterfeatures_update) + ## KubernetesClusters - [CreateOrUpdate](#kubernetesclusters_createorupdate) @@ -197,64 +207,52 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for AgentPools CreateOrUpdate. */ +/** + * Samples for AgentPools CreateOrUpdate. + */ public final class AgentPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Create.json */ /** * Sample code: Create or update Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + createOrUpdateKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .define("agentPoolName") .withRegion("location") .withExistingKubernetesCluster("resourceGroupName", "kubernetesClusterName") .withCount(3L) .withMode(AgentPoolMode.SYSTEM) - .withVmSkuName("NC_M16_v1") + .withVmSkuName("NC_P46_224_v1") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) .withAvailabilityZones(Arrays.asList("1", "2", "3")) .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withTaints(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) .create(); } @@ -276,20 +274,23 @@ public final class AgentPoolsCreateOrUpdateSamples { ### AgentPools_Delete ```java -/** Samples for AgentPools Delete. */ +/** + * Samples for AgentPools Delete. + */ public final class AgentPoolsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Delete.json */ /** * Sample code: Delete Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + deleteKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .delete("resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE); } } @@ -298,22 +299,25 @@ public final class AgentPoolsDeleteSamples { ### AgentPools_Get ```java -/** Samples for AgentPools Get. */ +/** + * Samples for AgentPools Get. + */ public final class AgentPoolsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Get.json */ /** * Sample code: Get Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() - .getWithResponse( - "resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE); + public static void + getKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "agentPoolName", + com.azure.core.util.Context.NONE); } } ``` @@ -321,20 +325,23 @@ public final class AgentPoolsGetSamples { ### AgentPools_ListByKubernetesCluster ```java -/** Samples for AgentPools ListByKubernetesCluster. */ +/** + * Samples for AgentPools ListByKubernetesCluster. + */ public final class AgentPoolsListByKubernetesClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_ListByKubernetesCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_ListByKubernetesCluster.json */ /** * Sample code: List agent pools of the Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listAgentPoolsOfTheKubernetesCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + listAgentPoolsOfTheKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .listByKubernetesCluster("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); } } @@ -345,32 +352,39 @@ public final class AgentPoolsListByKubernetesClusterSamples { ```java import com.azure.resourcemanager.networkcloud.models.AgentPool; import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.networkcloud.models.NodePoolAdministratorConfigurationPatch; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for AgentPools Update. */ +/** + * Samples for AgentPools Update. + */ public final class AgentPoolsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Patch.json */ /** * Sample code: Patch Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - AgentPool resource = - manager - .agentPools() - .getWithResponse( - "resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + AgentPool resource = manager.agentPools() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "agentPoolName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAdministratorConfiguration(new NodePoolAdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withCount(3L) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withUpgradeSettings( + new AgentPoolUpgradeSettings().withDrainTimeout(1800L).withMaxSurge("1").withMaxUnavailable("0")) .apply(); } @@ -400,43 +414,42 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachineKeySets CreateOrUpdate. */ +/** + * Samples for BareMetalMachineKeySets CreateOrUpdate. + */ public final class BareMetalMachineKeySetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Create.json */ /** * Sample code: Create or update bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateBareMetalMachineKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + manager.bareMetalMachineKeySets() .define("bareMetalMachineKeySetName") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) .withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel.STANDARD) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withOsGroupName("standardAccessGroup") .create(); @@ -459,20 +472,23 @@ public final class BareMetalMachineKeySetsCreateOrUpdateSamples { ### BareMetalMachineKeySets_Delete ```java -/** Samples for BareMetalMachineKeySets Delete. */ +/** + * Samples for BareMetalMachineKeySets Delete. + */ public final class BareMetalMachineKeySetsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Delete.json */ /** * Sample code: Delete bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + public static void + deleteBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() .delete("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); } } @@ -481,22 +497,25 @@ public final class BareMetalMachineKeySetsDeleteSamples { ### BareMetalMachineKeySets_Get ```java -/** Samples for BareMetalMachineKeySets Get. */ +/** + * Samples for BareMetalMachineKeySets Get. + */ public final class BareMetalMachineKeySetsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Get.json */ /** * Sample code: Get bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() - .getWithResponse( - "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + public static void + getBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", + com.azure.core.util.Context.NONE); } } ``` @@ -504,20 +523,23 @@ public final class BareMetalMachineKeySetsGetSamples { ### BareMetalMachineKeySets_ListByCluster ```java -/** Samples for BareMetalMachineKeySets ListByCluster. */ +/** + * Samples for BareMetalMachineKeySets ListByCluster. + */ public final class BareMetalMachineKeySetsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_ListByCluster.json */ /** * Sample code: List bare metal machine key sets of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachineKeySetsOfTheCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + public static void + listBareMetalMachineKeySetsOfTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() .listByCluster("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } @@ -534,40 +556,39 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachineKeySets Update. */ +/** + * Samples for BareMetalMachineKeySets Update. + */ public final class BareMetalMachineKeySetsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Patch.json */ /** * Sample code: Patch bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BareMetalMachineKeySet resource = - manager - .bareMetalMachineKeySets() - .getWithResponse( - "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachineKeySet resource = manager.bareMetalMachineKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .apply(); } @@ -591,22 +612,23 @@ public final class BareMetalMachineKeySetsUpdateSamples { import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; -/** Samples for BareMetalMachines Cordon. */ +/** + * Samples for BareMetalMachines Cordon. + */ public final class BareMetalMachinesCordonSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Cordon.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Cordon.json */ /** * Sample code: Cordon bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void cordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .cordon( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .cordon("resourceGroupName", "bareMetalMachineName", new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.TRUE), com.azure.core.util.Context.NONE); } @@ -621,28 +643,29 @@ import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachines CreateOrUpdate. */ +/** + * Samples for BareMetalMachines CreateOrUpdate. + */ public final class BareMetalMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Create.json */ /** * Sample code: Create or update bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + public static void + createOrUpdateBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() .define("bareMetalMachineName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withBmcConnectionString("bmcconnectionstring") .withBmcCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) @@ -676,19 +699,22 @@ public final class BareMetalMachinesCreateOrUpdateSamples { ### BareMetalMachines_Delete ```java -/** Samples for BareMetalMachines Delete. */ +/** + * Samples for BareMetalMachines Delete. + */ public final class BareMetalMachinesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Delete.json */ /** * Sample code: Delete bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .delete("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } @@ -697,21 +723,24 @@ public final class BareMetalMachinesDeleteSamples { ### BareMetalMachines_GetByResourceGroup ```java -/** Samples for BareMetalMachines GetByResourceGroup. */ +/** + * Samples for BareMetalMachines GetByResourceGroup. + */ public final class BareMetalMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Get.json */ /** * Sample code: Get bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + manager.bareMetalMachines() + .getByResourceGroupWithResponse("resourceGroupName", "bareMetalMachineName", + com.azure.core.util.Context.NONE); } } ``` @@ -719,18 +748,22 @@ public final class BareMetalMachinesGetByResourceGroupSamples { ### BareMetalMachines_List ```java -/** Samples for BareMetalMachines List. */ +/** + * Samples for BareMetalMachines List. + */ public final class BareMetalMachinesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_ListBySubscription.json */ /** * Sample code: List bare metal machines for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachinesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listBareMetalMachinesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.bareMetalMachines().list(com.azure.core.util.Context.NONE); } } @@ -739,18 +772,22 @@ public final class BareMetalMachinesListSamples { ### BareMetalMachines_ListByResourceGroup ```java -/** Samples for BareMetalMachines ListByResourceGroup. */ +/** + * Samples for BareMetalMachines ListByResourceGroup. + */ public final class BareMetalMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_ListByResourceGroup.json */ /** * Sample code: List bare metal machines for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachinesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listBareMetalMachinesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.bareMetalMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -762,22 +799,23 @@ public final class BareMetalMachinesListByResourceGroupSamples { import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; -/** Samples for BareMetalMachines PowerOff. */ +/** + * Samples for BareMetalMachines PowerOff. + */ public final class BareMetalMachinesPowerOffSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_PowerOff.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_PowerOff.json */ /** * Sample code: Power off bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void powerOffBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .powerOff( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .powerOff("resourceGroupName", "bareMetalMachineName", new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.TRUE), com.azure.core.util.Context.NONE); } @@ -787,19 +825,22 @@ public final class BareMetalMachinesPowerOffSamples { ### BareMetalMachines_Reimage ```java -/** Samples for BareMetalMachines Reimage. */ +/** + * Samples for BareMetalMachines Reimage. + */ public final class BareMetalMachinesReimageSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Reimage.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Reimage.json */ /** * Sample code: Reimage bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void reimageBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .reimage("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } @@ -811,22 +852,23 @@ public final class BareMetalMachinesReimageSamples { import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; -/** Samples for BareMetalMachines Replace. */ +/** + * Samples for BareMetalMachines Replace. + */ public final class BareMetalMachinesReplaceSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Replace.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Replace.json */ /** * Sample code: Replace bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void replaceBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .replace( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .replace("resourceGroupName", "bareMetalMachineName", new BareMetalMachineReplaceParameters() .withBmcCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) @@ -842,19 +884,22 @@ public final class BareMetalMachinesReplaceSamples { ### BareMetalMachines_Restart ```java -/** Samples for BareMetalMachines Restart. */ +/** + * Samples for BareMetalMachines Restart. + */ public final class BareMetalMachinesRestartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Restart.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Restart.json */ /** * Sample code: Restart bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void restartBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .restart("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } @@ -866,25 +911,25 @@ public final class BareMetalMachinesRestartSamples { import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunCommand. */ +/** + * Samples for BareMetalMachines RunCommand. + */ public final class BareMetalMachinesRunCommandSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunCommand.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunCommand.json */ /** * Sample code: Run command on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void runCommandOnBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runCommand( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunCommandParameters() - .withArguments(Arrays.asList("--argument1", "argument2")) + public static void + runCommandOnBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() + .runCommand("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunCommandParameters().withArguments(Arrays.asList("--argument1", "argument2")) .withLimitTimeSeconds(60L) .withScript("cHdkCg=="), com.azure.core.util.Context.NONE); @@ -899,30 +944,27 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpec import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunDataExtracts. */ +/** + * Samples for BareMetalMachines RunDataExtracts. + */ public final class BareMetalMachinesRunDataExtractsSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunDataExtracts.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunDataExtracts.json */ /** * Sample code: Run data extraction on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void runDataExtractionOnBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runDataExtracts( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunDataExtractsParameters() - .withCommands( - Arrays - .asList( - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("SysInfo", "TTYLog")) - .withCommand("hardware-support-data-collection"))) + public static void + runDataExtractionOnBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() + .runDataExtracts("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunDataExtractsParameters().withCommands(Arrays + .asList(new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("SysInfo", "TTYLog")) + .withCommand("hardware-support-data-collection"))) .withLimitTimeSeconds(60L), com.azure.core.util.Context.NONE); } @@ -936,33 +978,29 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpec import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunReadCommands. */ +/** + * Samples for BareMetalMachines RunReadCommands. + */ public final class BareMetalMachinesRunReadCommandsSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunReadCommands.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunReadCommands.json */ /** * Sample code: Run and retrieve output from read only commands on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runReadCommands( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunReadCommandsParameters() - .withCommands( - Arrays - .asList( - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("pods", "-A")) - .withCommand("kubectl get"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("192.168.0.99", "-c", "3")) - .withCommand("ping"))) + manager.bareMetalMachines() + .runReadCommands("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunReadCommandsParameters().withCommands(Arrays.asList( + new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("pods", "-A")) + .withCommand("kubectl get"), + new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("192.168.0.99", "-c", "3")) + .withCommand("ping"))) .withLimitTimeSeconds(60L), com.azure.core.util.Context.NONE); } @@ -972,19 +1010,22 @@ public final class BareMetalMachinesRunReadCommandsSamples { ### BareMetalMachines_Start ```java -/** Samples for BareMetalMachines Start. */ +/** + * Samples for BareMetalMachines Start. + */ public final class BareMetalMachinesStartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Start.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Start.json */ /** * Sample code: Start bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void startBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .start("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } @@ -993,19 +1034,22 @@ public final class BareMetalMachinesStartSamples { ### BareMetalMachines_Uncordon ```java -/** Samples for BareMetalMachines Uncordon. */ +/** + * Samples for BareMetalMachines Uncordon. + */ public final class BareMetalMachinesUncordonSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Uncordon.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Uncordon.json */ /** * Sample code: Uncordon bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void uncordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .uncordon("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } @@ -1018,25 +1062,26 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachine; import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachines Update. */ +/** + * Samples for BareMetalMachines Update. + */ public final class BareMetalMachinesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Patch.json */ /** * Sample code: Patch bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BareMetalMachine resource = - manager - .bareMetalMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + BareMetalMachine resource = manager.bareMetalMachines() + .getByResourceGroupWithResponse("resourceGroupName", "bareMetalMachineName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withMachineDetails("machinedetails") .apply(); @@ -1068,42 +1113,41 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for BmcKeySets CreateOrUpdate. */ +/** + * Samples for BmcKeySets CreateOrUpdate. + */ public final class BmcKeySetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Create.json */ /** * Sample code: Create or update baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .define("bmcKeySetName") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withPrivilegeLevel(BmcKeySetPrivilegeLevel.ADMINISTRATOR) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } @@ -1125,20 +1169,23 @@ public final class BmcKeySetsCreateOrUpdateSamples { ### BmcKeySets_Delete ```java -/** Samples for BmcKeySets Delete. */ +/** + * Samples for BmcKeySets Delete. + */ public final class BmcKeySetsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Delete.json */ /** * Sample code: Delete baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .delete("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); } } @@ -1147,20 +1194,23 @@ public final class BmcKeySetsDeleteSamples { ### BmcKeySets_Get ```java -/** Samples for BmcKeySets Get. */ +/** + * Samples for BmcKeySets Get. + */ public final class BmcKeySetsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Get.json */ /** * Sample code: Get baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); } } @@ -1169,14 +1219,18 @@ public final class BmcKeySetsGetSamples { ### BmcKeySets_ListByCluster ```java -/** Samples for BmcKeySets ListByCluster. */ +/** + * Samples for BmcKeySets ListByCluster. + */ public final class BmcKeySetsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_ListByCluster.json */ /** * Sample code: List baseboard management controller key sets of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listBaseboardManagementControllerKeySetsOfTheCluster( @@ -1197,38 +1251,37 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for BmcKeySets Update. */ +/** + * Samples for BmcKeySets Update. + */ public final class BmcKeySetsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Patch.json */ /** * Sample code: Patch baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BmcKeySet resource = - manager - .bmcKeySets() - .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + BmcKeySet resource = manager.bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .apply(); } @@ -1257,40 +1310,33 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for CloudServicesNetworks CreateOrUpdate. */ +/** + * Samples for CloudServicesNetworks CreateOrUpdate. + */ public final class CloudServicesNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Create.json */ /** * Sample code: Create or update cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateCloudServicesNetwork( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() + public static void + createOrUpdateCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks() .define("cloudServicesNetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAdditionalEgressEndpoints( - Arrays - .asList( - new EgressEndpoint() - .withCategory("azure-resource-management") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("https://storageaccountex.blob.core.windows.net") - .withPort(443L))))) + .withAdditionalEgressEndpoints(Arrays.asList(new EgressEndpoint().withCategory("azure-resource-management") + .withEndpoints(Arrays.asList( + new EndpointDependency().withDomainName("storageaccountex.blob.core.windows.net").withPort(443L))))) .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) .create(); } @@ -1312,19 +1358,22 @@ public final class CloudServicesNetworksCreateOrUpdateSamples { ### CloudServicesNetworks_Delete ```java -/** Samples for CloudServicesNetworks Delete. */ +/** + * Samples for CloudServicesNetworks Delete. + */ public final class CloudServicesNetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Delete.json */ /** * Sample code: Delete cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() + manager.cloudServicesNetworks() .delete("resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); } } @@ -1333,21 +1382,24 @@ public final class CloudServicesNetworksDeleteSamples { ### CloudServicesNetworks_GetByResourceGroup ```java -/** Samples for CloudServicesNetworks GetByResourceGroup. */ +/** + * Samples for CloudServicesNetworks GetByResourceGroup. + */ public final class CloudServicesNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Get.json */ /** * Sample code: Get cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + manager.cloudServicesNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "cloudServicesNetworkName", + com.azure.core.util.Context.NONE); } } ``` @@ -1355,18 +1407,22 @@ public final class CloudServicesNetworksGetByResourceGroupSamples { ### CloudServicesNetworks_List ```java -/** Samples for CloudServicesNetworks List. */ +/** + * Samples for CloudServicesNetworks List. + */ public final class CloudServicesNetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_ListBySubscription.json */ /** * Sample code: List cloud services networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listCloudServicesNetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listCloudServicesNetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.cloudServicesNetworks().list(com.azure.core.util.Context.NONE); } } @@ -1375,18 +1431,22 @@ public final class CloudServicesNetworksListSamples { ### CloudServicesNetworks_ListByResourceGroup ```java -/** Samples for CloudServicesNetworks ListByResourceGroup. */ +/** + * Samples for CloudServicesNetworks ListByResourceGroup. + */ public final class CloudServicesNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_ListByResourceGroup.json */ /** * Sample code: List cloud services networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listCloudServicesNetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listCloudServicesNetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.cloudServicesNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -1403,37 +1463,30 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for CloudServicesNetworks Update. */ +/** + * Samples for CloudServicesNetworks Update. + */ public final class CloudServicesNetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Patch.json */ /** * Sample code: Patch cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - CloudServicesNetwork resource = - manager - .cloudServicesNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + CloudServicesNetwork resource = manager.cloudServicesNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "cloudServicesNetworkName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAdditionalEgressEndpoints( - Arrays - .asList( - new EgressEndpoint() - .withCategory("azure-resource-management") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("https://storageaccountex.blob.core.windows.net") - .withPort(443L))))) + .withAdditionalEgressEndpoints(Arrays.asList(new EgressEndpoint().withCategory("azure-resource-management") + .withEndpoints(Arrays.asList( + new EndpointDependency().withDomainName("storageaccountex.blob.core.windows.net").withPort(443L))))) .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) .apply(); } @@ -1456,29 +1509,66 @@ public final class CloudServicesNetworksUpdateSamples { ```java import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ClusterManagers CreateOrUpdate. */ +/** + * Samples for ClusterManagers CreateOrUpdate. + */ public final class ClusterManagersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Create.json */ /** * Sample code: Create or update cluster manager. - * + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + createOrUpdateClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers() + .define("clusterManagerName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withFabricControllerId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAnalyticsWorkspaceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Create_Uami.json + */ + /** + * Sample code: Create or update cluster manager with user assigned identity. + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateClusterManager( + public static void createOrUpdateClusterManagerWithUserAssignedIdentity( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusterManagers() + manager.clusterManagers() .define("clusterManagerName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") .withFabricControllerId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + new UserAssignedIdentity()))) .withAnalyticsWorkspaceId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") .withManagedResourceGroupConfiguration( @@ -1503,14 +1593,18 @@ public final class ClusterManagersCreateOrUpdateSamples { ### ClusterManagers_Delete ```java -/** Samples for ClusterManagers Delete. */ +/** + * Samples for ClusterManagers Delete. + */ public final class ClusterManagersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Delete.json */ /** * Sample code: Delete cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -1522,21 +1616,24 @@ public final class ClusterManagersDeleteSamples { ### ClusterManagers_GetByResourceGroup ```java -/** Samples for ClusterManagers GetByResourceGroup. */ +/** + * Samples for ClusterManagers GetByResourceGroup. + */ public final class ClusterManagersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Get.json */ /** * Sample code: Get cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusterManagers() - .getByResourceGroupWithResponse( - "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + manager.clusterManagers() + .getByResourceGroupWithResponse("resourceGroupName", "clusterManagerName", + com.azure.core.util.Context.NONE); } } ``` @@ -1544,18 +1641,22 @@ public final class ClusterManagersGetByResourceGroupSamples { ### ClusterManagers_List ```java -/** Samples for ClusterManagers List. */ +/** + * Samples for ClusterManagers List. + */ public final class ClusterManagersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_ListBySubscription.json */ /** * Sample code: List cluster managers for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClusterManagersForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClusterManagersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusterManagers().list(com.azure.core.util.Context.NONE); } } @@ -1564,18 +1665,22 @@ public final class ClusterManagersListSamples { ### ClusterManagers_ListByResourceGroup ```java -/** Samples for ClusterManagers ListByResourceGroup. */ +/** + * Samples for ClusterManagers ListByResourceGroup. + */ public final class ClusterManagersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_ListByResourceGroup.json */ /** * Sample code: List cluster managers for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClusterManagersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClusterManagersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusterManagers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -1585,27 +1690,39 @@ public final class ClusterManagersListByResourceGroupSamples { ```java import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ClusterManagers Update. */ +/** + * Samples for ClusterManagers Update. + */ public final class ClusterManagersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Patch.json */ /** * Sample code: Patch cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - ClusterManager resource = - manager - .clusterManagers() - .getByResourceGroupWithResponse( - "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + ClusterManager resource = manager.clusterManagers() + .getByResourceGroupWithResponse("resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .apply(); } // Use "Map.of" if available @@ -1622,156 +1739,204 @@ public final class ClusterManagersUpdateSamples { } ``` +### Clusters_ContinueUpdateVersion + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionMachineGroupTargetingMode; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; + +/** + * Samples for Clusters ContinueUpdateVersion. + */ +public final class ClustersContinueUpdateVersionSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ContinueUpdateVersion.json + */ + /** + * Sample code: Continue update cluster version. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + continueUpdateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .continueUpdateVersion("resourceGroupName", "clusterName", + new ClusterContinueUpdateVersionParameters() + .withMachineGroupTargetingMode(ClusterContinueUpdateVersionMachineGroupTargetingMode.ALPHA_BY_RACK), + com.azure.core.util.Context.NONE); + } +} +``` + ### Clusters_CreateOrUpdate ```java import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategyType; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IdentitySelector; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentitySelectorType; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionEnforcementLevel; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettings; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsContainerScan; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Clusters CreateOrUpdate. */ +/** + * Samples for Clusters CreateOrUpdate. + */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Create.json */ /** * Sample code: Create or update cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() + manager.clusters() .define("clusterName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) .withAggregatorOrSingleRackDefinition( new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) .withNetworkRackId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") .withRackSerialNumber("AA1234") .withRackSkuId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName")))) + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) .withClusterType(ClusterType.SINGLE_RACK) .withClusterVersion("1.0.0") .withNetworkFabricId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAnalyticsWorkspaceId( + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + new UserAssignedIdentity()))) + .withAnalyticsOutputSettings(new AnalyticsOutputSettings().withAnalyticsWorkspaceId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1"))) .withClusterLocation("Foo Street, 3rd Floor, row 9") .withClusterServicePrincipal( - new ServicePrincipalInformation() - .withApplicationId("12345678-1234-1234-1234-123456789012") + new ServicePrincipalInformation().withApplicationId("12345678-1234-1234-1234-123456789012") .withPassword("fakeTokenPlaceholder") .withPrincipalId("00000008-0004-0004-0004-000000000012") .withTenantId("80000000-4000-4000-4000-120000000000")) + .withCommandOutputSettings(new CommandOutputSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withContainerUrl("https://myaccount.blob.core.windows.net/mycontainer?restype=container")) .withComputeDeploymentThreshold( - new ValidationThreshold() - .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + new ValidationThreshold().withGrouping(ValidationThresholdGrouping.PER_CLUSTER) .withType(ValidationThresholdType.PERCENT_SUCCESS) .withValue(90L)) - .withComputeRackDefinitions( - Arrays - .asList( - new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) - .withNetworkRackId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") - .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") - .withRackSerialNumber("AA1234") - .withRackSkuId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName"))))) + .withComputeRackDefinitions(Arrays.asList(new RackDefinition() + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName"))))) .withManagedResourceGroupConfiguration( new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .withRuntimeProtectionConfiguration( + new RuntimeProtectionConfiguration().withEnforcementLevel(RuntimeProtectionEnforcementLevel.ON_DEMAND)) + .withSecretArchiveSettings(new SecretArchiveSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withVaultUri("https://keyvaultname.vault.azure.net/")) + .withUpdateStrategy(new ClusterUpdateStrategy().withMaxUnavailable(4L) + .withStrategyType(ClusterUpdateStrategyType.RACK) + .withThresholdType(ValidationThresholdType.COUNT_SUCCESS) + .withThresholdValue(4L) + .withWaitTimeMinutes(10L)) + .withVulnerabilityScanningSettings(new VulnerabilityScanningSettings() + .withContainerScan(VulnerabilityScanningSettingsContainerScan.ENABLED)) .create(); } @@ -1792,14 +1957,18 @@ public final class ClustersCreateOrUpdateSamples { ### Clusters_Delete ```java -/** Samples for Clusters Delete. */ +/** + * Samples for Clusters Delete. + */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Delete.json */ /** * Sample code: Delete cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -1814,38 +1983,40 @@ public final class ClustersDeleteSamples { import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; import java.util.Arrays; -/** Samples for Clusters Deploy. */ +/** + * Samples for Clusters Deploy. + */ public final class ClustersDeploySamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Deploy.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Deploy.json */ /** * Sample code: Deploy cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deployCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .deploy( - "resourceGroupName", "clusterName", new ClusterDeployParameters(), com.azure.core.util.Context.NONE); + manager.clusters() + .deploy("resourceGroupName", "clusterName", new ClusterDeployParameters(), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Deploy_SkipValidation.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Deploy_SkipValidation.json */ /** * Sample code: Deploy cluster skipping validation. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deployClusterSkippingValidation( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .deploy( - "resourceGroupName", - "clusterName", + public static void + deployClusterSkippingValidation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .deploy("resourceGroupName", "clusterName", new ClusterDeployParameters().withSkipValidationsForMachines(Arrays.asList("bmmName1")), com.azure.core.util.Context.NONE); } @@ -1855,19 +2026,22 @@ public final class ClustersDeploySamples { ### Clusters_GetByResourceGroup ```java -/** Samples for Clusters GetByResourceGroup. */ +/** + * Samples for Clusters GetByResourceGroup. + */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Get.json */ /** * Sample code: Get cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() + manager.clusters() .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } @@ -1876,14 +2050,18 @@ public final class ClustersGetByResourceGroupSamples { ### Clusters_List ```java -/** Samples for Clusters List. */ +/** + * Samples for Clusters List. + */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ListBySubscription.json */ /** * Sample code: List clusters for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -1895,131 +2073,321 @@ public final class ClustersListSamples { ### Clusters_ListByResourceGroup ```java -/** Samples for Clusters ListByResourceGroup. */ +/** + * Samples for Clusters ListByResourceGroup. + */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ListByResourceGroup.json */ /** * Sample code: List clusters for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClustersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClustersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } ``` +### Clusters_ScanRuntime + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParametersScanActivity; + +/** + * Samples for Clusters ScanRuntime. + */ +public final class ClustersScanRuntimeSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ScanRuntime.json + */ + /** + * Sample code: Execute a runtime protection scan on the cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + executeARuntimeProtectionScanOnTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .scanRuntime("resourceGroupName", "clusterName", + new ClusterScanRuntimeParameters().withScanActivity(ClusterScanRuntimeParametersScanActivity.SCAN), + com.azure.core.util.Context.NONE); + } +} +``` + ### Clusters_Update ```java import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategyType; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; +import com.azure.resourcemanager.networkcloud.models.IdentitySelector; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentitySelectorType; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionEnforcementLevel; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsContainerScan; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsPatch; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Clusters Update. */ +/** + * Samples for Clusters Update. + */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Patch_Location.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_UpdateStrategy.json + */ + /** + * Sample code: Patch update strategy. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchUpdateStrategy(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withUpdateStrategy(new ClusterUpdateStrategy().withMaxUnavailable(4L) + .withStrategyType(ClusterUpdateStrategyType.RACK) + .withThresholdType(ValidationThresholdType.COUNT_SUCCESS) + .withThresholdValue(4L) + .withWaitTimeMinutes(10L)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_VulnerabilityScanning.json + */ + /** + * Sample code: Patch vulnerability scanning. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVulnerabilityScanning(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withVulnerabilityScanningSettings(new VulnerabilityScanningSettingsPatch() + .withContainerScan(VulnerabilityScanningSettingsContainerScan.ENABLED)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_Location.json */ /** * Sample code: Patch cluster location. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterLocation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Cluster resource = - manager - .clusters() - .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withClusterLocation("Foo Street, 3rd Floor, row 9") .apply(); } /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_AggregatorOrSingleRackDefinition.json */ /** * Sample code: Patch cluster AggregatorOrSingleRackDefinition. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterAggregatorOrSingleRackDefinition( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Cluster resource = - manager - .clusters() - .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withAggregatorOrSingleRackDefinition( new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) .withNetworkRackId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") .withRackSerialNumber("newSerialNumber") .withRackSkuId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName")))) + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) .withComputeDeploymentThreshold( - new ValidationThreshold() - .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + new ValidationThreshold().withGrouping(ValidationThresholdGrouping.PER_CLUSTER) .withType(ValidationThresholdType.PERCENT_SUCCESS) .withValue(90L)) .apply(); } + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_CommandOutput.json + */ + /** + * Sample code: Patch cluster command output. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterCommandOutput(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .withCommandOutputSettings(new CommandOutputSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2")) + .withContainerUrl("https://myaccount.blob.core.windows.net/mycontainer?restype=container")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_RuntimeProtectionConfiguration.json + */ + /** + * Sample code: Patch runtime protection configuration. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + patchRuntimeProtectionConfiguration(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withRuntimeProtectionConfiguration( + new RuntimeProtectionConfiguration().withEnforcementLevel(RuntimeProtectionEnforcementLevel.ON_DEMAND)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_SecretArchive.json + */ + /** + * Sample code: Patch secret archive. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchSecretArchive(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withSecretArchiveSettings(new SecretArchiveSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withVaultUri("https://keyvaultname.vault.azure.net/")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_AnalyticsOutput.json + */ + /** + * Sample code: Patch cluster analytics output. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterAnalyticsOutput(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .withAnalyticsOutputSettings(new AnalyticsOutputSettings().withAnalyticsWorkspaceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2"))) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { @@ -2039,24 +2407,24 @@ public final class ClustersUpdateSamples { ```java import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; -/** Samples for Clusters UpdateVersion. */ +/** + * Samples for Clusters UpdateVersion. + */ public final class ClustersUpdateVersionSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_UpdateVersion.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_UpdateVersion.json */ /** * Sample code: Update cluster version. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void updateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .updateVersion( - "resourceGroupName", - "clusterName", - new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), - com.azure.core.util.Context.NONE); + manager.clusters() + .updateVersion("resourceGroupName", "clusterName", + new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), com.azure.core.util.Context.NONE); } } ``` @@ -2071,28 +2439,29 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; -/** Samples for Consoles CreateOrUpdate. */ +/** + * Samples for Consoles CreateOrUpdate. + */ public final class ConsolesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Create.json */ /** * Sample code: Create or update virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateVirtualMachineConsole( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + public static void + createOrUpdateVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.consoles() .define("default") .withRegion("location") .withExistingVirtualMachine("resourceGroupName", "virtualMachineName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) .withEnabled(ConsoleEnabled.TRUE) .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) @@ -2117,19 +2486,22 @@ public final class ConsolesCreateOrUpdateSamples { ### Consoles_Delete ```java -/** Samples for Consoles Delete. */ +/** + * Samples for Consoles Delete. + */ public final class ConsolesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Delete.json */ /** * Sample code: Delete virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + manager.consoles() .delete("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); } } @@ -2138,19 +2510,22 @@ public final class ConsolesDeleteSamples { ### Consoles_Get ```java -/** Samples for Consoles Get. */ +/** + * Samples for Consoles Get. + */ public final class ConsolesGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Get.json */ /** * Sample code: Get virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + manager.consoles() .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); } } @@ -2159,20 +2534,23 @@ public final class ConsolesGetSamples { ### Consoles_ListByVirtualMachine ```java -/** Samples for Consoles ListByVirtualMachine. */ +/** + * Samples for Consoles ListByVirtualMachine. + */ public final class ConsolesListByVirtualMachineSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_ListByVirtualMachine.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_ListByVirtualMachine.json */ /** * Sample code: List consoles of the virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listConsolesOfTheVirtualMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + public static void + listConsolesOfTheVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.consoles() .listByVirtualMachine("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); } } @@ -2188,24 +2566,25 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; -/** Samples for Consoles Update. */ +/** + * Samples for Consoles Update. + */ public final class ConsolesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Patch.json */ /** * Sample code: Patch virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Console resource = - manager - .consoles() - .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Console resource = manager.consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withEnabled(ConsoleEnabled.TRUE) .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) @@ -2227,6 +2606,179 @@ public final class ConsolesUpdateSamples { } ``` +### KubernetesClusterFeatures_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KubernetesClusterFeatures CreateOrUpdate. + */ +public final class KubernetesClusterFeaturesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Create.json + */ + /** + * Sample code: Create or update Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + createOrUpdateKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .define("featureName") + .withRegion("location") + .withExistingKubernetesCluster("resourceGroupName", "kubernetesClusterName") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withOptions( + Arrays.asList(new StringKeyValuePair().withKey("fakeTokenPlaceholder").withValue("featureOptionValue"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### KubernetesClusterFeatures_Delete + +```java +/** + * Samples for KubernetesClusterFeatures Delete. + */ +public final class KubernetesClusterFeaturesDeleteSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Delete.json + */ + /** + * Sample code: Delete Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + deleteKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .delete("resourceGroupName", "kubernetesClusterName", "featureName", com.azure.core.util.Context.NONE); + } +} +``` + +### KubernetesClusterFeatures_Get + +```java +/** + * Samples for KubernetesClusterFeatures Get. + */ +public final class KubernetesClusterFeaturesGetSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Get.json + */ + /** + * Sample code: Get Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "featureName", + com.azure.core.util.Context.NONE); + } +} +``` + +### KubernetesClusterFeatures_ListByKubernetesCluster + +```java +/** + * Samples for KubernetesClusterFeatures ListByKubernetesCluster. + */ +public final class KubernetesClusterFeaturesListByKubernetesClusterSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_ListByKubernetesCluster.json + */ + /** + * Sample code: List features for the Kubernetes cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + listFeaturesForTheKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .listByKubernetesCluster("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### KubernetesClusterFeatures_Update + +```java +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeature; +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KubernetesClusterFeatures Update. + */ +public final class KubernetesClusterFeaturesUpdateSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Patch.json + */ + /** + * Sample code: Patch Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + patchKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + KubernetesClusterFeature resource = manager.kubernetesClusterFeatures() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "featureName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withOptions( + Arrays.asList(new StringKeyValuePair().withKey("fakeTokenPlaceholder").withValue("featureOptionValue"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### KubernetesClusters_CreateOrUpdate ```java @@ -2250,6 +2802,7 @@ import com.azure.resourcemanager.networkcloud.models.IpAddressPool; import com.azure.resourcemanager.networkcloud.models.KubernetesLabel; import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; import com.azure.resourcemanager.networkcloud.models.L2NetworkAttachmentConfiguration; +import com.azure.resourcemanager.networkcloud.models.L2ServiceLoadBalancerConfiguration; import com.azure.resourcemanager.networkcloud.models.L3NetworkAttachmentConfiguration; import com.azure.resourcemanager.networkcloud.models.L3NetworkConfigurationIpamEnabled; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; @@ -2261,155 +2814,192 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for KubernetesClusters CreateOrUpdate. */ +/** + * Samples for KubernetesClusters CreateOrUpdate. + */ public final class KubernetesClustersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Create.json */ /** * Sample code: Create or update Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateKubernetesCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() + public static void + createOrUpdateKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() .define("kubernetesClusterName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withControlPlaneNodeConfiguration( - new ControlPlaneNodeConfiguration() - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) - .withAvailabilityZones(Arrays.asList("1", "2", "3")) - .withCount(3L) - .withVmSkuName("NC_G4_v1")) - .withInitialAgentPoolConfigurations( - Arrays - .asList( - new InitialAgentPoolConfiguration() - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys( - Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) - .withAgentOptions( - new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) - .withAvailabilityZones(Arrays.asList("1", "2", "3")) - .withCount(3L) - .withLabels( - Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withMode(AgentPoolMode.SYSTEM) - .withName("SystemPool-1") - .withTaints( - Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) - .withVmSkuName("NC_M16_v1"))) - .withKubernetesVersion("1.24.12-1") - .withNetworkConfiguration( - new NetworkConfiguration() - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) - .withBgpServiceLoadBalancerConfiguration( - new BgpServiceLoadBalancerConfiguration() - .withBgpAdvertisements( - Arrays - .asList( - new BgpAdvertisement() - .withAdvertiseToFabric(AdvertiseToFabric.TRUE) - .withCommunities(Arrays.asList("64512:100")) - .withIpAddressPools(Arrays.asList("pool1")) - .withPeers(Arrays.asList("peer1")))) - .withBgpPeers( - Arrays - .asList( - new ServiceLoadBalancerBgpPeer() - .withBfdEnabled(BfdEnabled.FALSE) - .withBgpMultiHop(BgpMultiHop.FALSE) - .withHoldTime("P300s") - .withKeepAliveTime("P300s") - .withMyAsn(64512L) - .withName("peer1") - .withPeerAddress("203.0.113.254") - .withPeerAsn(64497L) - .withPeerPort(179L))) - .withFabricPeeringEnabled(FabricPeeringEnabled.TRUE) - .withIpAddressPools( - Arrays - .asList( - new IpAddressPool() - .withAddresses(Arrays.asList("198.51.102.0/24")) - .withAutoAssign(BfdEnabled.TRUE) - .withName("pool1") - .withOnlyUseHostIps(BfdEnabled.TRUE)))) - .withCloudServicesNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") - .withCniNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withDnsServiceIp("198.51.101.2") - .withPodCidrs(Arrays.asList("198.51.100.0/24")) - .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withControlPlaneNodeConfiguration(new ControlPlaneNodeConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withVmSkuName("NC_G6_28_v1")) + .withInitialAgentPoolConfigurations(Arrays.asList(new InitialAgentPoolConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withMode(AgentPoolMode.SYSTEM) + .withName("SystemPool-1") + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) + .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withVmSkuName("NC_P46_224_v1"))) + .withKubernetesVersion("1.XX.Y") + .withNetworkConfiguration(new NetworkConfiguration() + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withBgpServiceLoadBalancerConfiguration(new BgpServiceLoadBalancerConfiguration() + .withBgpAdvertisements( + Arrays.asList(new BgpAdvertisement().withAdvertiseToFabric(AdvertiseToFabric.TRUE) + .withCommunities(Arrays.asList("64512:100")) + .withIpAddressPools(Arrays.asList("pool1")) + .withPeers(Arrays.asList("peer1")))) + .withBgpPeers(Arrays.asList(new ServiceLoadBalancerBgpPeer().withBfdEnabled(BfdEnabled.FALSE) + .withBgpMultiHop(BgpMultiHop.FALSE) + .withHoldTime("P300s") + .withKeepAliveTime("P300s") + .withMyAsn(64512L) + .withName("peer1") + .withPeerAddress("203.0.113.254") + .withPeerAsn(64497L) + .withPeerPort(179L))) + .withFabricPeeringEnabled(FabricPeeringEnabled.TRUE) + .withIpAddressPools( + Arrays.asList(new IpAddressPool().withAddresses(Arrays.asList("198.51.102.0/24")) + .withAutoAssign(BfdEnabled.TRUE) + .withName("pool1") + .withOnlyUseHostIps(BfdEnabled.TRUE)))) + .withCloudServicesNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withCniNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDnsServiceIp("198.51.101.2") + .withPodCidrs(Arrays.asList("198.51.100.0/24")) + .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withAadConfiguration( new AadConfiguration().withAdminGroupObjectIds(Arrays.asList("ffffffff-ffff-ffff-ffff-ffffffffffff"))) - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_L2LoadBalancer_Create.json + */ + /** + * Sample code: Create or update Kubernetes cluster with a layer 2 load balancer. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateKubernetesClusterWithALayer2LoadBalancer( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() + .define("kubernetesClusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withControlPlaneNodeConfiguration(new ControlPlaneNodeConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withVmSkuName("NC_G6_28_v1")) + .withInitialAgentPoolConfigurations(Arrays.asList(new InitialAgentPoolConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withMode(AgentPoolMode.SYSTEM) + .withName("SystemPool-1") + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) + .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withVmSkuName("NC_P46_224_v1"))) + .withKubernetesVersion("1.XX.Y") + .withNetworkConfiguration(new NetworkConfiguration() + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withCloudServicesNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withCniNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDnsServiceIp("198.51.101.2") + .withL2ServiceLoadBalancerConfiguration(new L2ServiceLoadBalancerConfiguration().withIpAddressPools( + Arrays.asList(new IpAddressPool().withAddresses(Arrays.asList("198.51.102.2-198.51.102.254")) + .withAutoAssign(BfdEnabled.TRUE) + .withName("pool1")))) + .withPodCidrs(Arrays.asList("198.51.100.0/24")) + .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAadConfiguration( + new AadConfiguration().withAdminGroupObjectIds(Arrays.asList("ffffffff-ffff-ffff-ffff-ffffffffffff"))) + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withManagedResourceGroupConfiguration( new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) .create(); @@ -2432,19 +3022,22 @@ public final class KubernetesClustersCreateOrUpdateSamples { ### KubernetesClusters_Delete ```java -/** Samples for KubernetesClusters Delete. */ +/** + * Samples for KubernetesClusters Delete. + */ public final class KubernetesClustersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Delete.json */ /** * Sample code: Delete Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() + manager.kubernetesClusters() .delete("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); } } @@ -2453,21 +3046,24 @@ public final class KubernetesClustersDeleteSamples { ### KubernetesClusters_GetByResourceGroup ```java -/** Samples for KubernetesClusters GetByResourceGroup. */ +/** + * Samples for KubernetesClusters GetByResourceGroup. + */ public final class KubernetesClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Get.json */ /** * Sample code: Get Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() - .getByResourceGroupWithResponse( - "resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); + manager.kubernetesClusters() + .getByResourceGroupWithResponse("resourceGroupName", "kubernetesClusterName", + com.azure.core.util.Context.NONE); } } ``` @@ -2475,18 +3071,22 @@ public final class KubernetesClustersGetByResourceGroupSamples { ### KubernetesClusters_List ```java -/** Samples for KubernetesClusters List. */ +/** + * Samples for KubernetesClusters List. + */ public final class KubernetesClustersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_ListBySubscription.json */ /** * Sample code: List Kubernetes clusters for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listKubernetesClustersForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listKubernetesClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.kubernetesClusters().list(com.azure.core.util.Context.NONE); } } @@ -2495,18 +3095,22 @@ public final class KubernetesClustersListSamples { ### KubernetesClusters_ListByResourceGroup ```java -/** Samples for KubernetesClusters ListByResourceGroup. */ +/** + * Samples for KubernetesClusters ListByResourceGroup. + */ public final class KubernetesClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_ListByResourceGroup.json */ /** * Sample code: List Kubernetes clusters for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listKubernetesClustersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listKubernetesClustersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.kubernetesClusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -2517,23 +3121,24 @@ public final class KubernetesClustersListByResourceGroupSamples { ```java import com.azure.resourcemanager.networkcloud.models.KubernetesClusterRestartNodeParameters; -/** Samples for KubernetesClusters RestartNode. */ +/** + * Samples for KubernetesClusters RestartNode. + */ public final class KubernetesClustersRestartNodeSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_RestartNode.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_RestartNode.json */ /** * Sample code: Restart a Kubernetes cluster node. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void restartAKubernetesClusterNode( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() - .restartNode( - "resourceGroupName", - "kubernetesClusterName", + public static void + restartAKubernetesClusterNode(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() + .restartNode("resourceGroupName", "kubernetesClusterName", new KubernetesClusterRestartNodeParameters().withNodeName("nodeName"), com.azure.core.util.Context.NONE); } @@ -2543,33 +3148,42 @@ public final class KubernetesClustersRestartNodeSamples { ### KubernetesClusters_Update ```java +import com.azure.resourcemanager.networkcloud.models.AdministratorConfigurationPatch; import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; import com.azure.resourcemanager.networkcloud.models.KubernetesCluster; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for KubernetesClusters Update. */ +/** + * Samples for KubernetesClusters Update. + */ public final class KubernetesClustersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Patch.json */ /** * Sample code: Patch Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - KubernetesCluster resource = - manager - .kubernetesClusters() - .getByResourceGroupWithResponse( - "resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + KubernetesCluster resource = manager.kubernetesClusters() + .getByResourceGroupWithResponse("resourceGroupName", "kubernetesClusterName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withControlPlaneNodeConfiguration(new ControlPlaneNodePatchConfiguration().withCount(3L)) - .withKubernetesVersion("1.24.12") + .withAdministratorConfiguration(new AdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withControlPlaneNodeConfiguration(new ControlPlaneNodePatchConfiguration() + .withAdministratorConfiguration(new AdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withCount(3L)) + .withKubernetesVersion("1.XX.Y") .apply(); } @@ -2595,27 +3209,28 @@ import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; import java.util.HashMap; import java.util.Map; -/** Samples for L2Networks CreateOrUpdate. */ +/** + * Samples for L2Networks CreateOrUpdate. + */ public final class L2NetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Create.json */ /** * Sample code: Create or update L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l2Networks() + manager.l2Networks() .define("l2NetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withL2IsolationDomainId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) @@ -2641,14 +3256,18 @@ public final class L2NetworksCreateOrUpdateSamples { ### L2Networks_Delete ```java -/** Samples for L2Networks Delete. */ +/** + * Samples for L2Networks Delete. + */ public final class L2NetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Delete.json */ /** * Sample code: Delete L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -2660,19 +3279,22 @@ public final class L2NetworksDeleteSamples { ### L2Networks_GetByResourceGroup ```java -/** Samples for L2Networks GetByResourceGroup. */ +/** + * Samples for L2Networks GetByResourceGroup. + */ public final class L2NetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Get.json */ /** * Sample code: Get L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l2Networks() + manager.l2Networks() .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); } } @@ -2681,18 +3303,22 @@ public final class L2NetworksGetByResourceGroupSamples { ### L2Networks_List ```java -/** Samples for L2Networks List. */ +/** + * Samples for L2Networks List. + */ public final class L2NetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_ListBySubscription.json */ /** * Sample code: List L2 networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL2NetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL2NetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l2Networks().list(com.azure.core.util.Context.NONE); } } @@ -2701,18 +3327,22 @@ public final class L2NetworksListSamples { ### L2Networks_ListByResourceGroup ```java -/** Samples for L2Networks ListByResourceGroup. */ +/** + * Samples for L2Networks ListByResourceGroup. + */ public final class L2NetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_ListByResourceGroup.json */ /** * Sample code: List L2 networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL2NetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL2NetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l2Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -2725,22 +3355,24 @@ import com.azure.resourcemanager.networkcloud.models.L2Network; import java.util.HashMap; import java.util.Map; -/** Samples for L2Networks Update. */ +/** + * Samples for L2Networks Update. + */ public final class L2NetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Patch.json */ /** * Sample code: Patch L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - L2Network resource = - manager - .l2Networks() - .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) - .getValue(); + L2Network resource = manager.l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } @@ -2766,27 +3398,28 @@ import com.azure.resourcemanager.networkcloud.models.IpAllocationType; import java.util.HashMap; import java.util.Map; -/** Samples for L3Networks CreateOrUpdate. */ +/** + * Samples for L3Networks CreateOrUpdate. + */ public final class L3NetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Create.json */ /** * Sample code: Create or update L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l3Networks() + manager.l3Networks() .define("l3NetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withL3IsolationDomainId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") .withVlan(12L) @@ -2815,14 +3448,18 @@ public final class L3NetworksCreateOrUpdateSamples { ### L3Networks_Delete ```java -/** Samples for L3Networks Delete. */ +/** + * Samples for L3Networks Delete. + */ public final class L3NetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Delete.json */ /** * Sample code: Delete L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -2834,19 +3471,22 @@ public final class L3NetworksDeleteSamples { ### L3Networks_GetByResourceGroup ```java -/** Samples for L3Networks GetByResourceGroup. */ +/** + * Samples for L3Networks GetByResourceGroup. + */ public final class L3NetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Get.json */ /** * Sample code: Get L3network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getL3network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l3Networks() + manager.l3Networks() .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); } } @@ -2855,18 +3495,22 @@ public final class L3NetworksGetByResourceGroupSamples { ### L3Networks_List ```java -/** Samples for L3Networks List. */ +/** + * Samples for L3Networks List. + */ public final class L3NetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_ListBySubscription.json */ /** * Sample code: List L3 networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL3NetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL3NetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l3Networks().list(com.azure.core.util.Context.NONE); } } @@ -2875,18 +3519,22 @@ public final class L3NetworksListSamples { ### L3Networks_ListByResourceGroup ```java -/** Samples for L3Networks ListByResourceGroup. */ +/** + * Samples for L3Networks ListByResourceGroup. + */ public final class L3NetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_ListByResourceGroup.json */ /** * Sample code: List L3 networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL3NetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL3NetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l3Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -2899,22 +3547,24 @@ import com.azure.resourcemanager.networkcloud.models.L3Network; import java.util.HashMap; import java.util.Map; -/** Samples for L3Networks Update. */ +/** + * Samples for L3Networks Update. + */ public final class L3NetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Patch.json */ /** * Sample code: Patch L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - L3Network resource = - manager - .l3Networks() - .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) - .getValue(); + L3Network resource = manager.l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } @@ -2940,28 +3590,29 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for MetricsConfigurations CreateOrUpdate. */ +/** + * Samples for MetricsConfigurations CreateOrUpdate. + */ public final class MetricsConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Create.json */ /** * Sample code: Create or update metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateMetricsConfigurationOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + manager.metricsConfigurations() .define("default") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withCollectionInterval(15L) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withEnabledMetrics(Arrays.asList("metric1", "metric2")) @@ -2985,20 +3636,23 @@ public final class MetricsConfigurationsCreateOrUpdateSamples { ### MetricsConfigurations_Delete ```java -/** Samples for MetricsConfigurations Delete. */ +/** + * Samples for MetricsConfigurations Delete. + */ public final class MetricsConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Delete.json */ /** * Sample code: Delete metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + deleteMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .delete("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); } } @@ -3007,20 +3661,23 @@ public final class MetricsConfigurationsDeleteSamples { ### MetricsConfigurations_Get ```java -/** Samples for MetricsConfigurations Get. */ +/** + * Samples for MetricsConfigurations Get. + */ public final class MetricsConfigurationsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Get.json */ /** * Sample code: Get metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + getMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); } } @@ -3029,20 +3686,23 @@ public final class MetricsConfigurationsGetSamples { ### MetricsConfigurations_ListByCluster ```java -/** Samples for MetricsConfigurations ListByCluster. */ +/** + * Samples for MetricsConfigurations ListByCluster. + */ public final class MetricsConfigurationsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_ListByCluster.json */ /** * Sample code: List metrics configurations of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listMetricsConfigurationsOfTheCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + listMetricsConfigurationsOfTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .listByCluster("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } @@ -3056,25 +3716,26 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for MetricsConfigurations Update. */ +/** + * Samples for MetricsConfigurations Update. + */ public final class MetricsConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Patch.json */ /** * Sample code: Patch metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - ClusterMetricsConfiguration resource = - manager - .metricsConfigurations() - .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterMetricsConfiguration resource = manager.metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withCollectionInterval(15L) .withEnabledMetrics(Arrays.asList("metric1", "metric2")) @@ -3098,18 +3759,22 @@ public final class MetricsConfigurationsUpdateSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Operations_List.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Operations_List.json */ /** * Sample code: List resource provider operations. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listResourceProviderOperations( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listResourceProviderOperations(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } @@ -3118,14 +3783,18 @@ public final class OperationsListSamples { ### RackSkus_Get ```java -/** Samples for RackSkus Get. */ +/** + * Samples for RackSkus Get. + */ public final class RackSkusGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/RackSkus_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * RackSkus_Get.json */ /** * Sample code: Get rack SKU resource. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getRackSKUResource(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3137,14 +3806,18 @@ public final class RackSkusGetSamples { ### RackSkus_List ```java -/** Samples for RackSkus List. */ +/** + * Samples for RackSkus List. + */ public final class RackSkusListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/RackSkus_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * RackSkus_ListBySubscription.json */ /** * Sample code: List rack SKUs for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRackSKUsForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3160,31 +3833,33 @@ import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import java.util.HashMap; import java.util.Map; -/** Samples for Racks CreateOrUpdate. */ +/** + * Samples for Racks CreateOrUpdate. + */ public final class RacksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Create.json */ /** * Sample code: Create or update rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .racks() + manager.racks() .define("rackName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAvailabilityZone("1") .withRackLocation("Rack 28") .withRackSerialNumber("RACK_SERIAL_NUMBER") - .withRackSkuId("RACK-TYPE-1") + .withRackSkuId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } @@ -3206,14 +3881,18 @@ public final class RacksCreateOrUpdateSamples { ### Racks_Delete ```java -/** Samples for Racks Delete. */ +/** + * Samples for Racks Delete. + */ public final class RacksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Delete.json */ /** * Sample code: Delete rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3225,19 +3904,22 @@ public final class RacksDeleteSamples { ### Racks_GetByResourceGroup ```java -/** Samples for Racks GetByResourceGroup. */ +/** + * Samples for Racks GetByResourceGroup. + */ public final class RacksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/Racks_Get. + * json */ /** * Sample code: Get rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .racks() + manager.racks() .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); } } @@ -3246,14 +3928,18 @@ public final class RacksGetByResourceGroupSamples { ### Racks_List ```java -/** Samples for Racks List. */ +/** + * Samples for Racks List. + */ public final class RacksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_ListBySubscription.json */ /** * Sample code: List racks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRacksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3265,14 +3951,18 @@ public final class RacksListSamples { ### Racks_ListByResourceGroup ```java -/** Samples for Racks ListByResourceGroup. */ +/** + * Samples for Racks ListByResourceGroup. + */ public final class RacksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_ListByResourceGroup.json */ /** * Sample code: List racks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRacksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3288,24 +3978,25 @@ import com.azure.resourcemanager.networkcloud.models.Rack; import java.util.HashMap; import java.util.Map; -/** Samples for Racks Update. */ +/** + * Samples for Racks Update. + */ public final class RacksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Patch.json */ /** * Sample code: Patch rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Rack resource = - manager - .racks() - .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Rack resource = manager.racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withRackLocation("Rack 2B") .withRackSerialNumber("RACK_SERIAL_NUMBER") @@ -3334,28 +4025,29 @@ import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import java.util.HashMap; import java.util.Map; -/** Samples for StorageAppliances CreateOrUpdate. */ +/** + * Samples for StorageAppliances CreateOrUpdate. + */ public final class StorageAppliancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Create.json */ /** * Sample code: Create or update storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateStorageAppliance( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() + public static void + createOrUpdateStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances() .define("storageApplianceName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAdministratorCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("adminUser")) .withRackId( @@ -3384,19 +4076,22 @@ public final class StorageAppliancesCreateOrUpdateSamples { ### StorageAppliances_Delete ```java -/** Samples for StorageAppliances Delete. */ +/** + * Samples for StorageAppliances Delete. + */ public final class StorageAppliancesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Delete.json */ /** * Sample code: Delete storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() + manager.storageAppliances() .delete("resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); } } @@ -3405,22 +4100,25 @@ public final class StorageAppliancesDeleteSamples { ### StorageAppliances_DisableRemoteVendorManagement ```java -/** Samples for StorageAppliances DisableRemoteVendorManagement. */ +/** + * Samples for StorageAppliances DisableRemoteVendorManagement. + */ public final class StorageAppliancesDisableRemoteVendorManagementSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_DisableRemoteVendorManagement.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_DisableRemoteVendorManagement.json */ /** * Sample code: Turn off remote vendor management for storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void turnOffRemoteVendorManagementForStorageAppliance( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .disableRemoteVendorManagement( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + manager.storageAppliances() + .disableRemoteVendorManagement("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE); } } ``` @@ -3431,23 +4129,24 @@ public final class StorageAppliancesDisableRemoteVendorManagementSamples { import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; import java.util.Arrays; -/** Samples for StorageAppliances EnableRemoteVendorManagement. */ +/** + * Samples for StorageAppliances EnableRemoteVendorManagement. + */ public final class StorageAppliancesEnableRemoteVendorManagementSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_EnableRemoteVendorManagement.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_EnableRemoteVendorManagement.json */ /** * Sample code: Turn on remote vendor management for storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void turnOnRemoteVendorManagementForStorageAppliance( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .enableRemoteVendorManagement( - "resourceGroupName", - "storageApplianceName", + manager.storageAppliances() + .enableRemoteVendorManagement("resourceGroupName", "storageApplianceName", new StorageApplianceEnableRemoteVendorManagementParameters() .withSupportEndpoints(Arrays.asList("10.0.0.0/24")), com.azure.core.util.Context.NONE); @@ -3458,21 +4157,24 @@ public final class StorageAppliancesEnableRemoteVendorManagementSamples { ### StorageAppliances_GetByResourceGroup ```java -/** Samples for StorageAppliances GetByResourceGroup. */ +/** + * Samples for StorageAppliances GetByResourceGroup. + */ public final class StorageAppliancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Get.json */ /** * Sample code: Get storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .getByResourceGroupWithResponse( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + manager.storageAppliances() + .getByResourceGroupWithResponse("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE); } } ``` @@ -3480,18 +4182,22 @@ public final class StorageAppliancesGetByResourceGroupSamples { ### StorageAppliances_List ```java -/** Samples for StorageAppliances List. */ +/** + * Samples for StorageAppliances List. + */ public final class StorageAppliancesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_ListBySubscription.json */ /** * Sample code: List storage appliances for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listStorageAppliancesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listStorageAppliancesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.storageAppliances().list(com.azure.core.util.Context.NONE); } } @@ -3500,18 +4206,22 @@ public final class StorageAppliancesListSamples { ### StorageAppliances_ListByResourceGroup ```java -/** Samples for StorageAppliances ListByResourceGroup. */ +/** + * Samples for StorageAppliances ListByResourceGroup. + */ public final class StorageAppliancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_ListByResourceGroup.json */ /** * Sample code: List storage appliances for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listStorageAppliancesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listStorageAppliancesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.storageAppliances().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -3524,25 +4234,26 @@ import com.azure.resourcemanager.networkcloud.models.StorageAppliance; import java.util.HashMap; import java.util.Map; -/** Samples for StorageAppliances Update. */ +/** + * Samples for StorageAppliances Update. + */ public final class StorageAppliancesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Patch.json */ /** * Sample code: Patch storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - StorageAppliance resource = - manager - .storageAppliances() - .getByResourceGroupWithResponse( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + StorageAppliance resource = manager.storageAppliances() + .getByResourceGroupWithResponse("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withSerialNumber("BM1219XXX") .apply(); @@ -3570,33 +4281,32 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for TrunkedNetworks CreateOrUpdate. */ +/** + * Samples for TrunkedNetworks CreateOrUpdate. + */ public final class TrunkedNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Create.json */ /** * Sample code: Create or update trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateTrunkedNetwork( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .trunkedNetworks() + public static void + createOrUpdateTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks() .define("trunkedNetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withIsolationDomainIds( - Arrays - .asList( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withIsolationDomainIds(Arrays.asList( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) .withVlans(Arrays.asList(12L, 14L)) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withInterfaceName("eth0") @@ -3620,14 +4330,18 @@ public final class TrunkedNetworksCreateOrUpdateSamples { ### TrunkedNetworks_Delete ```java -/** Samples for TrunkedNetworks Delete. */ +/** + * Samples for TrunkedNetworks Delete. + */ public final class TrunkedNetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Delete.json */ /** * Sample code: Delete trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3639,21 +4353,24 @@ public final class TrunkedNetworksDeleteSamples { ### TrunkedNetworks_GetByResourceGroup ```java -/** Samples for TrunkedNetworks GetByResourceGroup. */ +/** + * Samples for TrunkedNetworks GetByResourceGroup. + */ public final class TrunkedNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Get.json */ /** * Sample code: Get Trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .trunkedNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + manager.trunkedNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "trunkedNetworkName", + com.azure.core.util.Context.NONE); } } ``` @@ -3661,18 +4378,22 @@ public final class TrunkedNetworksGetByResourceGroupSamples { ### TrunkedNetworks_List ```java -/** Samples for TrunkedNetworks List. */ +/** + * Samples for TrunkedNetworks List. + */ public final class TrunkedNetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_ListBySubscription.json */ /** * Sample code: List trunked networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listTrunkedNetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listTrunkedNetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.trunkedNetworks().list(com.azure.core.util.Context.NONE); } } @@ -3681,18 +4402,22 @@ public final class TrunkedNetworksListSamples { ### TrunkedNetworks_ListByResourceGroup ```java -/** Samples for TrunkedNetworks ListByResourceGroup. */ +/** + * Samples for TrunkedNetworks ListByResourceGroup. + */ public final class TrunkedNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_ListByResourceGroup.json */ /** * Sample code: List Trunked networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listTrunkedNetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listTrunkedNetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.trunkedNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -3705,23 +4430,24 @@ import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; import java.util.HashMap; import java.util.Map; -/** Samples for TrunkedNetworks Update. */ +/** + * Samples for TrunkedNetworks Update. + */ public final class TrunkedNetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Patch.json */ /** * Sample code: Patch trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - TrunkedNetwork resource = - manager - .trunkedNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) - .getValue(); + TrunkedNetwork resource = manager.trunkedNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } @@ -3762,79 +4488,64 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for VirtualMachines CreateOrUpdate. */ +/** + * Samples for VirtualMachines CreateOrUpdate. + */ public final class VirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Create.json */ /** * Sample code: Create or update virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateVirtualMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() + public static void + createOrUpdateVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines() .define("virtualMachineName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAdminUsername("username") - .withCloudServicesNetworkAttachment( - new NetworkAttachment() - .withAttachedNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") - .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) + .withCloudServicesNetworkAttachment(new NetworkAttachment().withAttachedNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) .withCpuCores(2L) .withMemorySizeGB(8L) - .withStorageProfile( - new StorageProfile() - .withOsDisk( - new OsDisk() - .withCreateOption(OsDiskCreateOption.EPHEMERAL) - .withDeleteOption(OsDiskDeleteOption.DELETE) - .withDiskSizeGB(120L)) - .withVolumeAttachments( - Arrays - .asList( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) + .withStorageProfile(new StorageProfile() + .withOsDisk(new OsDisk().withCreateOption(OsDiskCreateOption.EPHEMERAL) + .withDeleteOption(OsDiskDeleteOption.DELETE) + .withDiskSizeGB(120L)) + .withVolumeAttachments(Arrays.asList( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) .withVmImage("myacr.azurecr.io/foobar:latest") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withBootMethod(VirtualMachineBootMethod.UEFI) - .withNetworkAttachments( - Arrays - .asList( - new NetworkAttachment() - .withAttachedNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withDefaultGateway(DefaultGateway.TRUE) - .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) - .withIpv4Address("198.51.100.1") - .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") - .withNetworkAttachmentName("netAttachName01"))) + .withNetworkAttachments(Arrays.asList(new NetworkAttachment().withAttachedNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDefaultGateway(DefaultGateway.TRUE) + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) + .withIpv4Address("198.51.100.1") + .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") + .withNetworkAttachmentName("netAttachName01"))) .withNetworkData("bmV0d29ya0RhdGVTYW1wbGU=") - .withPlacementHints( - Arrays - .asList( - new VirtualMachinePlacementHint() - .withHintType(VirtualMachinePlacementHintType.AFFINITY) - .withResourceId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") - .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) - .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) + .withPlacementHints(Arrays.asList(new VirtualMachinePlacementHint() + .withHintType(VirtualMachinePlacementHintType.AFFINITY) + .withResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) + .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))) .withUserData("dXNlckRhdGVTYW1wbGU=") .withVmDeviceModel(VirtualMachineDeviceModelType.T2) - .withVmImageRepositoryCredentials( - new ImageRepositoryCredentials() - .withPassword("fakeTokenPlaceholder") - .withRegistryUrl("myacr.azurecr.io") - .withUsername("myuser")) + .withVmImageRepositoryCredentials(new ImageRepositoryCredentials().withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) .create(); } @@ -3855,14 +4566,18 @@ public final class VirtualMachinesCreateOrUpdateSamples { ### VirtualMachines_Delete ```java -/** Samples for VirtualMachines Delete. */ +/** + * Samples for VirtualMachines Delete. + */ public final class VirtualMachinesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Delete.json */ /** * Sample code: Delete virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3874,21 +4589,24 @@ public final class VirtualMachinesDeleteSamples { ### VirtualMachines_GetByResourceGroup ```java -/** Samples for VirtualMachines GetByResourceGroup. */ +/** + * Samples for VirtualMachines GetByResourceGroup. + */ public final class VirtualMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Get.json */ /** * Sample code: Get virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + manager.virtualMachines() + .getByResourceGroupWithResponse("resourceGroupName", "virtualMachineName", + com.azure.core.util.Context.NONE); } } ``` @@ -3896,18 +4614,22 @@ public final class VirtualMachinesGetByResourceGroupSamples { ### VirtualMachines_List ```java -/** Samples for VirtualMachines List. */ +/** + * Samples for VirtualMachines List. + */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_ListBySubscription.json */ /** * Sample code: List virtual machines for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listVirtualMachinesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listVirtualMachinesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.virtualMachines().list(com.azure.core.util.Context.NONE); } } @@ -3916,18 +4638,22 @@ public final class VirtualMachinesListSamples { ### VirtualMachines_ListByResourceGroup ```java -/** Samples for VirtualMachines ListByResourceGroup. */ +/** + * Samples for VirtualMachines ListByResourceGroup. + */ public final class VirtualMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_ListByResourceGroup.json */ /** * Sample code: List virtual machines for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listVirtualMachinesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listVirtualMachinesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.virtualMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } @@ -3939,22 +4665,23 @@ public final class VirtualMachinesListByResourceGroupSamples { import com.azure.resourcemanager.networkcloud.models.SkipShutdown; import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; -/** Samples for VirtualMachines PowerOff. */ +/** + * Samples for VirtualMachines PowerOff. + */ public final class VirtualMachinesPowerOffSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_PowerOff.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_PowerOff.json */ /** * Sample code: Power off virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void powerOffVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() - .powerOff( - "resourceGroupName", - "virtualMachineName", + manager.virtualMachines() + .powerOff("resourceGroupName", "virtualMachineName", new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE), com.azure.core.util.Context.NONE); } @@ -3964,14 +4691,18 @@ public final class VirtualMachinesPowerOffSamples { ### VirtualMachines_Reimage ```java -/** Samples for VirtualMachines Reimage. */ +/** + * Samples for VirtualMachines Reimage. + */ public final class VirtualMachinesReimageSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Reimage.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Reimage.json */ /** * Sample code: Reimage virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void reimageVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -3983,14 +4714,18 @@ public final class VirtualMachinesReimageSamples { ### VirtualMachines_Restart ```java -/** Samples for VirtualMachines Restart. */ +/** + * Samples for VirtualMachines Restart. + */ public final class VirtualMachinesRestartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Restart.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Restart.json */ /** * Sample code: Restart virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void restartVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -4002,14 +4737,18 @@ public final class VirtualMachinesRestartSamples { ### VirtualMachines_Start ```java -/** Samples for VirtualMachines Start. */ +/** + * Samples for VirtualMachines Start. + */ public final class VirtualMachinesStartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Start.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Start.json */ /** * Sample code: Start virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void startVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -4026,31 +4765,29 @@ import com.azure.resourcemanager.networkcloud.models.VirtualMachine; import java.util.HashMap; import java.util.Map; -/** Samples for VirtualMachines Update. */ +/** + * Samples for VirtualMachines Update. + */ public final class VirtualMachinesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Patch.json */ /** * Sample code: Patch virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - VirtualMachine resource = - manager - .virtualMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + VirtualMachine resource = manager.virtualMachines() + .getByResourceGroupWithResponse("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withVmImageRepositoryCredentials( - new ImageRepositoryCredentials() - .withPassword("fakeTokenPlaceholder") - .withRegistryUrl("myacr.azurecr.io") - .withUsername("myuser")) + .withVmImageRepositoryCredentials(new ImageRepositoryCredentials().withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) .apply(); } @@ -4075,27 +4812,28 @@ import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import java.util.HashMap; import java.util.Map; -/** Samples for Volumes CreateOrUpdate. */ +/** + * Samples for Volumes CreateOrUpdate. + */ public final class VolumesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Create.json */ /** * Sample code: Create or update volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .volumes() + manager.volumes() .define("volumeName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withSizeMiB(10000L) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); @@ -4118,14 +4856,18 @@ public final class VolumesCreateOrUpdateSamples { ### Volumes_Delete ```java -/** Samples for Volumes Delete. */ +/** + * Samples for Volumes Delete. + */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Delete.json */ /** * Sample code: Delete volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -4137,19 +4879,22 @@ public final class VolumesDeleteSamples { ### Volumes_GetByResourceGroup ```java -/** Samples for Volumes GetByResourceGroup. */ +/** + * Samples for Volumes GetByResourceGroup. + */ public final class VolumesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Get.json */ /** * Sample code: Get volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .volumes() + manager.volumes() .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); } } @@ -4158,14 +4903,18 @@ public final class VolumesGetByResourceGroupSamples { ### Volumes_List ```java -/** Samples for Volumes List. */ +/** + * Samples for Volumes List. + */ public final class VolumesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_ListBySubscription.json */ /** * Sample code: List volume for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listVolumeForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -4177,14 +4926,18 @@ public final class VolumesListSamples { ### Volumes_ListByResourceGroup ```java -/** Samples for Volumes ListByResourceGroup. */ +/** + * Samples for Volumes ListByResourceGroup. + */ public final class VolumesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_ListByResourceGroup.json */ /** * Sample code: List volumes for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listVolumesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { @@ -4200,22 +4953,24 @@ import com.azure.resourcemanager.networkcloud.models.Volume; import java.util.HashMap; import java.util.Map; -/** Samples for Volumes Update. */ +/** + * Samples for Volumes Update. + */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Patch.json */ /** * Sample code: Patch volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Volume resource = - manager - .volumes() - .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) - .getValue(); + Volume resource = manager.volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml index d5586c20ece7b..f72cfdeaaea3d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for NetworkCloud Management - This package contains Microsoft Azure SDK for NetworkCloud Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. Package tag package-2023-07-01. + This package contains Microsoft Azure SDK for NetworkCloud Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, hardware resources, and workload infrastructure resources. Package tag package-2024-10-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,8 @@ UTF-8 0 0 + true + false @@ -75,8 +77,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java index 377afb07e3ae2..0c0f0f4954c1c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java @@ -32,6 +32,7 @@ import com.azure.resourcemanager.networkcloud.implementation.ClusterManagersImpl; import com.azure.resourcemanager.networkcloud.implementation.ClustersImpl; import com.azure.resourcemanager.networkcloud.implementation.ConsolesImpl; +import com.azure.resourcemanager.networkcloud.implementation.KubernetesClusterFeaturesImpl; import com.azure.resourcemanager.networkcloud.implementation.KubernetesClustersImpl; import com.azure.resourcemanager.networkcloud.implementation.L2NetworksImpl; import com.azure.resourcemanager.networkcloud.implementation.L3NetworksImpl; @@ -52,6 +53,7 @@ import com.azure.resourcemanager.networkcloud.models.ClusterManagers; import com.azure.resourcemanager.networkcloud.models.Clusters; import com.azure.resourcemanager.networkcloud.models.Consoles; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatures; import com.azure.resourcemanager.networkcloud.models.KubernetesClusters; import com.azure.resourcemanager.networkcloud.models.L2Networks; import com.azure.resourcemanager.networkcloud.models.L3Networks; @@ -71,8 +73,9 @@ import java.util.stream.Collectors; /** - * Entry point to NetworkCloudManager. The Network Cloud APIs provide management of the on-premises clusters and their - * resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + * Entry point to NetworkCloudManager. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ public final class NetworkCloudManager { private Operations operations; @@ -111,6 +114,8 @@ public final class NetworkCloudManager { private AgentPools agentPools; + private KubernetesClusterFeatures kubernetesClusterFeatures; + private Consoles consoles; private final NetworkCloud clientObject; @@ -127,7 +132,7 @@ private NetworkCloudManager(HttpPipeline httpPipeline, AzureProfile profile, Dur /** * Creates an instance of NetworkCloud service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the NetworkCloud service API instance. @@ -140,7 +145,7 @@ public static NetworkCloudManager authenticate(TokenCredential credential, Azure /** * Creates an instance of NetworkCloud service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the NetworkCloud service API instance. @@ -153,14 +158,16 @@ public static NetworkCloudManager authenticate(HttpPipeline httpPipeline, AzureP /** * Gets a Configurable instance that can be used to create NetworkCloudManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new NetworkCloudManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -232,8 +239,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -275,7 +282,7 @@ public NetworkCloudManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.networkcloud") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -323,7 +330,7 @@ public NetworkCloudManager authenticate(TokenCredential credential, AzureProfile /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -335,7 +342,7 @@ public Operations operations() { /** * Gets the resource collection API of BareMetalMachines. It manages BareMetalMachine. - * + * * @return Resource collection API of BareMetalMachines. */ public BareMetalMachines bareMetalMachines() { @@ -347,7 +354,7 @@ public BareMetalMachines bareMetalMachines() { /** * Gets the resource collection API of CloudServicesNetworks. It manages CloudServicesNetwork. - * + * * @return Resource collection API of CloudServicesNetworks. */ public CloudServicesNetworks cloudServicesNetworks() { @@ -359,7 +366,7 @@ public CloudServicesNetworks cloudServicesNetworks() { /** * Gets the resource collection API of ClusterManagers. It manages ClusterManager. - * + * * @return Resource collection API of ClusterManagers. */ public ClusterManagers clusterManagers() { @@ -371,7 +378,7 @@ public ClusterManagers clusterManagers() { /** * Gets the resource collection API of Clusters. It manages Cluster. - * + * * @return Resource collection API of Clusters. */ public Clusters clusters() { @@ -383,7 +390,7 @@ public Clusters clusters() { /** * Gets the resource collection API of KubernetesClusters. It manages KubernetesCluster. - * + * * @return Resource collection API of KubernetesClusters. */ public KubernetesClusters kubernetesClusters() { @@ -395,7 +402,7 @@ public KubernetesClusters kubernetesClusters() { /** * Gets the resource collection API of L2Networks. It manages L2Network. - * + * * @return Resource collection API of L2Networks. */ public L2Networks l2Networks() { @@ -407,7 +414,7 @@ public L2Networks l2Networks() { /** * Gets the resource collection API of L3Networks. It manages L3Network. - * + * * @return Resource collection API of L3Networks. */ public L3Networks l3Networks() { @@ -419,7 +426,7 @@ public L3Networks l3Networks() { /** * Gets the resource collection API of RackSkus. - * + * * @return Resource collection API of RackSkus. */ public RackSkus rackSkus() { @@ -431,7 +438,7 @@ public RackSkus rackSkus() { /** * Gets the resource collection API of Racks. It manages Rack. - * + * * @return Resource collection API of Racks. */ public Racks racks() { @@ -443,7 +450,7 @@ public Racks racks() { /** * Gets the resource collection API of StorageAppliances. It manages StorageAppliance. - * + * * @return Resource collection API of StorageAppliances. */ public StorageAppliances storageAppliances() { @@ -455,7 +462,7 @@ public StorageAppliances storageAppliances() { /** * Gets the resource collection API of TrunkedNetworks. It manages TrunkedNetwork. - * + * * @return Resource collection API of TrunkedNetworks. */ public TrunkedNetworks trunkedNetworks() { @@ -467,7 +474,7 @@ public TrunkedNetworks trunkedNetworks() { /** * Gets the resource collection API of VirtualMachines. It manages VirtualMachine. - * + * * @return Resource collection API of VirtualMachines. */ public VirtualMachines virtualMachines() { @@ -479,7 +486,7 @@ public VirtualMachines virtualMachines() { /** * Gets the resource collection API of Volumes. It manages Volume. - * + * * @return Resource collection API of Volumes. */ public Volumes volumes() { @@ -491,7 +498,7 @@ public Volumes volumes() { /** * Gets the resource collection API of BareMetalMachineKeySets. It manages BareMetalMachineKeySet. - * + * * @return Resource collection API of BareMetalMachineKeySets. */ public BareMetalMachineKeySets bareMetalMachineKeySets() { @@ -504,7 +511,7 @@ public BareMetalMachineKeySets bareMetalMachineKeySets() { /** * Gets the resource collection API of BmcKeySets. It manages BmcKeySet. - * + * * @return Resource collection API of BmcKeySets. */ public BmcKeySets bmcKeySets() { @@ -516,7 +523,7 @@ public BmcKeySets bmcKeySets() { /** * Gets the resource collection API of MetricsConfigurations. It manages ClusterMetricsConfiguration. - * + * * @return Resource collection API of MetricsConfigurations. */ public MetricsConfigurations metricsConfigurations() { @@ -528,7 +535,7 @@ public MetricsConfigurations metricsConfigurations() { /** * Gets the resource collection API of AgentPools. It manages AgentPool. - * + * * @return Resource collection API of AgentPools. */ public AgentPools agentPools() { @@ -538,9 +545,22 @@ public AgentPools agentPools() { return agentPools; } + /** + * Gets the resource collection API of KubernetesClusterFeatures. It manages KubernetesClusterFeature. + * + * @return Resource collection API of KubernetesClusterFeatures. + */ + public KubernetesClusterFeatures kubernetesClusterFeatures() { + if (this.kubernetesClusterFeatures == null) { + this.kubernetesClusterFeatures + = new KubernetesClusterFeaturesImpl(clientObject.getKubernetesClusterFeatures(), this); + } + return kubernetesClusterFeatures; + } + /** * Gets the resource collection API of Consoles. It manages Console. - * + * * @return Resource collection API of Consoles. */ public Consoles consoles() { @@ -553,7 +573,7 @@ public Consoles consoles() { /** * Gets wrapped service client NetworkCloud providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. - * + * * @return Wrapped service client NetworkCloud. */ public NetworkCloud serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/AgentPoolsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/AgentPoolsClient.java index f8d7c2c2ee8ab..dfa22108db573 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/AgentPoolsClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/AgentPoolsClient.java @@ -12,39 +12,42 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.AgentPoolPatchParameters; -/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ +/** + * An instance of this class provides access to all the operations defined in AgentPoolsClient. + */ public interface AgentPoolsClient { /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName); /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName, @@ -52,9 +55,9 @@ PagedIterable listByKubernetesCluster(String resourceGroupName, /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -70,9 +73,9 @@ Response getWithResponse(String resourceGroupName, String kubern /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -86,9 +89,9 @@ Response getWithResponse(String resourceGroupName, String kubern /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -104,9 +107,9 @@ SyncPoller, AgentPoolInner> beginCreateOrUpdate(Strin /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -123,9 +126,9 @@ SyncPoller, AgentPoolInner> beginCreateOrUpdate(Strin /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -141,9 +144,9 @@ AgentPoolInner createOrUpdate(String resourceGroupName, String kubernetesCluster /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -160,26 +163,26 @@ AgentPoolInner createOrUpdate(String resourceGroupName, String kubernetesCluster /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - String agentPoolName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName, String agentPoolName); /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -187,32 +190,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - String agentPoolName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName, String agentPoolName, Context context); /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName); + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName); /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -220,16 +224,18 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, + Context context); /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -244,10 +250,10 @@ SyncPoller, AgentPoolInner> beginUpdate(String resour /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -265,10 +271,10 @@ SyncPoller, AgentPoolInner> beginUpdate(String resour /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -282,10 +288,10 @@ SyncPoller, AgentPoolInner> beginUpdate(String resour /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java index c9bd38e654375..a3cb36390fbf2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java @@ -12,39 +12,42 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPatchParameters; -/** An instance of this class provides access to all the operations defined in BareMetalMachineKeySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in BareMetalMachineKeySetsClient. + */ public interface BareMetalMachineKeySetsClient { /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, @@ -52,9 +55,9 @@ PagedIterable listByCluster(String resourceGroupNam /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -70,9 +73,9 @@ Response getWithResponse(String resourceGroupName, /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -86,9 +89,9 @@ Response getWithResponse(String resourceGroupName, /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -105,9 +108,9 @@ SyncPoller, BareMetalMachineKeySetInner> /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -125,9 +128,9 @@ SyncPoller, BareMetalMachineKeySetInner> /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -143,9 +146,9 @@ BareMetalMachineKeySetInner createOrUpdate(String resourceGroupName, String clus /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -163,26 +166,26 @@ BareMetalMachineKeySetInner createOrUpdate(String resourceGroupName, String clus /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String bareMetalMachineKeySetName); /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -190,32 +193,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String bareMetalMachineKeySetName, Context context); /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -223,16 +227,18 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, + Context context); /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -247,10 +253,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -268,10 +274,10 @@ SyncPoller, BareMetalMachineKeySetInner> /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -285,10 +291,10 @@ SyncPoller, BareMetalMachineKeySetInner> /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java index 4838ac61716e4..a080f1775dffc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java @@ -21,72 +21,74 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; -/** An instance of this class provides access to all the operations defined in BareMetalMachinesClient. */ +/** + * An instance of this class provides access to all the operations defined in BareMetalMachinesClient. + */ public interface BareMetalMachinesClient { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -101,9 +103,9 @@ Response getByResourceGroupWithResponse(String resourceGr /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,10 +118,10 @@ Response getByResourceGroupWithResponse(String resourceGr /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -134,10 +136,10 @@ SyncPoller, BareMetalMachineInner> beginCreate /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -153,10 +155,10 @@ SyncPoller, BareMetalMachineInner> beginCreate /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -171,10 +173,10 @@ BareMetalMachineInner createOrUpdate(String resourceGroupName, String bareMetalM /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -190,75 +192,78 @@ BareMetalMachineInner createOrUpdate(String resourceGroupName, String bareMetalM /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String bareMetalMachineName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String bareMetalMachineName); /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String bareMetalMachineName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String bareMetalMachineName, Context context); /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String bareMetalMachineName); + OperationStatusResultInner delete(String resourceGroupName, String bareMetalMachineName); /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String bareMetalMachineName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String bareMetalMachineName, Context context); /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -272,10 +277,10 @@ SyncPoller, BareMetalMachineInner> beginUpdate /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -291,10 +296,10 @@ SyncPoller, BareMetalMachineInner> beginUpdate /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -307,10 +312,10 @@ SyncPoller, BareMetalMachineInner> beginUpdate /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -326,9 +331,9 @@ BareMetalMachineInner update(String resourceGroupName, String bareMetalMachineNa /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -342,9 +347,9 @@ SyncPoller, OperationStatusResultInner> b /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -361,9 +366,9 @@ SyncPoller, OperationStatusResultInner> b /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -376,9 +381,9 @@ SyncPoller, OperationStatusResultInner> b /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -394,9 +399,9 @@ OperationStatusResultInner cordon(String resourceGroupName, String bareMetalMach /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -410,9 +415,9 @@ OperationStatusResultInner cordon(String resourceGroupName, String bareMetalMach /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -429,9 +434,9 @@ SyncPoller, OperationStatusResultInner> b /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -444,9 +449,9 @@ SyncPoller, OperationStatusResultInner> b /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -462,9 +467,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -478,9 +483,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -495,9 +500,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -510,9 +515,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -526,9 +531,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -542,9 +547,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String bareMetalMa /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -561,9 +566,9 @@ SyncPoller, OperationStatusResultInner> b /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -576,9 +581,9 @@ SyncPoller, OperationStatusResultInner> b /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -594,9 +599,9 @@ OperationStatusResultInner replace(String resourceGroupName, String bareMetalMac /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -610,9 +615,9 @@ OperationStatusResultInner replace(String resourceGroupName, String bareMetalMac /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -627,9 +632,9 @@ OperationStatusResultInner replace(String resourceGroupName, String bareMetalMac /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -642,9 +647,9 @@ OperationStatusResultInner replace(String resourceGroupName, String bareMetalMac /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -658,10 +663,10 @@ OperationStatusResultInner replace(String resourceGroupName, String bareMetalMac /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -677,10 +682,10 @@ SyncPoller, OperationStatusResultInner> b /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -697,10 +702,10 @@ SyncPoller, OperationStatusResultInner> b /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -715,10 +720,10 @@ OperationStatusResultInner runCommand(String resourceGroupName, String bareMetal /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -734,11 +739,10 @@ OperationStatusResultInner runCommand(String resourceGroupName, String bareMetal /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -754,11 +758,10 @@ SyncPoller, OperationStatusResultInner> b /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -775,11 +778,10 @@ SyncPoller, OperationStatusResultInner> b /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -794,11 +796,10 @@ OperationStatusResultInner runDataExtracts(String resourceGroupName, String bare /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -814,11 +815,11 @@ OperationStatusResultInner runDataExtracts(String resourceGroupName, String bare /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -834,11 +835,11 @@ SyncPoller, OperationStatusResultInner> b /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -855,11 +856,11 @@ SyncPoller, OperationStatusResultInner> b /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -874,11 +875,11 @@ OperationStatusResultInner runReadCommands(String resourceGroupName, String bare /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -894,9 +895,9 @@ OperationStatusResultInner runReadCommands(String resourceGroupName, String bare /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -910,9 +911,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -927,9 +928,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -942,9 +943,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -958,9 +959,9 @@ SyncPoller, OperationStatusResultInner> b /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -974,9 +975,9 @@ SyncPoller, OperationStatusResultInner> b /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -991,9 +992,9 @@ SyncPoller, OperationStatusResultInner> b /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1006,9 +1007,9 @@ SyncPoller, OperationStatusResultInner> b /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java index d7c1ab1820718..d9577dcaef5c4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java @@ -12,31 +12,34 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BmcKeySetPatchParameters; -/** An instance of this class provides access to all the operations defined in BmcKeySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in BmcKeySetsClient. + */ public interface BmcKeySetsClient { /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -44,16 +47,16 @@ public interface BmcKeySetsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -69,9 +72,9 @@ Response getWithResponse(String resourceGroupName, String cluste /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -85,9 +88,9 @@ Response getWithResponse(String resourceGroupName, String cluste /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -103,9 +106,9 @@ SyncPoller, BmcKeySetInner> beginCreateOrUpdate(Strin /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -122,9 +125,9 @@ SyncPoller, BmcKeySetInner> beginCreateOrUpdate(Strin /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -140,9 +143,9 @@ BmcKeySetInner createOrUpdate(String resourceGroupName, String clusterName, Stri /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -159,25 +162,26 @@ BmcKeySetInner createOrUpdate(String resourceGroupName, String clusterName, Stri /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String bmcKeySetName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String bmcKeySetName); /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -185,32 +189,33 @@ BmcKeySetInner createOrUpdate(String resourceGroupName, String clusterName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String bmcKeySetName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String bmcKeySetName, Context context); /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String bmcKeySetName); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bmcKeySetName); /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -218,16 +223,18 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bmcKeySetName, + Context context); /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -242,10 +249,10 @@ SyncPoller, BmcKeySetInner> beginUpdate(String resour /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -262,10 +269,10 @@ SyncPoller, BmcKeySetInner> beginUpdate(String resour /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -279,10 +286,10 @@ SyncPoller, BmcKeySetInner> beginUpdate(String resour /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java index 55897bdf99f69..fb74bd678c832 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java @@ -12,74 +12,77 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; -/** An instance of this class provides access to all the operations defined in CloudServicesNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in CloudServicesNetworksClient. + */ public interface CloudServicesNetworksClient { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. @@ -94,9 +97,9 @@ Response getByResourceGroupWithResponse(String resour /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +112,9 @@ Response getByResourceGroupWithResponse(String resour /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -119,7 +122,7 @@ Response getByResourceGroupWithResponse(String resour * @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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( @@ -128,9 +131,9 @@ SyncPoller, CloudServicesNetworkInner> beg /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -139,7 +142,7 @@ SyncPoller, CloudServicesNetworkInner> beg * @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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( @@ -148,9 +151,9 @@ SyncPoller, CloudServicesNetworkInner> beg /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -158,7 +161,7 @@ SyncPoller, CloudServicesNetworkInner> beg * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudServicesNetworkName, @@ -166,9 +169,9 @@ CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudS /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -177,7 +180,7 @@ CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudS * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudServicesNetworkName, @@ -185,78 +188,81 @@ CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudS /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServicesNetworkName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String cloudServicesNetworkName); /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServicesNetworkName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String cloudServicesNetworkName, Context context); /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cloudServicesNetworkName); + OperationStatusResultInner delete(String resourceGroupName, String cloudServicesNetworkName); /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cloudServicesNetworkName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String cloudServicesNetworkName, Context context); /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CloudServicesNetworkInner> beginUpdate(String resourceGroupName, @@ -264,10 +270,10 @@ SyncPoller, CloudServicesNetworkInner> beg /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -276,7 +282,7 @@ SyncPoller, CloudServicesNetworkInner> beg * @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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CloudServicesNetworkInner> beginUpdate(String resourceGroupName, @@ -285,27 +291,27 @@ SyncPoller, CloudServicesNetworkInner> beg /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName); /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -314,7 +320,7 @@ SyncPoller, CloudServicesNetworkInner> beg * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java index 0455ae4cd4cd0..03283b6cc497d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java @@ -12,15 +12,18 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; -/** An instance of this class provides access to all the operations defined in ClusterManagersClient. */ +/** + * An instance of this class provides access to all the operations defined in ClusterManagersClient. + */ public interface ClusterManagersClient { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. @@ -30,9 +33,9 @@ public interface ClusterManagersClient { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @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. @@ -44,40 +47,40 @@ public interface ClusterManagersClient { /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. @@ -92,9 +95,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,9 +110,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -117,7 +120,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterManagerInner> beginCreateOrUpdate(String resourceGroupName, @@ -125,9 +128,9 @@ SyncPoller, ClusterManagerInner> beginCreateOrUp /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -136,7 +139,7 @@ SyncPoller, ClusterManagerInner> beginCreateOrUp * @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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterManagerInner> beginCreateOrUpdate(String resourceGroupName, @@ -144,9 +147,9 @@ SyncPoller, ClusterManagerInner> beginCreateOrUp /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -161,9 +164,9 @@ ClusterManagerInner createOrUpdate(String resourceGroupName, String clusterManag /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -179,71 +182,74 @@ ClusterManagerInner createOrUpdate(String resourceGroupName, String clusterManag /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterManagerName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterManagerName); /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterManagerName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterManagerName, Context context); /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterManagerName); + OperationStatusResultInner delete(String resourceGroupName, String clusterManagerName); /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterManagerName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String clusterManagerName, Context context); /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerUpdateParameters The request body. @@ -251,8 +257,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String clusterManagerName, @@ -260,10 +266,10 @@ Response updateWithResponse(String resourceGroupName, Strin /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java index cc2519449a205..8eafb0f8c921e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java @@ -13,17 +13,21 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; -/** An instance of this class provides access to all the operations defined in ClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ public interface ClustersClient { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. @@ -33,9 +37,9 @@ public interface ClustersClient { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @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. @@ -47,9 +51,9 @@ public interface ClustersClient { /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,9 +65,9 @@ public interface ClustersClient { /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,9 +80,9 @@ public interface ClustersClient { /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -93,9 +97,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName, /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -108,9 +112,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName, /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -125,9 +129,9 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -143,9 +147,9 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -159,9 +163,9 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -177,70 +181,74 @@ ClusterInner createOrUpdate(String resourceGroupName, String clusterName, Cluste /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName); /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, Context context); /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName); + OperationStatusResultInner delete(String resourceGroupName, String clusterName); /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, Context context); /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -253,10 +261,10 @@ ClusterInner createOrUpdate(String resourceGroupName, String clusterName, Cluste /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -272,10 +280,10 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -288,10 +296,10 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -306,10 +314,86 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterPatchPa Context context); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginContinueUpdateVersion( + String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginContinueUpdateVersion( + String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context); + + /** + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -322,10 +406,10 @@ SyncPoller, OperationStatusResultInner> b String clusterName); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -340,10 +424,10 @@ SyncPoller, OperationStatusResultInner> b String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -355,10 +439,10 @@ SyncPoller, OperationStatusResultInner> b OperationStatusResultInner deploy(String resourceGroupName, String clusterName); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -372,11 +456,83 @@ SyncPoller, OperationStatusResultInner> b OperationStatusResultInner deploy(String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> + beginScanRuntime(String resourceGroupName, String clusterName); + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginScanRuntime( + String resourceGroupName, String clusterName, ClusterScanRuntimeParameters clusterScanRuntimeParameters, + Context context); + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner scanRuntime(String resourceGroupName, String clusterName); + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner scanRuntime(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context); + /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -391,9 +547,9 @@ SyncPoller, OperationStatusResultInner> b /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -410,9 +566,9 @@ SyncPoller, OperationStatusResultInner> b /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -427,9 +583,9 @@ OperationStatusResultInner updateVersion(String resourceGroupName, String cluste /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java index fd005f1727b11..a3008ede4aa5b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java @@ -12,15 +12,18 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ConsolePatchParameters; -/** An instance of this class provides access to all the operations defined in ConsolesClient. */ +/** + * An instance of this class provides access to all the operations defined in ConsolesClient. + */ public interface ConsolesClient { /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -33,9 +36,9 @@ public interface ConsolesClient { /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -50,9 +53,9 @@ PagedIterable listByVirtualMachine(String resourceGroupName, Strin /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -68,9 +71,9 @@ Response getWithResponse(String resourceGroupName, String virtualM /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -84,9 +87,9 @@ Response getWithResponse(String resourceGroupName, String virtualM /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -95,7 +98,7 @@ Response getWithResponse(String resourceGroupName, String virtualM * @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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ConsoleInner> beginCreateOrUpdate(String resourceGroupName, @@ -103,9 +106,9 @@ SyncPoller, ConsoleInner> beginCreateOrUpdate(String re /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -115,7 +118,7 @@ SyncPoller, ConsoleInner> beginCreateOrUpdate(String re * @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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ConsoleInner> beginCreateOrUpdate(String resourceGroupName, @@ -123,9 +126,9 @@ SyncPoller, ConsoleInner> beginCreateOrUpdate(String re /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -141,9 +144,9 @@ ConsoleInner createOrUpdate(String resourceGroupName, String virtualMachineName, /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -160,26 +163,26 @@ ConsoleInner createOrUpdate(String resourceGroupName, String virtualMachineName, /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - String consoleName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String virtualMachineName, String consoleName); /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -187,32 +190,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - String consoleName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String virtualMachineName, String consoleName, Context context); /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName, String consoleName); + OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, String consoleName); /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -220,16 +224,18 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, String consoleName, + Context context); /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -237,7 +243,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ConsoleInner> beginUpdate(String resourceGroupName, String virtualMachineName, @@ -245,10 +251,10 @@ SyncPoller, ConsoleInner> beginUpdate(String resourceGr /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -258,7 +264,7 @@ SyncPoller, ConsoleInner> beginUpdate(String resourceGr * @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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ConsoleInner> beginUpdate(String resourceGroupName, String virtualMachineName, @@ -266,10 +272,10 @@ SyncPoller, ConsoleInner> beginUpdate(String resourceGr /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -283,10 +289,10 @@ SyncPoller, ConsoleInner> beginUpdate(String resourceGr /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClusterFeaturesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClusterFeaturesClient.java new file mode 100644 index 0000000000000..83c6d83d665ea --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClusterFeaturesClient.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeaturePatchParameters; + +/** + * An instance of this class provides access to all the operations defined in KubernetesClusterFeaturesClient. + */ +public interface KubernetesClusterFeaturesClient { + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName); + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName, Context context); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 properties of the provided the Kubernetes cluster feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String kubernetesClusterName, + String featureName, Context context); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 properties of the provided the Kubernetes cluster feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesClusterFeatureInner get(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KubernetesClusterFeatureInner> beginCreateOrUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters); + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KubernetesClusterFeatureInner> beginCreateOrUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context); + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesClusterFeatureInner createOrUpdate(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeatureInner kubernetesClusterFeatureParameters); + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesClusterFeatureInner createOrUpdate(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName, String featureName); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName, String featureName, Context context); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, String featureName, + Context context); + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KubernetesClusterFeatureInner> + beginUpdate(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KubernetesClusterFeatureInner> beginUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, Context context); + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesClusterFeatureInner update(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesClusterFeatureInner update(String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClustersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClustersClient.java index 566d4289b54d4..85f6005bfd512 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClustersClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/KubernetesClustersClient.java @@ -16,72 +16,74 @@ import com.azure.resourcemanager.networkcloud.models.KubernetesClusterPatchParameters; import com.azure.resourcemanager.networkcloud.models.KubernetesClusterRestartNodeParameters; -/** An instance of this class provides access to all the operations defined in KubernetesClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in KubernetesClustersClient. + */ public interface KubernetesClustersClient { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -96,9 +98,9 @@ Response getByResourceGroupWithResponse(String resourceG /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -111,9 +113,9 @@ Response getByResourceGroupWithResponse(String resourceG /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -121,7 +123,7 @@ Response getByResourceGroupWithResponse(String resourceG * @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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, KubernetesClusterInner> beginCreateOrUpdate(String resourceGroupName, @@ -129,9 +131,9 @@ SyncPoller, KubernetesClusterInner> beginCrea /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -140,7 +142,7 @@ SyncPoller, KubernetesClusterInner> beginCrea * @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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, KubernetesClusterInner> beginCreateOrUpdate(String resourceGroupName, @@ -148,9 +150,9 @@ SyncPoller, KubernetesClusterInner> beginCrea /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -165,9 +167,9 @@ KubernetesClusterInner createOrUpdate(String resourceGroupName, String kubernete /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -183,78 +185,81 @@ KubernetesClusterInner createOrUpdate(String resourceGroupName, String kubernete /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName); /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String kubernetesClusterName, Context context); /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String kubernetesClusterName); + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName); /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String kubernetesClusterName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, Context context); /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, KubernetesClusterInner> beginUpdate(String resourceGroupName, @@ -262,10 +267,10 @@ SyncPoller, KubernetesClusterInner> beginUpda /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -274,7 +279,7 @@ SyncPoller, KubernetesClusterInner> beginUpda * @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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, KubernetesClusterInner> beginUpdate(String resourceGroupName, @@ -283,10 +288,10 @@ SyncPoller, KubernetesClusterInner> beginUpda /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,10 +304,10 @@ SyncPoller, KubernetesClusterInner> beginUpda /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -318,9 +323,9 @@ KubernetesClusterInner update(String resourceGroupName, String kubernetesCluster /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -336,9 +341,9 @@ SyncPoller, OperationStatusResultInner> b /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -355,9 +360,9 @@ SyncPoller, OperationStatusResultInner> b /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -372,9 +377,9 @@ OperationStatusResultInner restartNode(String resourceGroupName, String kubernet /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java index 84c6b54314189..920089ab1d9a9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java @@ -12,74 +12,77 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; -/** An instance of this class provides access to all the operations defined in L2NetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in L2NetworksClient. + */ public interface L2NetworksClient { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. @@ -94,9 +97,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +112,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -119,7 +122,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName * @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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, L2NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -127,9 +130,9 @@ SyncPoller, L2NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -138,7 +141,7 @@ SyncPoller, L2NetworkInner> beginCreateOrUpdate(Strin * @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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, L2NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -146,9 +149,9 @@ SyncPoller, L2NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -162,9 +165,9 @@ SyncPoller, L2NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -180,69 +183,73 @@ L2NetworkInner createOrUpdate(String resourceGroupName, String l2NetworkName, L2 /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String l2NetworkName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String l2NetworkName); /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String l2NetworkName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String l2NetworkName, Context context); /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String l2NetworkName); + OperationStatusResultInner delete(String resourceGroupName, String l2NetworkName); /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String l2NetworkName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String l2NetworkName, Context context); /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkUpdateParameters The request body. @@ -251,7 +258,7 @@ L2NetworkInner createOrUpdate(String resourceGroupName, String l2NetworkName, L2 * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String l2NetworkName, @@ -259,9 +266,9 @@ Response updateWithResponse(String resourceGroupName, String l2N /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java index 2a84e0f22b86d..19634a6839ccf 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java @@ -12,74 +12,77 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; -/** An instance of this class provides access to all the operations defined in L3NetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in L3NetworksClient. + */ public interface L3NetworksClient { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. @@ -94,9 +97,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +112,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -119,7 +122,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName * @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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, L3NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -127,9 +130,9 @@ SyncPoller, L3NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -138,7 +141,7 @@ SyncPoller, L3NetworkInner> beginCreateOrUpdate(Strin * @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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, L3NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -146,9 +149,9 @@ SyncPoller, L3NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -162,9 +165,9 @@ SyncPoller, L3NetworkInner> beginCreateOrUpdate(Strin /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -180,69 +183,73 @@ L3NetworkInner createOrUpdate(String resourceGroupName, String l3NetworkName, L3 /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String l3NetworkName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String l3NetworkName); /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String l3NetworkName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String l3NetworkName, Context context); /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String l3NetworkName); + OperationStatusResultInner delete(String resourceGroupName, String l3NetworkName); /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String l3NetworkName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String l3NetworkName, Context context); /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkUpdateParameters The request body. @@ -251,7 +258,7 @@ L3NetworkInner createOrUpdate(String resourceGroupName, String l3NetworkName, L3 * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String l3NetworkName, @@ -259,9 +266,9 @@ Response updateWithResponse(String resourceGroupName, String l3N /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java index 57c80d091d84c..60b209cace280 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java @@ -12,39 +12,42 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; -/** An instance of this class provides access to all the operations defined in MetricsConfigurationsClient. */ +/** + * An instance of this class provides access to all the operations defined in MetricsConfigurationsClient. + */ public interface MetricsConfigurationsClient { /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, @@ -52,9 +55,9 @@ PagedIterable listByCluster(String resourceGro /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -70,9 +73,9 @@ Response getWithResponse(String resourceGroupN /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -86,9 +89,9 @@ Response getWithResponse(String resourceGroupN /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -97,7 +100,7 @@ Response getWithResponse(String resourceGroupN * @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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterMetricsConfigurationInner> beginCreateOrUpdate( @@ -106,9 +109,9 @@ SyncPoller, ClusterMetricsConfigura /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -118,7 +121,7 @@ SyncPoller, ClusterMetricsConfigura * @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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterMetricsConfigurationInner> beginCreateOrUpdate( @@ -127,9 +130,9 @@ SyncPoller, ClusterMetricsConfigura /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -145,9 +148,9 @@ ClusterMetricsConfigurationInner createOrUpdate(String resourceGroupName, String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -165,26 +168,26 @@ ClusterMetricsConfigurationInner createOrUpdate(String resourceGroupName, String /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String metricsConfigurationName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String metricsConfigurationName); /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -192,32 +195,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String metricsConfigurationName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String clusterName, String metricsConfigurationName, Context context); /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String metricsConfigurationName); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String metricsConfigurationName); /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -225,16 +229,18 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String clusterName, String metricsConfigurationName, + Context context); /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -242,7 +248,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterMetricsConfigurationInner> @@ -250,10 +256,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -263,7 +269,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( @@ -272,10 +278,10 @@ SyncPoller, ClusterMetricsConfigura /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -290,10 +296,10 @@ ClusterMetricsConfigurationInner update(String resourceGroupName, String cluster /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java index 0a203d81dc1c6..2a5073c41590e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java @@ -7,172 +7,181 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for NetworkCloud class. */ +/** + * The interface for NetworkCloud class. + */ public interface NetworkCloud { /** * Gets The ID of the target subscription. The value must be an UUID. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the BareMetalMachinesClient object to access its operations. - * + * * @return the BareMetalMachinesClient object. */ BareMetalMachinesClient getBareMetalMachines(); /** * Gets the CloudServicesNetworksClient object to access its operations. - * + * * @return the CloudServicesNetworksClient object. */ CloudServicesNetworksClient getCloudServicesNetworks(); /** * Gets the ClusterManagersClient object to access its operations. - * + * * @return the ClusterManagersClient object. */ ClusterManagersClient getClusterManagers(); /** * Gets the ClustersClient object to access its operations. - * + * * @return the ClustersClient object. */ ClustersClient getClusters(); /** * Gets the KubernetesClustersClient object to access its operations. - * + * * @return the KubernetesClustersClient object. */ KubernetesClustersClient getKubernetesClusters(); /** * Gets the L2NetworksClient object to access its operations. - * + * * @return the L2NetworksClient object. */ L2NetworksClient getL2Networks(); /** * Gets the L3NetworksClient object to access its operations. - * + * * @return the L3NetworksClient object. */ L3NetworksClient getL3Networks(); /** * Gets the RackSkusClient object to access its operations. - * + * * @return the RackSkusClient object. */ RackSkusClient getRackSkus(); /** * Gets the RacksClient object to access its operations. - * + * * @return the RacksClient object. */ RacksClient getRacks(); /** * Gets the StorageAppliancesClient object to access its operations. - * + * * @return the StorageAppliancesClient object. */ StorageAppliancesClient getStorageAppliances(); /** * Gets the TrunkedNetworksClient object to access its operations. - * + * * @return the TrunkedNetworksClient object. */ TrunkedNetworksClient getTrunkedNetworks(); /** * Gets the VirtualMachinesClient object to access its operations. - * + * * @return the VirtualMachinesClient object. */ VirtualMachinesClient getVirtualMachines(); /** * Gets the VolumesClient object to access its operations. - * + * * @return the VolumesClient object. */ VolumesClient getVolumes(); /** * Gets the BareMetalMachineKeySetsClient object to access its operations. - * + * * @return the BareMetalMachineKeySetsClient object. */ BareMetalMachineKeySetsClient getBareMetalMachineKeySets(); /** * Gets the BmcKeySetsClient object to access its operations. - * + * * @return the BmcKeySetsClient object. */ BmcKeySetsClient getBmcKeySets(); /** * Gets the MetricsConfigurationsClient object to access its operations. - * + * * @return the MetricsConfigurationsClient object. */ MetricsConfigurationsClient getMetricsConfigurations(); /** * Gets the AgentPoolsClient object to access its operations. - * + * * @return the AgentPoolsClient object. */ AgentPoolsClient getAgentPools(); + /** + * Gets the KubernetesClusterFeaturesClient object to access its operations. + * + * @return the KubernetesClusterFeaturesClient object. + */ + KubernetesClusterFeaturesClient getKubernetesClusterFeatures(); + /** * Gets the ConsolesClient object to access its operations. - * + * * @return the ConsolesClient object. */ ConsolesClient getConsoles(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java index c0d84ee978e6e..aaa79c8b407d2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java @@ -10,14 +10,15 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations as paginated response with {@link PagedIterable}. @@ -27,10 +28,9 @@ public interface OperationsClient { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @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. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java index 47603b44e7a56..1ffb54240ddfd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java @@ -11,13 +11,15 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; -/** An instance of this class provides access to all the operations defined in RackSkusClient. */ +/** + * An instance of this class provides access to all the operations defined in RackSkusClient. + */ public interface RackSkusClient { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. @@ -27,9 +29,9 @@ public interface RackSkusClient { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @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. @@ -41,9 +43,9 @@ public interface RackSkusClient { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -56,9 +58,9 @@ public interface RackSkusClient { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java index c53b0ef984339..3f56ded3bf7e2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java @@ -11,16 +11,19 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; -/** An instance of this class provides access to all the operations defined in RacksClient. */ +/** + * An instance of this class provides access to all the operations defined in RacksClient. + */ public interface RacksClient { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription as paginated response with {@link PagedIterable}. @@ -30,9 +33,9 @@ public interface RacksClient { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @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. @@ -44,9 +47,9 @@ public interface RacksClient { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,9 +61,9 @@ public interface RacksClient { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,9 +76,9 @@ public interface RacksClient { /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. @@ -89,9 +92,9 @@ public interface RacksClient { /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,10 +107,10 @@ public interface RacksClient { /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -115,7 +118,7 @@ public interface RacksClient { * @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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RackInner> beginCreateOrUpdate(String resourceGroupName, String rackName, @@ -123,10 +126,10 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -135,7 +138,7 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource * @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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RackInner> beginCreateOrUpdate(String resourceGroupName, String rackName, @@ -143,10 +146,10 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -160,10 +163,10 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -178,91 +181,95 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String rackName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String rackName); /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String rackName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String rackName, Context context); /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String rackName); + OperationStatusResultInner delete(String resourceGroupName, String rackName); /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String rackName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String rackName, Context context); /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName); /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -271,7 +278,7 @@ SyncPoller, RackInner> beginCreateOrUpdate(String resource * @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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName, @@ -279,10 +286,10 @@ SyncPoller, RackInner> beginUpdate(String resourceGroupNam /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -295,10 +302,10 @@ SyncPoller, RackInner> beginUpdate(String resourceGroupNam /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java index fd701b5d11476..ee6742c3a43fc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java @@ -16,72 +16,74 @@ import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; -/** An instance of this class provides access to all the operations defined in StorageAppliancesClient. */ +/** + * An instance of this class provides access to all the operations defined in StorageAppliancesClient. + */ public interface StorageAppliancesClient { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -96,9 +98,9 @@ Response getByResourceGroupWithResponse(String resourceGr /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -111,10 +113,10 @@ Response getByResourceGroupWithResponse(String resourceGr /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -122,7 +124,7 @@ Response getByResourceGroupWithResponse(String resourceGr * @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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageApplianceInner> beginCreateOrUpdate(String resourceGroupName, @@ -130,10 +132,10 @@ SyncPoller, StorageApplianceInner> beginCreate /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -142,7 +144,7 @@ SyncPoller, StorageApplianceInner> beginCreate * @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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageApplianceInner> beginCreateOrUpdate(String resourceGroupName, @@ -150,10 +152,10 @@ SyncPoller, StorageApplianceInner> beginCreate /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -168,10 +170,10 @@ StorageApplianceInner createOrUpdate(String resourceGroupName, String storageApp /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -187,82 +189,85 @@ StorageApplianceInner createOrUpdate(String resourceGroupName, String storageApp /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String storageApplianceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String storageApplianceName); /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String storageApplianceName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String storageApplianceName, Context context); /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String storageApplianceName); + OperationStatusResultInner delete(String resourceGroupName, String storageApplianceName); /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String storageApplianceName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String storageApplianceName, Context context); /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageApplianceInner> beginUpdate(String resourceGroupName, @@ -270,10 +275,10 @@ SyncPoller, StorageApplianceInner> beginUpdate /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -282,7 +287,7 @@ SyncPoller, StorageApplianceInner> beginUpdate * @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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageApplianceInner> beginUpdate(String resourceGroupName, @@ -290,10 +295,10 @@ SyncPoller, StorageApplianceInner> beginUpdate /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -306,10 +311,10 @@ SyncPoller, StorageApplianceInner> beginUpdate /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -325,9 +330,9 @@ StorageApplianceInner update(String resourceGroupName, String storageApplianceNa /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -341,9 +346,9 @@ StorageApplianceInner update(String resourceGroupName, String storageApplianceNa /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -358,9 +363,9 @@ StorageApplianceInner update(String resourceGroupName, String storageApplianceNa /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,9 +378,9 @@ StorageApplianceInner update(String resourceGroupName, String storageApplianceNa /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -390,9 +395,9 @@ OperationStatusResultInner disableRemoteVendorManagement(String resourceGroupNam /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -406,9 +411,9 @@ OperationStatusResultInner disableRemoteVendorManagement(String resourceGroupNam /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -426,9 +431,9 @@ SyncPoller, OperationStatusResultInner> b /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -441,9 +446,9 @@ SyncPoller, OperationStatusResultInner> b /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java index 6a4e777240e11..5b58ac1c0422f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java @@ -11,16 +11,19 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; -/** An instance of this class provides access to all the operations defined in TrunkedNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in TrunkedNetworksClient. + */ public interface TrunkedNetworksClient { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. @@ -30,9 +33,9 @@ public interface TrunkedNetworksClient { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @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. @@ -44,40 +47,40 @@ public interface TrunkedNetworksClient { /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. @@ -92,9 +95,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,9 +110,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -117,7 +120,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -125,9 +128,9 @@ SyncPoller, TrunkedNetworkInner> beginCreateOrUp /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -136,7 +139,7 @@ SyncPoller, TrunkedNetworkInner> beginCreateOrUp * @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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -144,9 +147,9 @@ SyncPoller, TrunkedNetworkInner> beginCreateOrUp /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -154,7 +157,7 @@ SyncPoller, TrunkedNetworkInner> beginCreateOrUp * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetworkName, @@ -162,9 +165,9 @@ TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetwo /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -173,7 +176,7 @@ TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetwo * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetworkName, @@ -181,70 +184,73 @@ TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetwo /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String trunkedNetworkName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String trunkedNetworkName); /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String trunkedNetworkName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String trunkedNetworkName, Context context); /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String trunkedNetworkName); + OperationStatusResultInner delete(String resourceGroupName, String trunkedNetworkName); /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String trunkedNetworkName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String trunkedNetworkName, Context context); /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkUpdateParameters The request body. @@ -253,7 +259,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response}. + * create a trunked network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String trunkedNetworkName, @@ -261,16 +267,16 @@ Response updateWithResponse(String resourceGroupName, Strin /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) TrunkedNetworkInner update(String resourceGroupName, String trunkedNetworkName); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java index 0e6999abbf834..b784c2b7317dd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java @@ -16,13 +16,15 @@ import com.azure.resourcemanager.networkcloud.models.VirtualMachinePatchParameters; import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachinesClient. + */ public interface VirtualMachinesClient { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. @@ -32,9 +34,9 @@ public interface VirtualMachinesClient { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @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. @@ -46,40 +48,40 @@ public interface VirtualMachinesClient { /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -94,9 +96,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +111,9 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -119,7 +121,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineInner> beginCreateOrUpdate(String resourceGroupName, @@ -127,9 +129,9 @@ SyncPoller, VirtualMachineInner> beginCreateOrUp /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -138,7 +140,7 @@ SyncPoller, VirtualMachineInner> beginCreateOrUp * @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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineInner> beginCreateOrUpdate(String resourceGroupName, @@ -146,9 +148,9 @@ SyncPoller, VirtualMachineInner> beginCreateOrUp /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -163,9 +165,9 @@ VirtualMachineInner createOrUpdate(String resourceGroupName, String virtualMachi /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -181,78 +183,81 @@ VirtualMachineInner createOrUpdate(String resourceGroupName, String virtualMachi /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String virtualMachineName); /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String virtualMachineName, Context context); /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName); + OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName); /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, Context context); /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineInner> beginUpdate(String resourceGroupName, @@ -260,10 +265,10 @@ SyncPoller, VirtualMachineInner> beginUpdate(Str /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -272,7 +277,7 @@ SyncPoller, VirtualMachineInner> beginUpdate(Str * @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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineInner> beginUpdate(String resourceGroupName, @@ -280,10 +285,10 @@ SyncPoller, VirtualMachineInner> beginUpdate(Str /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -296,10 +301,10 @@ SyncPoller, VirtualMachineInner> beginUpdate(Str /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -315,9 +320,9 @@ VirtualMachineInner update(String resourceGroupName, String virtualMachineName, /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -331,9 +336,9 @@ VirtualMachineInner update(String resourceGroupName, String virtualMachineName, /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -350,9 +355,9 @@ SyncPoller, OperationStatusResultInner> b /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -365,9 +370,9 @@ SyncPoller, OperationStatusResultInner> b /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -383,9 +388,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -399,9 +404,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -416,9 +421,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -431,9 +436,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -447,9 +452,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -463,9 +468,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -480,9 +485,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -495,9 +500,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -511,9 +516,9 @@ OperationStatusResultInner powerOff(String resourceGroupName, String virtualMach /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -527,9 +532,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -544,9 +549,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -559,9 +564,9 @@ SyncPoller, OperationStatusResultInner> b /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java index 48580f6a96eb5..ea8357dbfe86e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java @@ -11,16 +11,19 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; -/** An instance of this class provides access to all the operations defined in VolumesClient. */ +/** + * An instance of this class provides access to all the operations defined in VolumesClient. + */ public interface VolumesClient { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. @@ -30,9 +33,9 @@ public interface VolumesClient { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @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. @@ -44,9 +47,9 @@ public interface VolumesClient { /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,9 +61,9 @@ public interface VolumesClient { /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,9 +76,9 @@ public interface VolumesClient { /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. @@ -89,9 +92,9 @@ public interface VolumesClient { /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,9 +107,9 @@ public interface VolumesClient { /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -114,7 +117,7 @@ public interface VolumesClient { * @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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VolumeInner> beginCreateOrUpdate(String resourceGroupName, String volumeName, @@ -122,9 +125,9 @@ SyncPoller, VolumeInner> beginCreateOrUpdate(String reso /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -133,7 +136,7 @@ SyncPoller, VolumeInner> beginCreateOrUpdate(String reso * @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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VolumeInner> beginCreateOrUpdate(String resourceGroupName, String volumeName, @@ -141,9 +144,9 @@ SyncPoller, VolumeInner> beginCreateOrUpdate(String reso /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -157,9 +160,9 @@ SyncPoller, VolumeInner> beginCreateOrUpdate(String reso /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -175,69 +178,73 @@ VolumeInner createOrUpdate(String resourceGroupName, String volumeName, VolumeIn /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String volumeName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String volumeName); /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String volumeName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String volumeName, Context context); /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String volumeName); + OperationStatusResultInner delete(String resourceGroupName, String volumeName); /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String volumeName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String volumeName, Context context); /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeUpdateParameters The request body. @@ -245,8 +252,8 @@ VolumeInner createOrUpdate(String resourceGroupName, String volumeName, VolumeIn * @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 volume represents storage made available for use by resources running on the cluster along with {@link - * Response}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String volumeName, @@ -254,9 +261,9 @@ Response updateWithResponse(String resourceGroupName, String volume /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolInner.java index 3ff074a29efed..d52b2c12dd46f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; 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.networkcloud.models.AdministratorConfiguration; import com.azure.resourcemanager.networkcloud.models.AgentOptions; import com.azure.resourcemanager.networkcloud.models.AgentPoolDetailedStatus; @@ -17,45 +20,54 @@ import com.azure.resourcemanager.networkcloud.models.AttachedNetworkConfiguration; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.KubernetesLabel; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** AgentPool represents the agent pool of Kubernetes cluster. */ +/** + * AgentPool represents the agent pool of Kubernetes cluster. + */ @Fluent public final class AgentPoolInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* - * AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private AgentPoolProperties innerProperties = new AgentPoolProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of AgentPoolInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AgentPoolInner class. + */ public AgentPoolInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -63,11 +75,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the AgentPoolInner object itself. */ @@ -77,11 +86,8 @@ public AgentPoolInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: AgentPoolProperties represents the properties of the Kubernetes cluster agent - * pool. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private AgentPoolProperties innerProperties() { @@ -90,21 +96,55 @@ private AgentPoolProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public AgentPoolInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AgentPoolInner withTags(Map tags) { super.withTags(tags); @@ -112,11 +152,9 @@ public AgentPoolInner withTags(Map tags) { } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Get the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -124,11 +162,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Set the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the AgentPoolInner object itself. */ @@ -141,11 +177,8 @@ public AgentPoolInner withAdministratorConfiguration(AdministratorConfiguration } /** - * Get the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Get the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @return the agentOptions value. */ public AgentOptions agentOptions() { @@ -153,11 +186,8 @@ public AgentOptions agentOptions() { } /** - * Set the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Set the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @param agentOptions the agentOptions value to set. * @return the AgentPoolInner object itself. */ @@ -170,12 +200,9 @@ public AgentPoolInner withAgentOptions(AgentOptions agentOptions) { } /** - * Get the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Get the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @return the attachedNetworkConfiguration value. */ public AttachedNetworkConfiguration attachedNetworkConfiguration() { @@ -183,12 +210,9 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { } /** - * Set the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Set the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @param attachedNetworkConfiguration the attachedNetworkConfiguration value to set. * @return the AgentPoolInner object itself. */ @@ -203,7 +227,7 @@ public AgentPoolInner withAttachedNetworkConfiguration(AttachedNetworkConfigurat /** * Get the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -213,7 +237,7 @@ public List availabilityZones() { /** * Set the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @param availabilityZones the availabilityZones value to set. * @return the AgentPoolInner object itself. */ @@ -227,7 +251,7 @@ public AgentPoolInner withAvailabilityZones(List availabilityZones) { /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public long count() { @@ -236,7 +260,7 @@ public long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the AgentPoolInner object itself. */ @@ -250,7 +274,7 @@ public AgentPoolInner withCount(long count) { /** * Get the detailedStatus property: The current status of the agent pool. - * + * * @return the detailedStatus value. */ public AgentPoolDetailedStatus detailedStatus() { @@ -259,7 +283,7 @@ public AgentPoolDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -268,7 +292,7 @@ public String detailedStatusMessage() { /** * Get the kubernetesVersion property: The Kubernetes version running in this agent pool. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -277,7 +301,7 @@ public String kubernetesVersion() { /** * Get the labels property: The labels applied to the nodes in this agent pool. - * + * * @return the labels value. */ public List labels() { @@ -286,7 +310,7 @@ public List labels() { /** * Set the labels property: The labels applied to the nodes in this agent pool. - * + * * @param labels the labels value to set. * @return the AgentPoolInner object itself. */ @@ -302,7 +326,7 @@ public AgentPoolInner withLabels(List labels) { * Get the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @return the mode value. */ public AgentPoolMode mode() { @@ -313,7 +337,7 @@ public AgentPoolMode mode() { * Set the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @param mode the mode value to set. * @return the AgentPoolInner object itself. */ @@ -327,7 +351,7 @@ public AgentPoolInner withMode(AgentPoolMode mode) { /** * Get the provisioningState property: The provisioning state of the agent pool. - * + * * @return the provisioningState value. */ public AgentPoolProvisioningState provisioningState() { @@ -336,7 +360,7 @@ public AgentPoolProvisioningState provisioningState() { /** * Get the taints property: The taints applied to the nodes in this agent pool. - * + * * @return the taints value. */ public List taints() { @@ -345,7 +369,7 @@ public List taints() { /** * Set the taints property: The taints applied to the nodes in this agent pool. - * + * * @param taints the taints value to set. * @return the AgentPoolInner object itself. */ @@ -358,10 +382,8 @@ public AgentPoolInner withTaints(List taints) { } /** - * Get the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Get the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ public AgentPoolUpgradeSettings upgradeSettings() { @@ -369,10 +391,8 @@ public AgentPoolUpgradeSettings upgradeSettings() { } /** - * Set the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Set the upgradeSettings property: The configuration of the agent pool. + * * @param upgradeSettings the upgradeSettings value to set. * @return the AgentPoolInner object itself. */ @@ -386,7 +406,7 @@ public AgentPoolInner withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettin /** * Get the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @return the vmSkuName value. */ public String vmSkuName() { @@ -395,7 +415,7 @@ public String vmSkuName() { /** * Set the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @param vmSkuName the vmSkuName value to set. * @return the AgentPoolInner object itself. */ @@ -409,7 +429,7 @@ public AgentPoolInner withVmSkuName(String vmSkuName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -417,12 +437,67 @@ public void validate() { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model AgentPoolInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model AgentPoolInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AgentPoolInner.class); + + /** + * {@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.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolInner 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 AgentPoolInner. + */ + public static AgentPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolInner deserializedAgentPoolInner = new AgentPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAgentPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentPoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAgentPoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAgentPoolInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAgentPoolInner.innerProperties = AgentPoolProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedAgentPoolInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAgentPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolPatchProperties.java index 5a533e373cd4e..1c29e12dbf7f7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolPatchProperties.java @@ -5,33 +5,66 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.AgentPoolUpgradeSettings; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.NodePoolAdministratorConfigurationPatch; +import java.io.IOException; -/** AgentPoolPatchProperties represents the properties of an agent pool that can be modified. */ +/** + * AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + */ @Fluent -public final class AgentPoolPatchProperties { +public final class AgentPoolPatchProperties implements JsonSerializable { + /* + * The configuration of administrator credentials for the control plane nodes. + */ + private NodePoolAdministratorConfigurationPatch administratorConfiguration; + /* * The number of virtual machines that use this configuration. */ - @JsonProperty(value = "count") private Long count; /* - * AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * * The configuration of the agent pool. */ - @JsonProperty(value = "upgradeSettings") private AgentPoolUpgradeSettings upgradeSettings; - /** Creates an instance of AgentPoolPatchProperties class. */ + /** + * Creates an instance of AgentPoolPatchProperties class. + */ public AgentPoolPatchProperties() { } + /** + * Get the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @return the administratorConfiguration value. + */ + public NodePoolAdministratorConfigurationPatch administratorConfiguration() { + return this.administratorConfiguration; + } + + /** + * Set the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @param administratorConfiguration the administratorConfiguration value to set. + * @return the AgentPoolPatchProperties object itself. + */ + public AgentPoolPatchProperties + withAdministratorConfiguration(NodePoolAdministratorConfigurationPatch administratorConfiguration) { + this.administratorConfiguration = administratorConfiguration; + return this; + } + /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public Long count() { @@ -40,7 +73,7 @@ public Long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the AgentPoolPatchProperties object itself. */ @@ -50,10 +83,8 @@ public AgentPoolPatchProperties withCount(Long count) { } /** - * Get the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Get the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ public AgentPoolUpgradeSettings upgradeSettings() { @@ -61,10 +92,8 @@ public AgentPoolUpgradeSettings upgradeSettings() { } /** - * Set the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Set the upgradeSettings property: The configuration of the agent pool. + * * @param upgradeSettings the upgradeSettings value to set. * @return the AgentPoolPatchProperties object itself. */ @@ -75,12 +104,58 @@ public AgentPoolPatchProperties withUpgradeSettings(AgentPoolUpgradeSettings upg /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (administratorConfiguration() != null) { + administratorConfiguration().validate(); + } if (upgradeSettings() != null) { upgradeSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("upgradeSettings", this.upgradeSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolPatchProperties 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 AgentPoolPatchProperties. + */ + public static AgentPoolPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolPatchProperties deserializedAgentPoolPatchProperties = new AgentPoolPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorConfiguration".equals(fieldName)) { + deserializedAgentPoolPatchProperties.administratorConfiguration + = NodePoolAdministratorConfigurationPatch.fromJson(reader); + } else if ("count".equals(fieldName)) { + deserializedAgentPoolPatchProperties.count = reader.getNullable(JsonReader::getLong); + } else if ("upgradeSettings".equals(fieldName)) { + deserializedAgentPoolPatchProperties.upgradeSettings = AgentPoolUpgradeSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolProperties.java index 07ec221020067..036f2e2c71586 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/AgentPoolProperties.java @@ -6,6 +6,10 @@ 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.networkcloud.models.AdministratorConfiguration; import com.azure.resourcemanager.networkcloud.models.AgentOptions; import com.azure.resourcemanager.networkcloud.models.AgentPoolDetailedStatus; @@ -14,73 +18,59 @@ import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; import com.azure.resourcemanager.networkcloud.models.AttachedNetworkConfiguration; import com.azure.resourcemanager.networkcloud.models.KubernetesLabel; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. */ +/** + * AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + */ @Fluent -public final class AgentPoolProperties { +public final class AgentPoolProperties implements JsonSerializable { /* - * AdministratorConfiguration represents the administrative credentials that will be applied to the control plane - * and agent pool nodes in Kubernetes clusters. - * * The administrator credentials to be used for the nodes in this agent pool. */ - @JsonProperty(value = "administratorConfiguration") private AdministratorConfiguration administratorConfiguration; /* - * AgentOptions are configurations that will be applied to each agent in an agent pool. - * * The configurations that will be applied to each agent in this agent pool. */ - @JsonProperty(value = "agentOptions") private AgentOptions agentOptions; /* - * AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - * * The configuration of networks being attached to the agent pool for use by the workloads that run on this * Kubernetes cluster. */ - @JsonProperty(value = "attachedNetworkConfiguration") private AttachedNetworkConfiguration attachedNetworkConfiguration; /* * The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent * pool. If not specified, all availability zones will be used. */ - @JsonProperty(value = "availabilityZones") private List availabilityZones; /* * The number of virtual machines that use this configuration. */ - @JsonProperty(value = "count", required = true) private long count; /* * The current status of the agent pool. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private AgentPoolDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The Kubernetes version running in this agent pool. */ - @JsonProperty(value = "kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) private String kubernetesVersion; /* * The labels applied to the nodes in this agent pool. */ - @JsonProperty(value = "labels") private List labels; /* @@ -88,45 +78,38 @@ public final class AgentPoolProperties { * features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. * Every Kubernetes cluster must contain at least one system node pool with at least one node. */ - @JsonProperty(value = "mode", required = true) private AgentPoolMode mode; /* * The provisioning state of the agent pool. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private AgentPoolProvisioningState provisioningState; /* * The taints applied to the nodes in this agent pool. */ - @JsonProperty(value = "taints") private List taints; /* - * AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * * The configuration of the agent pool. */ - @JsonProperty(value = "upgradeSettings") private AgentPoolUpgradeSettings upgradeSettings; /* * The name of the VM SKU that determines the size of resources allocated for node VMs. */ - @JsonProperty(value = "vmSkuName", required = true) private String vmSkuName; - /** Creates an instance of AgentPoolProperties class. */ + /** + * Creates an instance of AgentPoolProperties class. + */ public AgentPoolProperties() { } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Get the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -134,11 +117,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Set the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the AgentPoolProperties object itself. */ @@ -148,11 +129,8 @@ public AgentPoolProperties withAdministratorConfiguration(AdministratorConfigura } /** - * Get the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Get the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @return the agentOptions value. */ public AgentOptions agentOptions() { @@ -160,11 +138,8 @@ public AgentOptions agentOptions() { } /** - * Set the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Set the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @param agentOptions the agentOptions value to set. * @return the AgentPoolProperties object itself. */ @@ -174,12 +149,9 @@ public AgentPoolProperties withAgentOptions(AgentOptions agentOptions) { } /** - * Get the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Get the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @return the attachedNetworkConfiguration value. */ public AttachedNetworkConfiguration attachedNetworkConfiguration() { @@ -187,12 +159,9 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { } /** - * Set the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Set the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @param attachedNetworkConfiguration the attachedNetworkConfiguration value to set. * @return the AgentPoolProperties object itself. */ @@ -205,7 +174,7 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { /** * Get the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -215,7 +184,7 @@ public List availabilityZones() { /** * Set the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @param availabilityZones the availabilityZones value to set. * @return the AgentPoolProperties object itself. */ @@ -226,7 +195,7 @@ public AgentPoolProperties withAvailabilityZones(List availabilityZones) /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public long count() { @@ -235,7 +204,7 @@ public long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the AgentPoolProperties object itself. */ @@ -246,7 +215,7 @@ public AgentPoolProperties withCount(long count) { /** * Get the detailedStatus property: The current status of the agent pool. - * + * * @return the detailedStatus value. */ public AgentPoolDetailedStatus detailedStatus() { @@ -255,7 +224,7 @@ public AgentPoolDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -264,7 +233,7 @@ public String detailedStatusMessage() { /** * Get the kubernetesVersion property: The Kubernetes version running in this agent pool. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -273,7 +242,7 @@ public String kubernetesVersion() { /** * Get the labels property: The labels applied to the nodes in this agent pool. - * + * * @return the labels value. */ public List labels() { @@ -282,7 +251,7 @@ public List labels() { /** * Set the labels property: The labels applied to the nodes in this agent pool. - * + * * @param labels the labels value to set. * @return the AgentPoolProperties object itself. */ @@ -295,7 +264,7 @@ public AgentPoolProperties withLabels(List labels) { * Get the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @return the mode value. */ public AgentPoolMode mode() { @@ -306,7 +275,7 @@ public AgentPoolMode mode() { * Set the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @param mode the mode value to set. * @return the AgentPoolProperties object itself. */ @@ -317,7 +286,7 @@ public AgentPoolProperties withMode(AgentPoolMode mode) { /** * Get the provisioningState property: The provisioning state of the agent pool. - * + * * @return the provisioningState value. */ public AgentPoolProvisioningState provisioningState() { @@ -326,7 +295,7 @@ public AgentPoolProvisioningState provisioningState() { /** * Get the taints property: The taints applied to the nodes in this agent pool. - * + * * @return the taints value. */ public List taints() { @@ -335,7 +304,7 @@ public List taints() { /** * Set the taints property: The taints applied to the nodes in this agent pool. - * + * * @param taints the taints value to set. * @return the AgentPoolProperties object itself. */ @@ -345,10 +314,8 @@ public AgentPoolProperties withTaints(List taints) { } /** - * Get the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Get the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ public AgentPoolUpgradeSettings upgradeSettings() { @@ -356,10 +323,8 @@ public AgentPoolUpgradeSettings upgradeSettings() { } /** - * Set the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Set the upgradeSettings property: The configuration of the agent pool. + * * @param upgradeSettings the upgradeSettings value to set. * @return the AgentPoolProperties object itself. */ @@ -370,7 +335,7 @@ public AgentPoolProperties withUpgradeSettings(AgentPoolUpgradeSettings upgradeS /** * Get the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @return the vmSkuName value. */ public String vmSkuName() { @@ -379,7 +344,7 @@ public String vmSkuName() { /** * Set the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @param vmSkuName the vmSkuName value to set. * @return the AgentPoolProperties object itself. */ @@ -390,7 +355,7 @@ public AgentPoolProperties withVmSkuName(String vmSkuName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -407,8 +372,8 @@ public void validate() { labels().forEach(e -> e.validate()); } if (mode() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property mode in model AgentPoolProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property mode in model AgentPoolProperties")); } if (taints() != null) { taints().forEach(e -> e.validate()); @@ -417,10 +382,90 @@ public void validate() { upgradeSettings().validate(); } if (vmSkuName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vmSkuName in model AgentPoolProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vmSkuName in model AgentPoolProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(AgentPoolProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("count", this.count); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("vmSkuName", this.vmSkuName); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeJsonField("agentOptions", this.agentOptions); + jsonWriter.writeJsonField("attachedNetworkConfiguration", this.attachedNetworkConfiguration); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("taints", this.taints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("upgradeSettings", this.upgradeSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolProperties 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 AgentPoolProperties. + */ + public static AgentPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolProperties deserializedAgentPoolProperties = new AgentPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedAgentPoolProperties.count = reader.getLong(); + } else if ("mode".equals(fieldName)) { + deserializedAgentPoolProperties.mode = AgentPoolMode.fromString(reader.getString()); + } else if ("vmSkuName".equals(fieldName)) { + deserializedAgentPoolProperties.vmSkuName = reader.getString(); + } else if ("administratorConfiguration".equals(fieldName)) { + deserializedAgentPoolProperties.administratorConfiguration + = AdministratorConfiguration.fromJson(reader); + } else if ("agentOptions".equals(fieldName)) { + deserializedAgentPoolProperties.agentOptions = AgentOptions.fromJson(reader); + } else if ("attachedNetworkConfiguration".equals(fieldName)) { + deserializedAgentPoolProperties.attachedNetworkConfiguration + = AttachedNetworkConfiguration.fromJson(reader); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedAgentPoolProperties.availabilityZones = availabilityZones; + } else if ("detailedStatus".equals(fieldName)) { + deserializedAgentPoolProperties.detailedStatus + = AgentPoolDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedAgentPoolProperties.detailedStatusMessage = reader.getString(); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedAgentPoolProperties.kubernetesVersion = reader.getString(); + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedAgentPoolProperties.labels = labels; + } else if ("provisioningState".equals(fieldName)) { + deserializedAgentPoolProperties.provisioningState + = AgentPoolProvisioningState.fromString(reader.getString()); + } else if ("taints".equals(fieldName)) { + List taints = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedAgentPoolProperties.taints = taints; + } else if ("upgradeSettings".equals(fieldName)) { + deserializedAgentPoolProperties.upgradeSettings = AgentPoolUpgradeSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java index 66a056455a6b6..1758f5e8c4f7a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; 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.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonStatus; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineDetailedStatus; @@ -17,45 +20,56 @@ import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.HardwareInventory; import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; +import java.io.IOException; import java.util.List; import java.util.Map; -/** BareMetalMachine represents the physical machine in the rack. */ +/** + * BareMetalMachine represents the physical machine in the rack. + */ @Fluent public final class BareMetalMachineInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * BareMetalMachineProperties represents the properties of a bare metal machine. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private BareMetalMachineProperties innerProperties = new BareMetalMachineProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of BareMetalMachineInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BareMetalMachineInner class. + */ public BareMetalMachineInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -63,11 +77,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the BareMetalMachineInner object itself. */ @@ -77,10 +88,8 @@ public BareMetalMachineInner withExtendedLocation(ExtendedLocation extendedLocat } /** - * Get the innerProperties property: BareMetalMachineProperties represents the properties of a bare metal machine. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BareMetalMachineProperties innerProperties() { @@ -89,21 +98,55 @@ private BareMetalMachineProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public BareMetalMachineInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BareMetalMachineInner withTags(Map tags) { super.withTags(tags); @@ -113,7 +156,7 @@ public BareMetalMachineInner withTags(Map tags) { /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -123,7 +166,7 @@ public List associatedResourceIds() { /** * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @return the bmcConnectionString value. */ public String bmcConnectionString() { @@ -133,7 +176,7 @@ public String bmcConnectionString() { /** * Set the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @param bmcConnectionString the bmcConnectionString value to set. * @return the BareMetalMachineInner object itself. */ @@ -146,11 +189,9 @@ public BareMetalMachineInner withBmcConnectionString(String bmcConnectionString) } /** - * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Get the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. + * * @return the bmcCredentials value. */ public AdministrativeCredentials bmcCredentials() { @@ -158,11 +199,9 @@ public AdministrativeCredentials bmcCredentials() { } /** - * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Set the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. + * * @param bmcCredentials the bmcCredentials value to set. * @return the BareMetalMachineInner object itself. */ @@ -176,7 +215,7 @@ public BareMetalMachineInner withBmcCredentials(AdministrativeCredentials bmcCre /** * Get the bmcMacAddress property: The MAC address of the BMC device. - * + * * @return the bmcMacAddress value. */ public String bmcMacAddress() { @@ -185,7 +224,7 @@ public String bmcMacAddress() { /** * Set the bmcMacAddress property: The MAC address of the BMC device. - * + * * @param bmcMacAddress the bmcMacAddress value to set. * @return the BareMetalMachineInner object itself. */ @@ -199,7 +238,7 @@ public BareMetalMachineInner withBmcMacAddress(String bmcMacAddress) { /** * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @return the bootMacAddress value. */ public String bootMacAddress() { @@ -208,7 +247,7 @@ public String bootMacAddress() { /** * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @param bootMacAddress the bootMacAddress value to set. * @return the BareMetalMachineInner object itself. */ @@ -222,7 +261,7 @@ public BareMetalMachineInner withBootMacAddress(String bootMacAddress) { /** * Get the clusterId property: The resource ID of the cluster this bare metal machine is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -231,7 +270,7 @@ public String clusterId() { /** * Get the cordonStatus property: The cordon status of the bare metal machine. - * + * * @return the cordonStatus value. */ public BareMetalMachineCordonStatus cordonStatus() { @@ -240,7 +279,7 @@ public BareMetalMachineCordonStatus cordonStatus() { /** * Get the detailedStatus property: The more detailed status of the bare metal machine. - * + * * @return the detailedStatus value. */ public BareMetalMachineDetailedStatus detailedStatus() { @@ -249,7 +288,7 @@ public BareMetalMachineDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -257,13 +296,9 @@ public String detailedStatusMessage() { } /** - * Get the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as - * exposed to the customer, including information acquired from the model/sku information and from the ironic - * inspector. - * - *

The hardware inventory, including information acquired from the model/sku information and from the ironic - * inspector. - * + * Get the hardwareInventory property: The hardware inventory, including information acquired from the model/sku + * information and from the ironic inspector. + * * @return the hardwareInventory value. */ public HardwareInventory hardwareInventory() { @@ -271,11 +306,9 @@ public HardwareInventory hardwareInventory() { } /** - * Get the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation - * details performed for this bare metal machine. - * - *

The details of the latest hardware validation performed for this bare metal machine. - * + * Get the hardwareValidationStatus property: The details of the latest hardware validation performed for this bare + * metal machine. + * * @return the hardwareValidationStatus value. */ public HardwareValidationStatus hardwareValidationStatus() { @@ -285,7 +318,7 @@ public HardwareValidationStatus hardwareValidationStatus() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -295,7 +328,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's * Kubernetes control plane. - * + * * @return the kubernetesNodeName value. */ public String kubernetesNodeName() { @@ -304,16 +337,41 @@ public String kubernetesNodeName() { /** * Get the kubernetesVersion property: The version of Kubernetes running on this machine. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); } + /** + * Get the machineClusterVersion property: The cluster version that has been applied to this machine during + * deployment or a version update. + * + * @return the machineClusterVersion value. + */ + public String machineClusterVersion() { + return this.innerProperties() == null ? null : this.innerProperties().machineClusterVersion(); + } + + /** + * Set the machineClusterVersion property: The cluster version that has been applied to this machine during + * deployment or a version update. + * + * @param machineClusterVersion the machineClusterVersion value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withMachineClusterVersion(String machineClusterVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withMachineClusterVersion(machineClusterVersion); + return this; + } + /** * Get the machineDetails property: The custom details provided by the customer. - * + * * @return the machineDetails value. */ public String machineDetails() { @@ -322,7 +380,7 @@ public String machineDetails() { /** * Set the machineDetails property: The custom details provided by the customer. - * + * * @param machineDetails the machineDetails value to set. * @return the BareMetalMachineInner object itself. */ @@ -336,7 +394,7 @@ public BareMetalMachineInner withMachineDetails(String machineDetails) { /** * Get the machineName property: The OS-level hostname assigned to this machine. - * + * * @return the machineName value. */ public String machineName() { @@ -345,7 +403,7 @@ public String machineName() { /** * Set the machineName property: The OS-level hostname assigned to this machine. - * + * * @param machineName the machineName value to set. * @return the BareMetalMachineInner object itself. */ @@ -357,9 +415,18 @@ public BareMetalMachineInner withMachineName(String machineName) { return this; } + /** + * Get the machineRoles property: The list of roles that are assigned to the cluster node running on this machine. + * + * @return the machineRoles value. + */ + public List machineRoles() { + return this.innerProperties() == null ? null : this.innerProperties().machineRoles(); + } + /** * Get the machineSkuId property: The unique internal identifier of the bare metal machine SKU. - * + * * @return the machineSkuId value. */ public String machineSkuId() { @@ -368,7 +435,7 @@ public String machineSkuId() { /** * Set the machineSkuId property: The unique internal identifier of the bare metal machine SKU. - * + * * @param machineSkuId the machineSkuId value to set. * @return the BareMetalMachineInner object itself. */ @@ -383,7 +450,7 @@ public BareMetalMachineInner withMachineSkuId(String machineSkuId) { /** * Get the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv4Address value. */ public String oamIpv4Address() { @@ -393,7 +460,7 @@ public String oamIpv4Address() { /** * Get the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv6Address value. */ public String oamIpv6Address() { @@ -402,7 +469,7 @@ public String oamIpv6Address() { /** * Get the osImage property: The image that is currently provisioned to the OS disk. - * + * * @return the osImage value. */ public String osImage() { @@ -411,7 +478,7 @@ public String osImage() { /** * Get the powerState property: The power state derived from the baseboard management controller. - * + * * @return the powerState value. */ public BareMetalMachinePowerState powerState() { @@ -420,7 +487,7 @@ public BareMetalMachinePowerState powerState() { /** * Get the provisioningState property: The provisioning state of the bare metal machine. - * + * * @return the provisioningState value. */ public BareMetalMachineProvisioningState provisioningState() { @@ -429,7 +496,7 @@ public BareMetalMachineProvisioningState provisioningState() { /** * Get the rackId property: The resource ID of the rack where this bare metal machine resides. - * + * * @return the rackId value. */ public String rackId() { @@ -438,7 +505,7 @@ public String rackId() { /** * Set the rackId property: The resource ID of the rack where this bare metal machine resides. - * + * * @param rackId the rackId value to set. * @return the BareMetalMachineInner object itself. */ @@ -453,7 +520,7 @@ public BareMetalMachineInner withRackId(String rackId) { /** * Get the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up * i.e. the lowest slot is 1. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -463,7 +530,7 @@ public long rackSlot() { /** * Set the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up * i.e. the lowest slot is 1. - * + * * @param rackSlot the rackSlot value to set. * @return the BareMetalMachineInner object itself. */ @@ -477,16 +544,34 @@ public BareMetalMachineInner withRackSlot(long rackSlot) { /** * Get the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. - * + * * @return the readyState value. */ public BareMetalMachineReadyState readyState() { return this.innerProperties() == null ? null : this.innerProperties().readyState(); } + /** + * Get the runtimeProtectionStatus property: The runtime protection status of the bare metal machine. + * + * @return the runtimeProtectionStatus value. + */ + public RuntimeProtectionStatus runtimeProtectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().runtimeProtectionStatus(); + } + + /** + * Get the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + public List secretRotationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().secretRotationStatus(); + } + /** * Get the serialNumber property: The serial number of the bare metal machine. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -495,7 +580,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number of the bare metal machine. - * + * * @param serialNumber the serialNumber value to set. * @return the BareMetalMachineInner object itself. */ @@ -509,7 +594,7 @@ public BareMetalMachineInner withSerialNumber(String serialNumber) { /** * Get the serviceTag property: The discovered value of the machine's service tag. - * + * * @return the serviceTag value. */ public String serviceTag() { @@ -519,7 +604,7 @@ public String serviceTag() { /** * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * the resource IDs for the VirtualMachines that are hosted on this bare metal machine. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -528,23 +613,80 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model BareMetalMachineInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model BareMetalMachineInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model BareMetalMachineInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model BareMetalMachineInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineInner 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 BareMetalMachineInner. + */ + public static BareMetalMachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineInner deserializedBareMetalMachineInner = new BareMetalMachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBareMetalMachineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBareMetalMachineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBareMetalMachineInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBareMetalMachineInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBareMetalMachineInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedBareMetalMachineInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedBareMetalMachineInner.innerProperties = BareMetalMachineProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBareMetalMachineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java index cab40c7ac75e8..0c12480277a78 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java @@ -8,52 +8,64 @@ import com.azure.core.management.Resource; 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.networkcloud.models.BareMetalMachineKeySetDetailedStatus; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.KeySetUser; import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** BareMetalMachineKeySet represents the bare metal machine key set. */ +/** + * BareMetalMachineKeySet represents the bare metal machine key set. + */ @Fluent public final class BareMetalMachineKeySetInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private BareMetalMachineKeySetProperties innerProperties = new BareMetalMachineKeySetProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of BareMetalMachineKeySetInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BareMetalMachineKeySetInner class. + */ public BareMetalMachineKeySetInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,11 +73,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -75,11 +84,8 @@ public BareMetalMachineKeySetInner withExtendedLocation(ExtendedLocation extende } /** - * Get the innerProperties property: BareMetalMachineKeySetProperties represents the properties of bare metal - * machine key set. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BareMetalMachineKeySetProperties innerProperties() { @@ -88,21 +94,55 @@ private BareMetalMachineKeySetProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public BareMetalMachineKeySetInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BareMetalMachineKeySetInner withTags(Map tags) { super.withTags(tags); @@ -112,7 +152,7 @@ public BareMetalMachineKeySetInner withTags(Map tags) { /** * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ public String azureGroupId() { @@ -122,7 +162,7 @@ public String azureGroupId() { /** * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @param azureGroupId the azureGroupId value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -136,7 +176,7 @@ public BareMetalMachineKeySetInner withAzureGroupId(String azureGroupId) { /** * Get the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ public BareMetalMachineKeySetDetailedStatus detailedStatus() { @@ -145,7 +185,7 @@ public BareMetalMachineKeySetDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -155,7 +195,7 @@ public String detailedStatusMessage() { /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -165,7 +205,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @param expiration the expiration value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -180,7 +220,7 @@ public BareMetalMachineKeySetInner withExpiration(OffsetDateTime expiration) { /** * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @return the jumpHostsAllowed value. */ public List jumpHostsAllowed() { @@ -190,7 +230,7 @@ public List jumpHostsAllowed() { /** * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @param jumpHostsAllowed the jumpHostsAllowed value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -204,7 +244,7 @@ public BareMetalMachineKeySetInner withJumpHostsAllowed(List jumpHostsAl /** * Get the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ public OffsetDateTime lastValidation() { @@ -214,7 +254,7 @@ public OffsetDateTime lastValidation() { /** * Get the osGroupName property: The name of the group that users will be assigned to on the operating system of the * machines. - * + * * @return the osGroupName value. */ public String osGroupName() { @@ -224,7 +264,7 @@ public String osGroupName() { /** * Set the osGroupName property: The name of the group that users will be assigned to on the operating system of the * machines. - * + * * @param osGroupName the osGroupName value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -238,7 +278,7 @@ public BareMetalMachineKeySetInner withOsGroupName(String osGroupName) { /** * Get the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { @@ -247,7 +287,7 @@ public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { /** * Set the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @param privilegeLevel the privilegeLevel value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -261,7 +301,7 @@ public BareMetalMachineKeySetInner withPrivilegeLevel(BareMetalMachineKeySetPriv /** * Get the provisioningState property: The provisioning state of the bare metal machine key set. - * + * * @return the provisioningState value. */ public BareMetalMachineKeySetProvisioningState provisioningState() { @@ -270,7 +310,7 @@ public BareMetalMachineKeySetProvisioningState provisioningState() { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -279,7 +319,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BareMetalMachineKeySetInner object itself. */ @@ -293,7 +333,7 @@ public BareMetalMachineKeySetInner withUserList(List userList) { /** * Get the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ public List userListStatus() { @@ -302,23 +342,81 @@ public List userListStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model BareMetalMachineKeySetInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model BareMetalMachineKeySetInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model BareMetalMachineKeySetInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model BareMetalMachineKeySetInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineKeySetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineKeySetInner 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 BareMetalMachineKeySetInner. + */ + public static BareMetalMachineKeySetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineKeySetInner deserializedBareMetalMachineKeySetInner = new BareMetalMachineKeySetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBareMetalMachineKeySetInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.innerProperties + = BareMetalMachineKeySetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBareMetalMachineKeySetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineKeySetInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java index 5ea33013088d6..5b397c6c40cd6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java @@ -5,43 +5,49 @@ package com.azure.resourcemanager.networkcloud.fluent.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 com.azure.resourcemanager.networkcloud.models.KeySetUser; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. */ @Fluent -public final class BareMetalMachineKeySetPatchProperties { +public final class BareMetalMachineKeySetPatchProperties + implements JsonSerializable { /* * The date and time after which the users in this key set will be removed from the bare metal machines. */ - @JsonProperty(value = "expiration") private OffsetDateTime expiration; /* * The list of IP addresses of jump hosts with management network access from which a login will be allowed for the * users. */ - @JsonProperty(value = "jumpHostsAllowed") private List jumpHostsAllowed; /* * The unique list of permitted users. */ - @JsonProperty(value = "userList") private List userList; - /** Creates an instance of BareMetalMachineKeySetPatchProperties class. */ + /** + * Creates an instance of BareMetalMachineKeySetPatchProperties class. + */ public BareMetalMachineKeySetPatchProperties() { } /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -51,7 +57,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @param expiration the expiration value to set. * @return the BareMetalMachineKeySetPatchProperties object itself. */ @@ -63,7 +69,7 @@ public BareMetalMachineKeySetPatchProperties withExpiration(OffsetDateTime expir /** * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @return the jumpHostsAllowed value. */ public List jumpHostsAllowed() { @@ -73,7 +79,7 @@ public List jumpHostsAllowed() { /** * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @param jumpHostsAllowed the jumpHostsAllowed value to set. * @return the BareMetalMachineKeySetPatchProperties object itself. */ @@ -84,7 +90,7 @@ public BareMetalMachineKeySetPatchProperties withJumpHostsAllowed(List j /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -93,7 +99,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BareMetalMachineKeySetPatchProperties object itself. */ @@ -104,7 +110,7 @@ public BareMetalMachineKeySetPatchProperties withUserList(List userL /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -112,4 +118,52 @@ public void validate() { userList().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + jsonWriter.writeArrayField("jumpHostsAllowed", this.jumpHostsAllowed, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("userList", this.userList, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineKeySetPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineKeySetPatchProperties 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 BareMetalMachineKeySetPatchProperties. + */ + public static BareMetalMachineKeySetPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineKeySetPatchProperties deserializedBareMetalMachineKeySetPatchProperties + = new BareMetalMachineKeySetPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expiration".equals(fieldName)) { + deserializedBareMetalMachineKeySetPatchProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("jumpHostsAllowed".equals(fieldName)) { + List jumpHostsAllowed = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineKeySetPatchProperties.jumpHostsAllowed = jumpHostsAllowed; + } else if ("userList".equals(fieldName)) { + List userList = reader.readArray(reader1 -> KeySetUser.fromJson(reader1)); + deserializedBareMetalMachineKeySetPatchProperties.userList = userList; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineKeySetPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java index dd6e97c22f3fe..31eea1c2037de 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java @@ -5,95 +5,94 @@ package com.azure.resourcemanager.networkcloud.fluent.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.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetDetailedStatus; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetProvisioningState; import com.azure.resourcemanager.networkcloud.models.KeySetUser; import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. */ +/** + * BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + */ @Fluent -public final class BareMetalMachineKeySetProperties { +public final class BareMetalMachineKeySetProperties implements JsonSerializable { /* * The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. * Users that are not in the group will not have access. */ - @JsonProperty(value = "azureGroupId", required = true) private String azureGroupId; /* * The more detailed status of the key set. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineKeySetDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The date and time after which the users in this key set will be removed from the bare metal machines. */ - @JsonProperty(value = "expiration", required = true) private OffsetDateTime expiration; /* * The list of IP addresses of jump hosts with management network access from which a login will be allowed for the * users. */ - @JsonProperty(value = "jumpHostsAllowed", required = true) private List jumpHostsAllowed; /* * The last time this key set was validated. */ - @JsonProperty(value = "lastValidation", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastValidation; /* * The name of the group that users will be assigned to on the operating system of the machines. */ - @JsonProperty(value = "osGroupName") private String osGroupName; /* * The access level allowed for the users in this key set. */ - @JsonProperty(value = "privilegeLevel", required = true) private BareMetalMachineKeySetPrivilegeLevel privilegeLevel; /* * The provisioning state of the bare metal machine key set. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineKeySetProvisioningState provisioningState; /* * The unique list of permitted users. */ - @JsonProperty(value = "userList", required = true) private List userList; /* * The status evaluation of each user. */ - @JsonProperty(value = "userListStatus", access = JsonProperty.Access.WRITE_ONLY) private List userListStatus; - /** Creates an instance of BareMetalMachineKeySetProperties class. */ + /** + * Creates an instance of BareMetalMachineKeySetProperties class. + */ public BareMetalMachineKeySetProperties() { } /** * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ public String azureGroupId() { @@ -103,7 +102,7 @@ public String azureGroupId() { /** * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @param azureGroupId the azureGroupId value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -114,7 +113,7 @@ public BareMetalMachineKeySetProperties withAzureGroupId(String azureGroupId) { /** * Get the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ public BareMetalMachineKeySetDetailedStatus detailedStatus() { @@ -123,7 +122,7 @@ public BareMetalMachineKeySetDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -133,7 +132,7 @@ public String detailedStatusMessage() { /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -143,7 +142,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @param expiration the expiration value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -155,7 +154,7 @@ public BareMetalMachineKeySetProperties withExpiration(OffsetDateTime expiration /** * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @return the jumpHostsAllowed value. */ public List jumpHostsAllowed() { @@ -165,7 +164,7 @@ public List jumpHostsAllowed() { /** * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @param jumpHostsAllowed the jumpHostsAllowed value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -176,7 +175,7 @@ public BareMetalMachineKeySetProperties withJumpHostsAllowed(List jumpHo /** * Get the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ public OffsetDateTime lastValidation() { @@ -186,7 +185,7 @@ public OffsetDateTime lastValidation() { /** * Get the osGroupName property: The name of the group that users will be assigned to on the operating system of the * machines. - * + * * @return the osGroupName value. */ public String osGroupName() { @@ -196,7 +195,7 @@ public String osGroupName() { /** * Set the osGroupName property: The name of the group that users will be assigned to on the operating system of the * machines. - * + * * @param osGroupName the osGroupName value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -207,7 +206,7 @@ public BareMetalMachineKeySetProperties withOsGroupName(String osGroupName) { /** * Get the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { @@ -216,7 +215,7 @@ public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { /** * Set the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @param privilegeLevel the privilegeLevel value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -227,7 +226,7 @@ public BareMetalMachineKeySetProperties withPrivilegeLevel(BareMetalMachineKeySe /** * Get the provisioningState property: The provisioning state of the bare metal machine key set. - * + * * @return the provisioningState value. */ public BareMetalMachineKeySetProvisioningState provisioningState() { @@ -236,7 +235,7 @@ public BareMetalMachineKeySetProvisioningState provisioningState() { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -245,7 +244,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BareMetalMachineKeySetProperties object itself. */ @@ -256,7 +255,7 @@ public BareMetalMachineKeySetProperties withUserList(List userList) /** * Get the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ public List userListStatus() { @@ -265,29 +264,34 @@ public List userListStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (azureGroupId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property azureGroupId in model BareMetalMachineKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureGroupId in model BareMetalMachineKeySetProperties")); } if (expiration() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property expiration in model BareMetalMachineKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property expiration in model BareMetalMachineKeySetProperties")); } if (jumpHostsAllowed() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property jumpHostsAllowed in model BareMetalMachineKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property jumpHostsAllowed in model BareMetalMachineKeySetProperties")); } if (privilegeLevel() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property privilegeLevel in model BareMetalMachineKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privilegeLevel in model BareMetalMachineKeySetProperties")); } if (userList() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property userList in model BareMetalMachineKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property userList in model BareMetalMachineKeySetProperties")); } else { userList().forEach(e -> e.validate()); } @@ -297,4 +301,79 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureGroupId", this.azureGroupId); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + jsonWriter.writeArrayField("jumpHostsAllowed", this.jumpHostsAllowed, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("privilegeLevel", + this.privilegeLevel == null ? null : this.privilegeLevel.toString()); + jsonWriter.writeArrayField("userList", this.userList, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("osGroupName", this.osGroupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineKeySetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineKeySetProperties 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 BareMetalMachineKeySetProperties. + */ + public static BareMetalMachineKeySetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineKeySetProperties deserializedBareMetalMachineKeySetProperties + = new BareMetalMachineKeySetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureGroupId".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.azureGroupId = reader.getString(); + } else if ("expiration".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("jumpHostsAllowed".equals(fieldName)) { + List jumpHostsAllowed = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineKeySetProperties.jumpHostsAllowed = jumpHostsAllowed; + } else if ("privilegeLevel".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.privilegeLevel + = BareMetalMachineKeySetPrivilegeLevel.fromString(reader.getString()); + } else if ("userList".equals(fieldName)) { + List userList = reader.readArray(reader1 -> KeySetUser.fromJson(reader1)); + deserializedBareMetalMachineKeySetProperties.userList = userList; + } else if ("detailedStatus".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.detailedStatus + = BareMetalMachineKeySetDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.detailedStatusMessage = reader.getString(); + } else if ("lastValidation".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.lastValidation = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("osGroupName".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.osGroupName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedBareMetalMachineKeySetProperties.provisioningState + = BareMetalMachineKeySetProvisioningState.fromString(reader.getString()); + } else if ("userListStatus".equals(fieldName)) { + List userListStatus + = reader.readArray(reader1 -> KeySetUserStatus.fromJson(reader1)); + deserializedBareMetalMachineKeySetProperties.userListStatus = userListStatus; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineKeySetProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java index 1ebe3c31ee63a..a6ec9b8920d9c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.networkcloud.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; -/** BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. */ +/** + * BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. + */ @Fluent -public final class BareMetalMachinePatchProperties { +public final class BareMetalMachinePatchProperties implements JsonSerializable { /* * The details provided by the customer during the creation of rack manifests * that allows for custom data to be associated with this machine. */ - @JsonProperty(value = "machineDetails") private String machineDetails; - /** Creates an instance of BareMetalMachinePatchProperties class. */ + /** + * Creates an instance of BareMetalMachinePatchProperties class. + */ public BareMetalMachinePatchProperties() { } /** - * Get the machineDetails property: The details provided by the customer during the creation of rack manifests that - * allows for custom data to be associated with this machine. - * + * Get the machineDetails property: The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + * * @return the machineDetails value. */ public String machineDetails() { @@ -32,9 +39,9 @@ public String machineDetails() { } /** - * Set the machineDetails property: The details provided by the customer during the creation of rack manifests that - * allows for custom data to be associated with this machine. - * + * Set the machineDetails property: The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + * * @param machineDetails the machineDetails value to set. * @return the BareMetalMachinePatchProperties object itself. */ @@ -45,9 +52,46 @@ public BareMetalMachinePatchProperties withMachineDetails(String machineDetails) /** * 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("machineDetails", this.machineDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachinePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachinePatchProperties 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 BareMetalMachinePatchProperties. + */ + public static BareMetalMachinePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachinePatchProperties deserializedBareMetalMachinePatchProperties + = new BareMetalMachinePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("machineDetails".equals(fieldName)) { + deserializedBareMetalMachinePatchProperties.machineDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachinePatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java index a92b736762136..38ec2116d8af2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java @@ -6,6 +6,10 @@ 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.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonStatus; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineDetailedStatus; @@ -14,200 +18,189 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReadyState; import com.azure.resourcemanager.networkcloud.models.HardwareInventory; import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; +import java.io.IOException; import java.util.List; -/** BareMetalMachineProperties represents the properties of a bare metal machine. */ +/** + * BareMetalMachineProperties represents the properties of a bare metal machine. + */ @Fluent -public final class BareMetalMachineProperties { +public final class BareMetalMachineProperties implements JsonSerializable { /* * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. */ - @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List associatedResourceIds; /* * The connection string for the baseboard management controller including IP address and protocol. */ - @JsonProperty(value = "bmcConnectionString", required = true) private String bmcConnectionString; /* - * AdministrativeCredentials represents the admin credentials for the device requiring password-based - * authentication. - * * The credentials of the baseboard management controller on this bare metal machine. */ - @JsonProperty(value = "bmcCredentials", required = true) private AdministrativeCredentials bmcCredentials; /* * The MAC address of the BMC device. */ - @JsonProperty(value = "bmcMacAddress", required = true) private String bmcMacAddress; /* * The MAC address of a NIC connected to the PXE network. */ - @JsonProperty(value = "bootMacAddress", required = true) private String bootMacAddress; /* * The resource ID of the cluster this bare metal machine is associated with. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The cordon status of the bare metal machine. */ - @JsonProperty(value = "cordonStatus", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineCordonStatus cordonStatus; /* * The more detailed status of the bare metal machine. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* - * HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including - * information acquired from the model/sku information and from the ironic inspector. - * * The hardware inventory, including information acquired from the model/sku information and from the ironic * inspector. */ - @JsonProperty(value = "hardwareInventory", access = JsonProperty.Access.WRITE_ONLY) private HardwareInventory hardwareInventory; /* - * HardwareValidationStatus represents the latest hardware validation details performed for this bare metal - * machine. - * * The details of the latest hardware validation performed for this bare metal machine. */ - @JsonProperty(value = "hardwareValidationStatus", access = JsonProperty.Access.WRITE_ONLY) private HardwareValidationStatus hardwareValidationStatus; /* - * Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters - * that have nodes hosted on this bare metal machine. + * Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that + * have nodes hosted on this bare metal machine. */ - @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List hybridAksClustersAssociatedIds; /* * The name of this machine represented by the host object in the Cluster's Kubernetes control plane. */ - @JsonProperty(value = "kubernetesNodeName", access = JsonProperty.Access.WRITE_ONLY) private String kubernetesNodeName; /* * The version of Kubernetes running on this machine. */ - @JsonProperty(value = "kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) private String kubernetesVersion; + /* + * The cluster version that has been applied to this machine during deployment or a version update. + */ + private String machineClusterVersion; + /* * The custom details provided by the customer. */ - @JsonProperty(value = "machineDetails", required = true) private String machineDetails; /* * The OS-level hostname assigned to this machine. */ - @JsonProperty(value = "machineName", required = true) private String machineName; + /* + * The list of roles that are assigned to the cluster node running on this machine. + */ + private List machineRoles; + /* * The unique internal identifier of the bare metal machine SKU. */ - @JsonProperty(value = "machineSkuId", required = true) private String machineSkuId; /* * The IPv4 address that is assigned to the bare metal machine during the cluster deployment. */ - @JsonProperty(value = "oamIpv4Address", access = JsonProperty.Access.WRITE_ONLY) private String oamIpv4Address; /* * The IPv6 address that is assigned to the bare metal machine during the cluster deployment. */ - @JsonProperty(value = "oamIpv6Address", access = JsonProperty.Access.WRITE_ONLY) private String oamIpv6Address; /* * The image that is currently provisioned to the OS disk. */ - @JsonProperty(value = "osImage", access = JsonProperty.Access.WRITE_ONLY) private String osImage; /* * The power state derived from the baseboard management controller. */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachinePowerState powerState; /* * The provisioning state of the bare metal machine. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineProvisioningState provisioningState; /* * The resource ID of the rack where this bare metal machine resides. */ - @JsonProperty(value = "rackId", required = true) private String rackId; /* * The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. */ - @JsonProperty(value = "rackSlot", required = true) private long rackSlot; /* * The indicator of whether the bare metal machine is ready to receive workloads. */ - @JsonProperty(value = "readyState", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineReadyState readyState; + /* + * The runtime protection status of the bare metal machine. + */ + private RuntimeProtectionStatus runtimeProtectionStatus; + + /* + * The list of statuses that represent secret rotation activity. + */ + private List secretRotationStatus; + /* * The serial number of the bare metal machine. */ - @JsonProperty(value = "serialNumber", required = true) private String serialNumber; /* * The discovered value of the machine's service tag. */ - @JsonProperty(value = "serviceTag", access = JsonProperty.Access.WRITE_ONLY) private String serviceTag; /* * Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that * are hosted on this bare metal machine. */ - @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List virtualMachinesAssociatedIds; - /** Creates an instance of BareMetalMachineProperties class. */ + /** + * Creates an instance of BareMetalMachineProperties class. + */ public BareMetalMachineProperties() { } /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -217,7 +210,7 @@ public List associatedResourceIds() { /** * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @return the bmcConnectionString value. */ public String bmcConnectionString() { @@ -227,7 +220,7 @@ public String bmcConnectionString() { /** * Set the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @param bmcConnectionString the bmcConnectionString value to set. * @return the BareMetalMachineProperties object itself. */ @@ -237,11 +230,9 @@ public BareMetalMachineProperties withBmcConnectionString(String bmcConnectionSt } /** - * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Get the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. + * * @return the bmcCredentials value. */ public AdministrativeCredentials bmcCredentials() { @@ -249,11 +240,9 @@ public AdministrativeCredentials bmcCredentials() { } /** - * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Set the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. + * * @param bmcCredentials the bmcCredentials value to set. * @return the BareMetalMachineProperties object itself. */ @@ -264,7 +253,7 @@ public BareMetalMachineProperties withBmcCredentials(AdministrativeCredentials b /** * Get the bmcMacAddress property: The MAC address of the BMC device. - * + * * @return the bmcMacAddress value. */ public String bmcMacAddress() { @@ -273,7 +262,7 @@ public String bmcMacAddress() { /** * Set the bmcMacAddress property: The MAC address of the BMC device. - * + * * @param bmcMacAddress the bmcMacAddress value to set. * @return the BareMetalMachineProperties object itself. */ @@ -284,7 +273,7 @@ public BareMetalMachineProperties withBmcMacAddress(String bmcMacAddress) { /** * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @return the bootMacAddress value. */ public String bootMacAddress() { @@ -293,7 +282,7 @@ public String bootMacAddress() { /** * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @param bootMacAddress the bootMacAddress value to set. * @return the BareMetalMachineProperties object itself. */ @@ -304,7 +293,7 @@ public BareMetalMachineProperties withBootMacAddress(String bootMacAddress) { /** * Get the clusterId property: The resource ID of the cluster this bare metal machine is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -313,7 +302,7 @@ public String clusterId() { /** * Get the cordonStatus property: The cordon status of the bare metal machine. - * + * * @return the cordonStatus value. */ public BareMetalMachineCordonStatus cordonStatus() { @@ -322,7 +311,7 @@ public BareMetalMachineCordonStatus cordonStatus() { /** * Get the detailedStatus property: The more detailed status of the bare metal machine. - * + * * @return the detailedStatus value. */ public BareMetalMachineDetailedStatus detailedStatus() { @@ -331,7 +320,7 @@ public BareMetalMachineDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -339,13 +328,9 @@ public String detailedStatusMessage() { } /** - * Get the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as - * exposed to the customer, including information acquired from the model/sku information and from the ironic - * inspector. - * - *

The hardware inventory, including information acquired from the model/sku information and from the ironic - * inspector. - * + * Get the hardwareInventory property: The hardware inventory, including information acquired from the model/sku + * information and from the ironic inspector. + * * @return the hardwareInventory value. */ public HardwareInventory hardwareInventory() { @@ -353,11 +338,9 @@ public HardwareInventory hardwareInventory() { } /** - * Get the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation - * details performed for this bare metal machine. - * - *

The details of the latest hardware validation performed for this bare metal machine. - * + * Get the hardwareValidationStatus property: The details of the latest hardware validation performed for this bare + * metal machine. + * * @return the hardwareValidationStatus value. */ public HardwareValidationStatus hardwareValidationStatus() { @@ -367,7 +350,7 @@ public HardwareValidationStatus hardwareValidationStatus() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -377,7 +360,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's * Kubernetes control plane. - * + * * @return the kubernetesNodeName value. */ public String kubernetesNodeName() { @@ -386,16 +369,38 @@ public String kubernetesNodeName() { /** * Get the kubernetesVersion property: The version of Kubernetes running on this machine. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { return this.kubernetesVersion; } + /** + * Get the machineClusterVersion property: The cluster version that has been applied to this machine during + * deployment or a version update. + * + * @return the machineClusterVersion value. + */ + public String machineClusterVersion() { + return this.machineClusterVersion; + } + + /** + * Set the machineClusterVersion property: The cluster version that has been applied to this machine during + * deployment or a version update. + * + * @param machineClusterVersion the machineClusterVersion value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withMachineClusterVersion(String machineClusterVersion) { + this.machineClusterVersion = machineClusterVersion; + return this; + } + /** * Get the machineDetails property: The custom details provided by the customer. - * + * * @return the machineDetails value. */ public String machineDetails() { @@ -404,7 +409,7 @@ public String machineDetails() { /** * Set the machineDetails property: The custom details provided by the customer. - * + * * @param machineDetails the machineDetails value to set. * @return the BareMetalMachineProperties object itself. */ @@ -415,7 +420,7 @@ public BareMetalMachineProperties withMachineDetails(String machineDetails) { /** * Get the machineName property: The OS-level hostname assigned to this machine. - * + * * @return the machineName value. */ public String machineName() { @@ -424,7 +429,7 @@ public String machineName() { /** * Set the machineName property: The OS-level hostname assigned to this machine. - * + * * @param machineName the machineName value to set. * @return the BareMetalMachineProperties object itself. */ @@ -433,9 +438,18 @@ public BareMetalMachineProperties withMachineName(String machineName) { return this; } + /** + * Get the machineRoles property: The list of roles that are assigned to the cluster node running on this machine. + * + * @return the machineRoles value. + */ + public List machineRoles() { + return this.machineRoles; + } + /** * Get the machineSkuId property: The unique internal identifier of the bare metal machine SKU. - * + * * @return the machineSkuId value. */ public String machineSkuId() { @@ -444,7 +458,7 @@ public String machineSkuId() { /** * Set the machineSkuId property: The unique internal identifier of the bare metal machine SKU. - * + * * @param machineSkuId the machineSkuId value to set. * @return the BareMetalMachineProperties object itself. */ @@ -456,7 +470,7 @@ public BareMetalMachineProperties withMachineSkuId(String machineSkuId) { /** * Get the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv4Address value. */ public String oamIpv4Address() { @@ -466,7 +480,7 @@ public String oamIpv4Address() { /** * Get the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv6Address value. */ public String oamIpv6Address() { @@ -475,7 +489,7 @@ public String oamIpv6Address() { /** * Get the osImage property: The image that is currently provisioned to the OS disk. - * + * * @return the osImage value. */ public String osImage() { @@ -484,7 +498,7 @@ public String osImage() { /** * Get the powerState property: The power state derived from the baseboard management controller. - * + * * @return the powerState value. */ public BareMetalMachinePowerState powerState() { @@ -493,7 +507,7 @@ public BareMetalMachinePowerState powerState() { /** * Get the provisioningState property: The provisioning state of the bare metal machine. - * + * * @return the provisioningState value. */ public BareMetalMachineProvisioningState provisioningState() { @@ -502,7 +516,7 @@ public BareMetalMachineProvisioningState provisioningState() { /** * Get the rackId property: The resource ID of the rack where this bare metal machine resides. - * + * * @return the rackId value. */ public String rackId() { @@ -511,7 +525,7 @@ public String rackId() { /** * Set the rackId property: The resource ID of the rack where this bare metal machine resides. - * + * * @param rackId the rackId value to set. * @return the BareMetalMachineProperties object itself. */ @@ -523,7 +537,7 @@ public BareMetalMachineProperties withRackId(String rackId) { /** * Get the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up * i.e. the lowest slot is 1. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -533,7 +547,7 @@ public long rackSlot() { /** * Set the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up * i.e. the lowest slot is 1. - * + * * @param rackSlot the rackSlot value to set. * @return the BareMetalMachineProperties object itself. */ @@ -544,16 +558,34 @@ public BareMetalMachineProperties withRackSlot(long rackSlot) { /** * Get the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. - * + * * @return the readyState value. */ public BareMetalMachineReadyState readyState() { return this.readyState; } + /** + * Get the runtimeProtectionStatus property: The runtime protection status of the bare metal machine. + * + * @return the runtimeProtectionStatus value. + */ + public RuntimeProtectionStatus runtimeProtectionStatus() { + return this.runtimeProtectionStatus; + } + + /** + * Get the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + public List secretRotationStatus() { + return this.secretRotationStatus; + } + /** * Get the serialNumber property: The serial number of the bare metal machine. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -562,7 +594,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number of the bare metal machine. - * + * * @param serialNumber the serialNumber value to set. * @return the BareMetalMachineProperties object itself. */ @@ -573,7 +605,7 @@ public BareMetalMachineProperties withSerialNumber(String serialNumber) { /** * Get the serviceTag property: The discovered value of the machine's service tag. - * + * * @return the serviceTag value. */ public String serviceTag() { @@ -583,7 +615,7 @@ public String serviceTag() { /** * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * the resource IDs for the VirtualMachines that are hosted on this bare metal machine. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -592,27 +624,31 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (bmcConnectionString() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bmcConnectionString in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bmcConnectionString in model BareMetalMachineProperties")); } if (bmcCredentials() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bmcCredentials in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bmcCredentials in model BareMetalMachineProperties")); } else { bmcCredentials().validate(); } if (bmcMacAddress() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bmcMacAddress in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bmcMacAddress in model BareMetalMachineProperties")); } if (bootMacAddress() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bootMacAddress in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bootMacAddress in model BareMetalMachineProperties")); } if (hardwareInventory() != null) { hardwareInventory().validate(); @@ -621,26 +657,160 @@ public void validate() { hardwareValidationStatus().validate(); } if (machineDetails() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property machineDetails in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property machineDetails in model BareMetalMachineProperties")); } if (machineName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property machineName in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property machineName in model BareMetalMachineProperties")); } if (machineSkuId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property machineSkuId in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property machineSkuId in model BareMetalMachineProperties")); } if (rackId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackId in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rackId in model BareMetalMachineProperties")); + } + if (runtimeProtectionStatus() != null) { + runtimeProtectionStatus().validate(); + } + if (secretRotationStatus() != null) { + secretRotationStatus().forEach(e -> e.validate()); } if (serialNumber() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serialNumber in model BareMetalMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serialNumber in model BareMetalMachineProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bmcConnectionString", this.bmcConnectionString); + jsonWriter.writeJsonField("bmcCredentials", this.bmcCredentials); + jsonWriter.writeStringField("bmcMacAddress", this.bmcMacAddress); + jsonWriter.writeStringField("bootMacAddress", this.bootMacAddress); + jsonWriter.writeStringField("machineDetails", this.machineDetails); + jsonWriter.writeStringField("machineName", this.machineName); + jsonWriter.writeStringField("machineSkuId", this.machineSkuId); + jsonWriter.writeStringField("rackId", this.rackId); + jsonWriter.writeLongField("rackSlot", this.rackSlot); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("machineClusterVersion", this.machineClusterVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineProperties 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 BareMetalMachineProperties. + */ + public static BareMetalMachineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineProperties deserializedBareMetalMachineProperties = new BareMetalMachineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bmcConnectionString".equals(fieldName)) { + deserializedBareMetalMachineProperties.bmcConnectionString = reader.getString(); + } else if ("bmcCredentials".equals(fieldName)) { + deserializedBareMetalMachineProperties.bmcCredentials = AdministrativeCredentials.fromJson(reader); + } else if ("bmcMacAddress".equals(fieldName)) { + deserializedBareMetalMachineProperties.bmcMacAddress = reader.getString(); + } else if ("bootMacAddress".equals(fieldName)) { + deserializedBareMetalMachineProperties.bootMacAddress = reader.getString(); + } else if ("machineDetails".equals(fieldName)) { + deserializedBareMetalMachineProperties.machineDetails = reader.getString(); + } else if ("machineName".equals(fieldName)) { + deserializedBareMetalMachineProperties.machineName = reader.getString(); + } else if ("machineSkuId".equals(fieldName)) { + deserializedBareMetalMachineProperties.machineSkuId = reader.getString(); + } else if ("rackId".equals(fieldName)) { + deserializedBareMetalMachineProperties.rackId = reader.getString(); + } else if ("rackSlot".equals(fieldName)) { + deserializedBareMetalMachineProperties.rackSlot = reader.getLong(); + } else if ("serialNumber".equals(fieldName)) { + deserializedBareMetalMachineProperties.serialNumber = reader.getString(); + } else if ("associatedResourceIds".equals(fieldName)) { + List associatedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineProperties.associatedResourceIds = associatedResourceIds; + } else if ("clusterId".equals(fieldName)) { + deserializedBareMetalMachineProperties.clusterId = reader.getString(); + } else if ("cordonStatus".equals(fieldName)) { + deserializedBareMetalMachineProperties.cordonStatus + = BareMetalMachineCordonStatus.fromString(reader.getString()); + } else if ("detailedStatus".equals(fieldName)) { + deserializedBareMetalMachineProperties.detailedStatus + = BareMetalMachineDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedBareMetalMachineProperties.detailedStatusMessage = reader.getString(); + } else if ("hardwareInventory".equals(fieldName)) { + deserializedBareMetalMachineProperties.hardwareInventory = HardwareInventory.fromJson(reader); + } else if ("hardwareValidationStatus".equals(fieldName)) { + deserializedBareMetalMachineProperties.hardwareValidationStatus + = HardwareValidationStatus.fromJson(reader); + } else if ("hybridAksClustersAssociatedIds".equals(fieldName)) { + List hybridAksClustersAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineProperties.hybridAksClustersAssociatedIds + = hybridAksClustersAssociatedIds; + } else if ("kubernetesNodeName".equals(fieldName)) { + deserializedBareMetalMachineProperties.kubernetesNodeName = reader.getString(); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedBareMetalMachineProperties.kubernetesVersion = reader.getString(); + } else if ("machineClusterVersion".equals(fieldName)) { + deserializedBareMetalMachineProperties.machineClusterVersion = reader.getString(); + } else if ("machineRoles".equals(fieldName)) { + List machineRoles = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineProperties.machineRoles = machineRoles; + } else if ("oamIpv4Address".equals(fieldName)) { + deserializedBareMetalMachineProperties.oamIpv4Address = reader.getString(); + } else if ("oamIpv6Address".equals(fieldName)) { + deserializedBareMetalMachineProperties.oamIpv6Address = reader.getString(); + } else if ("osImage".equals(fieldName)) { + deserializedBareMetalMachineProperties.osImage = reader.getString(); + } else if ("powerState".equals(fieldName)) { + deserializedBareMetalMachineProperties.powerState + = BareMetalMachinePowerState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedBareMetalMachineProperties.provisioningState + = BareMetalMachineProvisioningState.fromString(reader.getString()); + } else if ("readyState".equals(fieldName)) { + deserializedBareMetalMachineProperties.readyState + = BareMetalMachineReadyState.fromString(reader.getString()); + } else if ("runtimeProtectionStatus".equals(fieldName)) { + deserializedBareMetalMachineProperties.runtimeProtectionStatus + = RuntimeProtectionStatus.fromJson(reader); + } else if ("secretRotationStatus".equals(fieldName)) { + List secretRotationStatus + = reader.readArray(reader1 -> SecretRotationStatus.fromJson(reader1)); + deserializedBareMetalMachineProperties.secretRotationStatus = secretRotationStatus; + } else if ("serviceTag".equals(fieldName)) { + deserializedBareMetalMachineProperties.serviceTag = reader.getString(); + } else if ("virtualMachinesAssociatedIds".equals(fieldName)) { + List virtualMachinesAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineProperties.virtualMachinesAssociatedIds = virtualMachinesAssociatedIds; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java index 134ba1f346236..acd46dbb92562 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java @@ -8,52 +8,64 @@ import com.azure.core.management.Resource; 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.networkcloud.models.BmcKeySetDetailedStatus; import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; import com.azure.resourcemanager.networkcloud.models.BmcKeySetProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.KeySetUser; import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** BmcKeySet represents the baseboard management controller key set. */ +/** + * BmcKeySet represents the baseboard management controller key set. + */ @Fluent public final class BmcKeySetInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * BmcKeySetProperties represents the properties of baseboard management controller key set. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private BmcKeySetProperties innerProperties = new BmcKeySetProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of BmcKeySetInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BmcKeySetInner class. + */ public BmcKeySetInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,11 +73,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the BmcKeySetInner object itself. */ @@ -75,11 +84,8 @@ public BmcKeySetInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: BmcKeySetProperties represents the properties of baseboard management - * controller key set. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BmcKeySetProperties innerProperties() { @@ -88,21 +94,55 @@ private BmcKeySetProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public BmcKeySetInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BmcKeySetInner withTags(Map tags) { super.withTags(tags); @@ -112,7 +152,7 @@ public BmcKeySetInner withTags(Map tags) { /** * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ public String azureGroupId() { @@ -122,7 +162,7 @@ public String azureGroupId() { /** * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @param azureGroupId the azureGroupId value to set. * @return the BmcKeySetInner object itself. */ @@ -136,7 +176,7 @@ public BmcKeySetInner withAzureGroupId(String azureGroupId) { /** * Get the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ public BmcKeySetDetailedStatus detailedStatus() { @@ -145,7 +185,7 @@ public BmcKeySetDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -155,7 +195,7 @@ public String detailedStatusMessage() { /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -165,7 +205,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @param expiration the expiration value to set. * @return the BmcKeySetInner object itself. */ @@ -179,7 +219,7 @@ public BmcKeySetInner withExpiration(OffsetDateTime expiration) { /** * Get the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ public OffsetDateTime lastValidation() { @@ -188,7 +228,7 @@ public OffsetDateTime lastValidation() { /** * Get the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ public BmcKeySetPrivilegeLevel privilegeLevel() { @@ -197,7 +237,7 @@ public BmcKeySetPrivilegeLevel privilegeLevel() { /** * Set the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @param privilegeLevel the privilegeLevel value to set. * @return the BmcKeySetInner object itself. */ @@ -211,7 +251,7 @@ public BmcKeySetInner withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel) /** * Get the provisioningState property: The provisioning state of the baseboard management controller key set. - * + * * @return the provisioningState value. */ public BmcKeySetProvisioningState provisioningState() { @@ -220,7 +260,7 @@ public BmcKeySetProvisioningState provisioningState() { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -229,7 +269,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BmcKeySetInner object itself. */ @@ -243,7 +283,7 @@ public BmcKeySetInner withUserList(List userList) { /** * Get the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ public List userListStatus() { @@ -252,23 +292,79 @@ public List userListStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model BmcKeySetInner")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property extendedLocation in model BmcKeySetInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model BmcKeySetInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model BmcKeySetInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BmcKeySetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BmcKeySetInner 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 BmcKeySetInner. + */ + public static BmcKeySetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BmcKeySetInner deserializedBmcKeySetInner = new BmcKeySetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBmcKeySetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBmcKeySetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBmcKeySetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBmcKeySetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBmcKeySetInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedBmcKeySetInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedBmcKeySetInner.innerProperties = BmcKeySetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBmcKeySetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBmcKeySetInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java index 0c7a3c4758c5b..69b7afc6c711a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java @@ -5,35 +5,43 @@ package com.azure.resourcemanager.networkcloud.fluent.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 com.azure.resourcemanager.networkcloud.models.KeySetUser; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. */ +/** + * BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. + */ @Fluent -public final class BmcKeySetPatchProperties { +public final class BmcKeySetPatchProperties implements JsonSerializable { /* * The date and time after which the users in this key set will be removed from the baseboard management * controllers. */ - @JsonProperty(value = "expiration") private OffsetDateTime expiration; /* * The unique list of permitted users. */ - @JsonProperty(value = "userList") private List userList; - /** Creates an instance of BmcKeySetPatchProperties class. */ + /** + * Creates an instance of BmcKeySetPatchProperties class. + */ public BmcKeySetPatchProperties() { } /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -43,7 +51,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @param expiration the expiration value to set. * @return the BmcKeySetPatchProperties object itself. */ @@ -54,7 +62,7 @@ public BmcKeySetPatchProperties withExpiration(OffsetDateTime expiration) { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -63,7 +71,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BmcKeySetPatchProperties object itself. */ @@ -74,7 +82,7 @@ public BmcKeySetPatchProperties withUserList(List userList) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -82,4 +90,46 @@ public void validate() { userList().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + jsonWriter.writeArrayField("userList", this.userList, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BmcKeySetPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BmcKeySetPatchProperties 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 BmcKeySetPatchProperties. + */ + public static BmcKeySetPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BmcKeySetPatchProperties deserializedBmcKeySetPatchProperties = new BmcKeySetPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expiration".equals(fieldName)) { + deserializedBmcKeySetPatchProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("userList".equals(fieldName)) { + List userList = reader.readArray(reader1 -> KeySetUser.fromJson(reader1)); + deserializedBmcKeySetPatchProperties.userList = userList; + } else { + reader.skipChildren(); + } + } + + return deserializedBmcKeySetPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java index 6dc71ce7195b5..3229d85589af9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java @@ -5,83 +5,84 @@ package com.azure.resourcemanager.networkcloud.fluent.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.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkcloud.models.BmcKeySetDetailedStatus; import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; import com.azure.resourcemanager.networkcloud.models.BmcKeySetProvisioningState; import com.azure.resourcemanager.networkcloud.models.KeySetUser; import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** BmcKeySetProperties represents the properties of baseboard management controller key set. */ +/** + * BmcKeySetProperties represents the properties of baseboard management controller key set. + */ @Fluent -public final class BmcKeySetProperties { +public final class BmcKeySetProperties implements JsonSerializable { /* * The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. * Users that are not in the group will not have access. */ - @JsonProperty(value = "azureGroupId", required = true) private String azureGroupId; /* * The more detailed status of the key set. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private BmcKeySetDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The date and time after which the users in this key set will be removed from the baseboard management * controllers. */ - @JsonProperty(value = "expiration", required = true) private OffsetDateTime expiration; /* * The last time this key set was validated. */ - @JsonProperty(value = "lastValidation", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastValidation; /* * The access level allowed for the users in this key set. */ - @JsonProperty(value = "privilegeLevel", required = true) private BmcKeySetPrivilegeLevel privilegeLevel; /* * The provisioning state of the baseboard management controller key set. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private BmcKeySetProvisioningState provisioningState; /* * The unique list of permitted users. */ - @JsonProperty(value = "userList", required = true) private List userList; /* * The status evaluation of each user. */ - @JsonProperty(value = "userListStatus", access = JsonProperty.Access.WRITE_ONLY) private List userListStatus; - /** Creates an instance of BmcKeySetProperties class. */ + /** + * Creates an instance of BmcKeySetProperties class. + */ public BmcKeySetProperties() { } /** * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ public String azureGroupId() { @@ -91,7 +92,7 @@ public String azureGroupId() { /** * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @param azureGroupId the azureGroupId value to set. * @return the BmcKeySetProperties object itself. */ @@ -102,7 +103,7 @@ public BmcKeySetProperties withAzureGroupId(String azureGroupId) { /** * Get the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ public BmcKeySetDetailedStatus detailedStatus() { @@ -111,7 +112,7 @@ public BmcKeySetDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -121,7 +122,7 @@ public String detailedStatusMessage() { /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -131,7 +132,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @param expiration the expiration value to set. * @return the BmcKeySetProperties object itself. */ @@ -142,7 +143,7 @@ public BmcKeySetProperties withExpiration(OffsetDateTime expiration) { /** * Get the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ public OffsetDateTime lastValidation() { @@ -151,7 +152,7 @@ public OffsetDateTime lastValidation() { /** * Get the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ public BmcKeySetPrivilegeLevel privilegeLevel() { @@ -160,7 +161,7 @@ public BmcKeySetPrivilegeLevel privilegeLevel() { /** * Set the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @param privilegeLevel the privilegeLevel value to set. * @return the BmcKeySetProperties object itself. */ @@ -171,7 +172,7 @@ public BmcKeySetProperties withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeL /** * Get the provisioningState property: The provisioning state of the baseboard management controller key set. - * + * * @return the provisioningState value. */ public BmcKeySetProvisioningState provisioningState() { @@ -180,7 +181,7 @@ public BmcKeySetProvisioningState provisioningState() { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -189,7 +190,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BmcKeySetProperties object itself. */ @@ -200,7 +201,7 @@ public BmcKeySetProperties withUserList(List userList) { /** * Get the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ public List userListStatus() { @@ -209,25 +210,27 @@ public List userListStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (azureGroupId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property azureGroupId in model BmcKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureGroupId in model BmcKeySetProperties")); } if (expiration() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property expiration in model BmcKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property expiration in model BmcKeySetProperties")); } if (privilegeLevel() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property privilegeLevel in model BmcKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privilegeLevel in model BmcKeySetProperties")); } if (userList() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userList in model BmcKeySetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userList in model BmcKeySetProperties")); } else { userList().forEach(e -> e.validate()); } @@ -237,4 +240,70 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureGroupId", this.azureGroupId); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + jsonWriter.writeStringField("privilegeLevel", + this.privilegeLevel == null ? null : this.privilegeLevel.toString()); + jsonWriter.writeArrayField("userList", this.userList, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BmcKeySetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BmcKeySetProperties 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 BmcKeySetProperties. + */ + public static BmcKeySetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BmcKeySetProperties deserializedBmcKeySetProperties = new BmcKeySetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureGroupId".equals(fieldName)) { + deserializedBmcKeySetProperties.azureGroupId = reader.getString(); + } else if ("expiration".equals(fieldName)) { + deserializedBmcKeySetProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("privilegeLevel".equals(fieldName)) { + deserializedBmcKeySetProperties.privilegeLevel + = BmcKeySetPrivilegeLevel.fromString(reader.getString()); + } else if ("userList".equals(fieldName)) { + List userList = reader.readArray(reader1 -> KeySetUser.fromJson(reader1)); + deserializedBmcKeySetProperties.userList = userList; + } else if ("detailedStatus".equals(fieldName)) { + deserializedBmcKeySetProperties.detailedStatus + = BmcKeySetDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedBmcKeySetProperties.detailedStatusMessage = reader.getString(); + } else if ("lastValidation".equals(fieldName)) { + deserializedBmcKeySetProperties.lastValidation = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedBmcKeySetProperties.provisioningState + = BmcKeySetProvisioningState.fromString(reader.getString()); + } else if ("userListStatus".equals(fieldName)) { + List userListStatus + = reader.readArray(reader1 -> KeySetUserStatus.fromJson(reader1)); + deserializedBmcKeySetProperties.userListStatus = userListStatus; + } else { + reader.skipChildren(); + } + } + + return deserializedBmcKeySetProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java index 7801ec40772f7..54f1c3da87160 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java @@ -8,58 +8,68 @@ import com.azure.core.management.Resource; 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.networkcloud.models.CloudServicesNetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkProvisioningState; import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; /** * CloudServicesNetwork represents additional egress information that will be used by associated virtual machines or * hybrid AKS clusters. - * - *

Upon creation, the additional services that are provided by the platform will be allocated and represented in the - * status of this resource. All resources associated with this cloud services network will be part of the same layer 2 - * (L2) isolation domain. At least one service network must be created but may be reused across many virtual machines - * and/or Hybrid AKS clusters. + * + * Upon creation, the additional services that are provided by the platform will be allocated and + * represented in the status of this resource. All resources associated with this cloud services network will be part + * of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + * virtual machines and/or Hybrid AKS clusters. */ @Fluent public final class CloudServicesNetworkInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * CloudServicesNetworkProperties represents properties of the cloud services network. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private CloudServicesNetworkProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of CloudServicesNetworkInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudServicesNetworkInner class. + */ public CloudServicesNetworkInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -67,11 +77,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the CloudServicesNetworkInner object itself. */ @@ -81,11 +88,8 @@ public CloudServicesNetworkInner withExtendedLocation(ExtendedLocation extendedL } /** - * Get the innerProperties property: CloudServicesNetworkProperties represents properties of the cloud services - * network. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private CloudServicesNetworkProperties innerProperties() { @@ -94,21 +98,55 @@ private CloudServicesNetworkProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public CloudServicesNetworkInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CloudServicesNetworkInner withTags(Map tags) { super.withTags(tags); @@ -118,7 +156,7 @@ public CloudServicesNetworkInner withTags(Map tags) { /** * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @return the additionalEgressEndpoints value. */ public List additionalEgressEndpoints() { @@ -128,7 +166,7 @@ public List additionalEgressEndpoints() { /** * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. * @return the CloudServicesNetworkInner object itself. */ @@ -143,7 +181,7 @@ public CloudServicesNetworkInner withAdditionalEgressEndpoints(List associatedResourceIds() { @@ -153,7 +191,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is * associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -162,7 +200,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the cloud services network. - * + * * @return the detailedStatus value. */ public CloudServicesNetworkDetailedStatus detailedStatus() { @@ -171,7 +209,7 @@ public CloudServicesNetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -181,7 +219,7 @@ public String detailedStatusMessage() { /** * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @return the enableDefaultEgressEndpoints value. */ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { @@ -191,7 +229,7 @@ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpo /** * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. * @return the CloudServicesNetworkInner object itself. */ @@ -207,7 +245,7 @@ public CloudServicesNetworkInner withEnableDefaultEgressEndpoints( /** * Get the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are * currently enabled. - * + * * @return the enabledEgressEndpoints value. */ public List enabledEgressEndpoints() { @@ -217,7 +255,7 @@ public List enabledEgressEndpoints() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this cloud services network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -227,7 +265,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the interfaceName property: The name of the interface that will be present in the virtual machine to * represent this network. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -236,7 +274,7 @@ public String interfaceName() { /** * Get the provisioningState property: The provisioning state of the cloud services network. - * + * * @return the provisioningState value. */ public CloudServicesNetworkProvisioningState provisioningState() { @@ -247,7 +285,7 @@ public CloudServicesNetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud * services network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -256,13 +294,14 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model CloudServicesNetworkInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model CloudServicesNetworkInner")); } else { extendedLocation().validate(); } @@ -272,4 +311,60 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(CloudServicesNetworkInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudServicesNetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudServicesNetworkInner 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 CloudServicesNetworkInner. + */ + public static CloudServicesNetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudServicesNetworkInner deserializedCloudServicesNetworkInner = new CloudServicesNetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudServicesNetworkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudServicesNetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudServicesNetworkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudServicesNetworkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudServicesNetworkInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedCloudServicesNetworkInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedCloudServicesNetworkInner.innerProperties + = CloudServicesNetworkProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudServicesNetworkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudServicesNetworkInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java index 6479d06fa02ae..4ed60c01604f4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java @@ -5,9 +5,13 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -15,27 +19,28 @@ * a patch request. */ @Fluent -public final class CloudServicesNetworkPatchProperties { +public final class CloudServicesNetworkPatchProperties + implements JsonSerializable { /* * The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. */ - @JsonProperty(value = "additionalEgressEndpoints") private List additionalEgressEndpoints; /* * The indicator of whether the platform default endpoints are allowed for the egress traffic. */ - @JsonProperty(value = "enableDefaultEgressEndpoints") private CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints; - /** Creates an instance of CloudServicesNetworkPatchProperties class. */ + /** + * Creates an instance of CloudServicesNetworkPatchProperties class. + */ public CloudServicesNetworkPatchProperties() { } /** * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @return the additionalEgressEndpoints value. */ public List additionalEgressEndpoints() { @@ -45,7 +50,7 @@ public List additionalEgressEndpoints() { /** * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. * @return the CloudServicesNetworkPatchProperties object itself. */ @@ -58,7 +63,7 @@ public List additionalEgressEndpoints() { /** * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @return the enableDefaultEgressEndpoints value. */ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { @@ -68,7 +73,7 @@ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpo /** * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. * @return the CloudServicesNetworkPatchProperties object itself. */ @@ -80,7 +85,7 @@ public CloudServicesNetworkPatchProperties withEnableDefaultEgressEndpoints( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -88,4 +93,50 @@ public void validate() { additionalEgressEndpoints().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalEgressEndpoints", this.additionalEgressEndpoints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("enableDefaultEgressEndpoints", + this.enableDefaultEgressEndpoints == null ? null : this.enableDefaultEgressEndpoints.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudServicesNetworkPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudServicesNetworkPatchProperties 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 CloudServicesNetworkPatchProperties. + */ + public static CloudServicesNetworkPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudServicesNetworkPatchProperties deserializedCloudServicesNetworkPatchProperties + = new CloudServicesNetworkPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalEgressEndpoints".equals(fieldName)) { + List additionalEgressEndpoints + = reader.readArray(reader1 -> EgressEndpoint.fromJson(reader1)); + deserializedCloudServicesNetworkPatchProperties.additionalEgressEndpoints + = additionalEgressEndpoints; + } else if ("enableDefaultEgressEndpoints".equals(fieldName)) { + deserializedCloudServicesNetworkPatchProperties.enableDefaultEgressEndpoints + = CloudServicesNetworkEnableDefaultEgressEndpoints.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudServicesNetworkPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java index 993cccc4846b1..b48d0bdaa2f22 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java @@ -5,92 +5,89 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.CloudServicesNetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkProvisioningState; import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** CloudServicesNetworkProperties represents properties of the cloud services network. */ +/** + * CloudServicesNetworkProperties represents properties of the cloud services network. + */ @Fluent -public final class CloudServicesNetworkProperties { +public final class CloudServicesNetworkProperties implements JsonSerializable { /* * The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. */ - @JsonProperty(value = "additionalEgressEndpoints") private List additionalEgressEndpoints; /* * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. */ - @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List associatedResourceIds; /* * The resource ID of the Network Cloud cluster this cloud services network is associated with. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The more detailed status of the cloud services network. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private CloudServicesNetworkDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The indicator of whether the platform default endpoints are allowed for the egress traffic. */ - @JsonProperty(value = "enableDefaultEgressEndpoints") private CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints; /* * The full list of additional and default egress endpoints that are currently enabled. */ - @JsonProperty(value = "enabledEgressEndpoints", access = JsonProperty.Access.WRITE_ONLY) private List enabledEgressEndpoints; /* * Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are * associated with this cloud services network. */ - @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List hybridAksClustersAssociatedIds; /* * The name of the interface that will be present in the virtual machine to represent this network. */ - @JsonProperty(value = "interfaceName", access = JsonProperty.Access.WRITE_ONLY) private String interfaceName; /* * The provisioning state of the cloud services network. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private CloudServicesNetworkProvisioningState provisioningState; /* * Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any * Hybrid AKS virtual machines, that are currently using this cloud services network. */ - @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List virtualMachinesAssociatedIds; - /** Creates an instance of CloudServicesNetworkProperties class. */ + /** + * Creates an instance of CloudServicesNetworkProperties class. + */ public CloudServicesNetworkProperties() { } /** * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @return the additionalEgressEndpoints value. */ public List additionalEgressEndpoints() { @@ -100,7 +97,7 @@ public List additionalEgressEndpoints() { /** * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. * @return the CloudServicesNetworkProperties object itself. */ @@ -113,7 +110,7 @@ public List additionalEgressEndpoints() { /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -123,7 +120,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is * associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -132,7 +129,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the cloud services network. - * + * * @return the detailedStatus value. */ public CloudServicesNetworkDetailedStatus detailedStatus() { @@ -141,7 +138,7 @@ public CloudServicesNetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -151,7 +148,7 @@ public String detailedStatusMessage() { /** * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @return the enableDefaultEgressEndpoints value. */ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { @@ -161,7 +158,7 @@ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpo /** * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. * @return the CloudServicesNetworkProperties object itself. */ @@ -174,7 +171,7 @@ public CloudServicesNetworkProperties withEnableDefaultEgressEndpoints( /** * Get the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are * currently enabled. - * + * * @return the enabledEgressEndpoints value. */ public List enabledEgressEndpoints() { @@ -184,7 +181,7 @@ public List enabledEgressEndpoints() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this cloud services network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -194,7 +191,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the interfaceName property: The name of the interface that will be present in the virtual machine to * represent this network. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -203,7 +200,7 @@ public String interfaceName() { /** * Get the provisioningState property: The provisioning state of the cloud services network. - * + * * @return the provisioningState value. */ public CloudServicesNetworkProvisioningState provisioningState() { @@ -214,7 +211,7 @@ public CloudServicesNetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud * services network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -223,7 +220,7 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -234,4 +231,76 @@ public void validate() { enabledEgressEndpoints().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalEgressEndpoints", this.additionalEgressEndpoints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("enableDefaultEgressEndpoints", + this.enableDefaultEgressEndpoints == null ? null : this.enableDefaultEgressEndpoints.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudServicesNetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudServicesNetworkProperties 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 CloudServicesNetworkProperties. + */ + public static CloudServicesNetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudServicesNetworkProperties deserializedCloudServicesNetworkProperties + = new CloudServicesNetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalEgressEndpoints".equals(fieldName)) { + List additionalEgressEndpoints + = reader.readArray(reader1 -> EgressEndpoint.fromJson(reader1)); + deserializedCloudServicesNetworkProperties.additionalEgressEndpoints = additionalEgressEndpoints; + } else if ("associatedResourceIds".equals(fieldName)) { + List associatedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCloudServicesNetworkProperties.associatedResourceIds = associatedResourceIds; + } else if ("clusterId".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.detailedStatus + = CloudServicesNetworkDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.detailedStatusMessage = reader.getString(); + } else if ("enableDefaultEgressEndpoints".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.enableDefaultEgressEndpoints + = CloudServicesNetworkEnableDefaultEgressEndpoints.fromString(reader.getString()); + } else if ("enabledEgressEndpoints".equals(fieldName)) { + List enabledEgressEndpoints + = reader.readArray(reader1 -> EgressEndpoint.fromJson(reader1)); + deserializedCloudServicesNetworkProperties.enabledEgressEndpoints = enabledEgressEndpoints; + } else if ("hybridAksClustersAssociatedIds".equals(fieldName)) { + List hybridAksClustersAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCloudServicesNetworkProperties.hybridAksClustersAssociatedIds + = hybridAksClustersAssociatedIds; + } else if ("interfaceName".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.interfaceName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudServicesNetworkProperties.provisioningState + = CloudServicesNetworkProvisioningState.fromString(reader.getString()); + } else if ("virtualMachinesAssociatedIds".equals(fieldName)) { + List virtualMachinesAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCloudServicesNetworkProperties.virtualMachinesAssociatedIds + = virtualMachinesAssociatedIds; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudServicesNetworkProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java index 2faa57cc21f30..3da1bfd043dd9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java @@ -8,57 +8,82 @@ import com.azure.core.management.Resource; 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.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterSecretArchive; import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettings; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Cluster represents the on-premises Network Cloud cluster. */ +/** + * Cluster represents the on-premises Network Cloud cluster. + */ @Fluent public final class ClusterInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster manager associated with the cluster. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * ClusterProperties represents the properties of a cluster. - * + * The identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private ClusterProperties innerProperties = new ClusterProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ClusterInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ClusterInner class. + */ public ClusterInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster. - * + * Get the extendedLocation property: The extended location of the cluster manager associated with the cluster. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -66,11 +91,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster. - * + * Set the extendedLocation property: The extended location of the cluster manager associated with the cluster. + * * @param extendedLocation the extendedLocation value to set. * @return the ClusterInner object itself. */ @@ -80,10 +102,28 @@ public ClusterInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: ClusterProperties represents the properties of a cluster. - * - *

The list of the resource properties. - * + * Get the identity property: The identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity for the resource. + * + * @param identity the identity value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ClusterProperties innerProperties() { @@ -92,21 +132,55 @@ private ClusterProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ClusterInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClusterInner withTags(Map tags) { super.withTags(tags); @@ -114,11 +188,9 @@ public ClusterInner withTags(Map tags) { } /** - * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Get the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @return the aggregatorOrSingleRackDefinition value. */ public RackDefinition aggregatorOrSingleRackDefinition() { @@ -126,11 +198,9 @@ public RackDefinition aggregatorOrSingleRackDefinition() { } /** - * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Set the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. * @return the ClusterInner object itself. */ @@ -143,9 +213,34 @@ public ClusterInner withAggregatorOrSingleRackDefinition(RackDefinition aggregat } /** - * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for - * storing relevant logs. - * + * Get the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @return the analyticsOutputSettings value. + */ + public AnalyticsOutputSettings analyticsOutputSettings() { + return this.innerProperties() == null ? null : this.innerProperties().analyticsOutputSettings(); + } + + /** + * Set the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @param analyticsOutputSettings the analyticsOutputSettings value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAnalyticsOutputSettings(analyticsOutputSettings); + return this; + } + + /** + * Get the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics Workspace that will + * be used for storing relevant logs. + * * @return the analyticsWorkspaceId value. */ public String analyticsWorkspaceId() { @@ -153,9 +248,9 @@ public String analyticsWorkspaceId() { } /** - * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for - * storing relevant logs. - * + * Set the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics Workspace that will + * be used for storing relevant logs. + * * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. * @return the ClusterInner object itself. */ @@ -170,7 +265,7 @@ public ClusterInner withAnalyticsWorkspaceId(String analyticsWorkspaceId) { /** * Get the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this * cluster. - * + * * @return the availableUpgradeVersions value. */ public List availableUpgradeVersions() { @@ -178,10 +273,8 @@ public List availableUpgradeVersions() { } /** - * Get the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. - * - *

The capacity supported by this cluster. - * + * Get the clusterCapacity property: The capacity supported by this cluster. + * * @return the clusterCapacity value. */ public ClusterCapacity clusterCapacity() { @@ -191,7 +284,7 @@ public ClusterCapacity clusterCapacity() { /** * Get the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the * cluster. - * + * * @return the clusterConnectionStatus value. */ public ClusterConnectionStatus clusterConnectionStatus() { @@ -199,12 +292,10 @@ public ClusterConnectionStatus clusterConnectionStatus() { } /** - * Get the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster's control plane location. This extended - * location is used to route the requests of child objects of the cluster that are handled by the platform operator. - * + * Get the clusterExtendedLocation property: The extended location (custom location) that represents the cluster's + * control plane location. This extended location is used to route the requests of child objects of the cluster that + * are handled by the platform operator. + * * @return the clusterExtendedLocation value. */ public ExtendedLocation clusterExtendedLocation() { @@ -214,7 +305,7 @@ public ExtendedLocation clusterExtendedLocation() { /** * Get the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @return the clusterLocation value. */ public String clusterLocation() { @@ -224,7 +315,7 @@ public String clusterLocation() { /** * Set the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @param clusterLocation the clusterLocation value to set. * @return the ClusterInner object itself. */ @@ -239,7 +330,7 @@ public ClusterInner withClusterLocation(String clusterLocation) { /** * Get the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the * cluster. - * + * * @return the clusterManagerConnectionStatus value. */ public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { @@ -249,7 +340,7 @@ public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { /** * Get the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set * by the Cluster Manager when the cluster is created. - * + * * @return the clusterManagerId value. */ public String clusterManagerId() { @@ -257,11 +348,9 @@ public String clusterManagerId() { } /** - * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Get the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @return the clusterServicePrincipal value. */ public ServicePrincipalInformation clusterServicePrincipal() { @@ -269,11 +358,9 @@ public ServicePrincipalInformation clusterServicePrincipal() { } /** - * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Set the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @param clusterServicePrincipal the clusterServicePrincipal value to set. * @return the ClusterInner object itself. */ @@ -287,7 +374,7 @@ public ClusterInner withClusterServicePrincipal(ServicePrincipalInformation clus /** * Get the clusterType property: The type of rack configuration for the cluster. - * + * * @return the clusterType value. */ public ClusterType clusterType() { @@ -296,7 +383,7 @@ public ClusterType clusterType() { /** * Set the clusterType property: The type of rack configuration for the cluster. - * + * * @param clusterType the clusterType value to set. * @return the ClusterInner object itself. */ @@ -310,7 +397,7 @@ public ClusterInner withClusterType(ClusterType clusterType) { /** * Get the clusterVersion property: The current runtime version of the cluster. - * + * * @return the clusterVersion value. */ public String clusterVersion() { @@ -319,7 +406,7 @@ public String clusterVersion() { /** * Set the clusterVersion property: The current runtime version of the cluster. - * + * * @param clusterVersion the clusterVersion value to set. * @return the ClusterInner object itself. */ @@ -332,12 +419,34 @@ public ClusterInner withClusterVersion(String clusterVersion) { } /** - * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Get the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @return the commandOutputSettings value. + */ + public CommandOutputSettings commandOutputSettings() { + return this.innerProperties() == null ? null : this.innerProperties().commandOutputSettings(); + } + + /** + * Set the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @param commandOutputSettings the commandOutputSettings value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withCommandOutputSettings(CommandOutputSettings commandOutputSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withCommandOutputSettings(commandOutputSettings); + return this; + } + + /** + * Get the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @return the computeDeploymentThreshold value. */ public ValidationThreshold computeDeploymentThreshold() { @@ -345,12 +454,9 @@ public ValidationThreshold computeDeploymentThreshold() { } /** - * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Set the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. * @return the ClusterInner object itself. */ @@ -365,7 +471,7 @@ public ClusterInner withComputeDeploymentThreshold(ValidationThreshold computeDe /** * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @return the computeRackDefinitions value. */ public List computeRackDefinitions() { @@ -375,7 +481,7 @@ public List computeRackDefinitions() { /** * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @param computeRackDefinitions the computeRackDefinitions value to set. * @return the ClusterInner object itself. */ @@ -389,7 +495,7 @@ public ClusterInner withComputeRackDefinitions(List computeRackD /** * Get the detailedStatus property: The current detailed status of the cluster. - * + * * @return the detailedStatus value. */ public ClusterDetailedStatus detailedStatus() { @@ -398,7 +504,7 @@ public ClusterDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -406,13 +512,10 @@ public String detailedStatusMessage() { } /** - * Get the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom - * location) that represents the Hybrid AKS control plane location. This extended location is used when creating - * provisioned clusters (Hybrid AKS clusters). - * + * Get the hybridAksExtendedLocation property: Field Deprecated. This field will not be populated in an upcoming + * version. The extended location (custom location) that represents the Hybrid AKS control plane location. This + * extended location is used when creating provisioned clusters (Hybrid AKS clusters). + * * @return the hybridAksExtendedLocation value. */ public ExtendedLocation hybridAksExtendedLocation() { @@ -420,11 +523,9 @@ public ExtendedLocation hybridAksExtendedLocation() { } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -432,11 +533,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the ClusterInner object itself. */ @@ -451,7 +550,7 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { /** * Get the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. - * + * * @return the manualActionCount value. */ public Long manualActionCount() { @@ -460,7 +559,7 @@ public Long manualActionCount() { /** * Get the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. - * + * * @return the networkFabricId value. */ public String networkFabricId() { @@ -469,7 +568,7 @@ public String networkFabricId() { /** * Set the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. - * + * * @param networkFabricId the networkFabricId value to set. * @return the ClusterInner object itself. */ @@ -483,25 +582,147 @@ public ClusterInner withNetworkFabricId(String networkFabricId) { /** * Get the provisioningState property: The provisioning state of the cluster. - * + * * @return the provisioningState value. */ public ClusterProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @return the runtimeProtectionConfiguration value. + */ + public RuntimeProtectionConfiguration runtimeProtectionConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().runtimeProtectionConfiguration(); + } + + /** + * Set the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @param runtimeProtectionConfiguration the runtimeProtectionConfiguration value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withRuntimeProtectionConfiguration(runtimeProtectionConfiguration); + return this; + } + + /** + * Get the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @return the secretArchive value. + */ + public ClusterSecretArchive secretArchive() { + return this.innerProperties() == null ? null : this.innerProperties().secretArchive(); + } + + /** + * Set the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @param secretArchive the secretArchive value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSecretArchive(ClusterSecretArchive secretArchive) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withSecretArchive(secretArchive); + return this; + } + + /** + * Get the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @return the secretArchiveSettings value. + */ + public SecretArchiveSettings secretArchiveSettings() { + return this.innerProperties() == null ? null : this.innerProperties().secretArchiveSettings(); + } + + /** + * Set the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @param secretArchiveSettings the secretArchiveSettings value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withSecretArchiveSettings(secretArchiveSettings); + return this; + } + /** * Get the supportExpiryDate property: The support end date of the runtime version of the cluster. - * + * * @return the supportExpiryDate value. */ public String supportExpiryDate() { return this.innerProperties() == null ? null : this.innerProperties().supportExpiryDate(); } + /** + * Get the updateStrategy property: The strategy for updating the cluster. + * + * @return the updateStrategy value. + */ + public ClusterUpdateStrategy updateStrategy() { + return this.innerProperties() == null ? null : this.innerProperties().updateStrategy(); + } + + /** + * Set the updateStrategy property: The strategy for updating the cluster. + * + * @param updateStrategy the updateStrategy value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUpdateStrategy(ClusterUpdateStrategy updateStrategy) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withUpdateStrategy(updateStrategy); + return this; + } + + /** + * Get the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @return the vulnerabilityScanningSettings value. + */ + public VulnerabilityScanningSettings vulnerabilityScanningSettings() { + return this.innerProperties() == null ? null : this.innerProperties().vulnerabilityScanningSettings(); + } + + /** + * Set the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @param vulnerabilityScanningSettings the vulnerabilityScanningSettings value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withVulnerabilityScanningSettings(VulnerabilityScanningSettings vulnerabilityScanningSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withVulnerabilityScanningSettings(vulnerabilityScanningSettings); + return this; + } + /** * Get the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. - * + * * @return the workloadResourceIds value. */ public List workloadResourceIds() { @@ -510,23 +731,84 @@ public List workloadResourceIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model ClusterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property extendedLocation in model ClusterInner")); } else { extendedLocation().validate(); } + if (identity() != null) { + identity().validate(); + } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ClusterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model ClusterInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + 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 ("extendedLocation".equals(fieldName)) { + deserializedClusterInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterInner.innerProperties = ClusterProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedClusterInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java index 834ac41d0913d..5367fbf37ed8e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java @@ -8,41 +8,83 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ClusterAvailableVersion; import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import java.io.IOException; import java.util.List; import java.util.Map; -/** ClusterManager represents a control-plane to manage one or more on-premises clusters. */ +/** + * ClusterManager represents a control-plane to manage one or more on-premises clusters. + */ @Fluent public final class ClusterManagerInner extends Resource { /* - * ClusterManagerProperties represents the properties of a cluster manager. - * + * The identity of the cluster manager. + */ + private ManagedServiceIdentity identity; + + /* * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private ClusterManagerProperties innerProperties = new ClusterManagerProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ClusterManagerInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ClusterManagerInner class. + */ public ClusterManagerInner() { } /** - * Get the innerProperties property: ClusterManagerProperties represents the properties of a cluster manager. - * - *

The list of the resource properties. - * + * Get the identity property: The identity of the cluster manager. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the cluster manager. + * + * @param identity the identity value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ClusterManagerProperties innerProperties() { @@ -51,21 +93,55 @@ private ClusterManagerProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ClusterManagerInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClusterManagerInner withTags(Map tags) { super.withTags(tags); @@ -75,7 +151,7 @@ public ClusterManagerInner withTags(Map tags) { /** * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs * collection. - * + * * @return the analyticsWorkspaceId value. */ public String analyticsWorkspaceId() { @@ -85,7 +161,7 @@ public String analyticsWorkspaceId() { /** * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs * collection. - * + * * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. * @return the ClusterManagerInner object itself. */ @@ -101,7 +177,7 @@ public ClusterManagerInner withAnalyticsWorkspaceId(String analyticsWorkspaceId) * Get the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The Azure availability zones within the region that * will be used to support the cluster manager resource. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -112,7 +188,7 @@ public List availabilityZones() { * Set the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The Azure availability zones within the region that * will be used to support the cluster manager resource. - * + * * @param availabilityZones the availabilityZones value to set. * @return the ClusterManagerInner object itself. */ @@ -127,7 +203,7 @@ public ClusterManagerInner withAvailabilityZones(List availabilityZones) /** * Get the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in * clusterVersion property of a cluster resource. - * + * * @return the clusterVersions value. */ public List clusterVersions() { @@ -137,7 +213,7 @@ public List clusterVersions() { /** * Get the detailedStatus property: The detailed status that provides additional information about the cluster * manager. - * + * * @return the detailedStatus value. */ public ClusterManagerDetailedStatus detailedStatus() { @@ -146,7 +222,7 @@ public ClusterManagerDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -156,7 +232,7 @@ public String detailedStatusMessage() { /** * Get the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with * the cluster manager. - * + * * @return the fabricControllerId value. */ public String fabricControllerId() { @@ -166,7 +242,7 @@ public String fabricControllerId() { /** * Set the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with * the cluster manager. - * + * * @param fabricControllerId the fabricControllerId value to set. * @return the ClusterManagerInner object itself. */ @@ -179,11 +255,9 @@ public ClusterManagerInner withFabricControllerId(String fabricControllerId) { } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -191,11 +265,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the ClusterManagerInner object itself. */ @@ -209,12 +281,10 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Get the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster manager's control plane location. This - * extended location is used when creating cluster and rack manifest resources. - * + * Get the managerExtendedLocation property: The extended location (custom location) that represents the cluster + * manager's control plane location. This extended location is used when creating cluster and rack manifest + * resources. + * * @return the managerExtendedLocation value. */ public ExtendedLocation managerExtendedLocation() { @@ -223,7 +293,7 @@ public ExtendedLocation managerExtendedLocation() { /** * Get the provisioningState property: The provisioning state of the cluster manager. - * + * * @return the provisioningState value. */ public ClusterManagerProvisioningState provisioningState() { @@ -234,7 +304,7 @@ public ClusterManagerProvisioningState provisioningState() { * Get the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the * cluster manager resource. - * + * * @return the vmSize value. */ public String vmSize() { @@ -245,7 +315,7 @@ public String vmSize() { * Set the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the * cluster manager resource. - * + * * @param vmSize the vmSize value to set. * @return the ClusterManagerInner object itself. */ @@ -259,17 +329,76 @@ public ClusterManagerInner withVmSize(String vmSize) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ClusterManagerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ClusterManagerInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterManagerInner.class); + + /** + * {@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.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterManagerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterManagerInner 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 ClusterManagerInner. + */ + public static ClusterManagerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterManagerInner deserializedClusterManagerInner = new ClusterManagerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterManagerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterManagerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterManagerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterManagerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterManagerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedClusterManagerInner.innerProperties = ClusterManagerProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedClusterManagerInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterManagerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterManagerInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java index 7fa165e81eebd..0313cbbdf6037 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java @@ -6,21 +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.networkcloud.models.ClusterAvailableVersion; import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ClusterManagerProperties represents the properties of a cluster manager. */ +/** + * ClusterManagerProperties represents the properties of a cluster manager. + */ @Fluent -public final class ClusterManagerProperties { +public final class ClusterManagerProperties implements JsonSerializable { /* * The resource ID of the Log Analytics workspace that is used for the logs collection. */ - @JsonProperty(value = "analyticsWorkspaceId") private String analyticsWorkspaceId; /* @@ -28,72 +33,61 @@ public final class ClusterManagerProperties { * in a future version. The Azure availability zones within the region that will be used to support the cluster * manager resource. */ - @JsonProperty(value = "availabilityZones") private List availabilityZones; /* * The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a * cluster resource. */ - @JsonProperty(value = "clusterVersions", access = JsonProperty.Access.WRITE_ONLY) private List clusterVersions; /* * The detailed status that provides additional information about the cluster manager. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private ClusterManagerDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The resource ID of the fabric controller that has one to one mapping with the cluster manager. */ - @JsonProperty(value = "fabricControllerId", required = true) private String fabricControllerId; /* - * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. - * * The configuration of the managed resource group associated with the resource. */ - @JsonProperty(value = "managedResourceGroupConfiguration") private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location (custom location) that represents the cluster manager's control plane location. This * extended location is used when creating cluster and rack manifest resources. */ - @JsonProperty(value = "managerExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) private ExtendedLocation managerExtendedLocation; /* * The provisioning state of the cluster manager. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ClusterManagerProvisioningState provisioningState; /* * Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed * in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. */ - @JsonProperty(value = "vmSize") private String vmSize; - /** Creates an instance of ClusterManagerProperties class. */ + /** + * Creates an instance of ClusterManagerProperties class. + */ public ClusterManagerProperties() { } /** * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs * collection. - * + * * @return the analyticsWorkspaceId value. */ public String analyticsWorkspaceId() { @@ -103,7 +97,7 @@ public String analyticsWorkspaceId() { /** * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs * collection. - * + * * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. * @return the ClusterManagerProperties object itself. */ @@ -116,7 +110,7 @@ public ClusterManagerProperties withAnalyticsWorkspaceId(String analyticsWorkspa * Get the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The Azure availability zones within the region that * will be used to support the cluster manager resource. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -127,7 +121,7 @@ public List availabilityZones() { * Set the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The Azure availability zones within the region that * will be used to support the cluster manager resource. - * + * * @param availabilityZones the availabilityZones value to set. * @return the ClusterManagerProperties object itself. */ @@ -139,7 +133,7 @@ public ClusterManagerProperties withAvailabilityZones(List availabilityZ /** * Get the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in * clusterVersion property of a cluster resource. - * + * * @return the clusterVersions value. */ public List clusterVersions() { @@ -149,7 +143,7 @@ public List clusterVersions() { /** * Get the detailedStatus property: The detailed status that provides additional information about the cluster * manager. - * + * * @return the detailedStatus value. */ public ClusterManagerDetailedStatus detailedStatus() { @@ -158,7 +152,7 @@ public ClusterManagerDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -168,7 +162,7 @@ public String detailedStatusMessage() { /** * Get the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with * the cluster manager. - * + * * @return the fabricControllerId value. */ public String fabricControllerId() { @@ -178,7 +172,7 @@ public String fabricControllerId() { /** * Set the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with * the cluster manager. - * + * * @param fabricControllerId the fabricControllerId value to set. * @return the ClusterManagerProperties object itself. */ @@ -188,11 +182,9 @@ public ClusterManagerProperties withFabricControllerId(String fabricControllerId } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -200,11 +192,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the ClusterManagerProperties object itself. */ @@ -215,12 +205,10 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Get the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster manager's control plane location. This - * extended location is used when creating cluster and rack manifest resources. - * + * Get the managerExtendedLocation property: The extended location (custom location) that represents the cluster + * manager's control plane location. This extended location is used when creating cluster and rack manifest + * resources. + * * @return the managerExtendedLocation value. */ public ExtendedLocation managerExtendedLocation() { @@ -229,7 +217,7 @@ public ExtendedLocation managerExtendedLocation() { /** * Get the provisioningState property: The provisioning state of the cluster manager. - * + * * @return the provisioningState value. */ public ClusterManagerProvisioningState provisioningState() { @@ -240,7 +228,7 @@ public ClusterManagerProvisioningState provisioningState() { * Get the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the * cluster manager resource. - * + * * @return the vmSize value. */ public String vmSize() { @@ -251,7 +239,7 @@ public String vmSize() { * Set the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the * cluster manager resource. - * + * * @param vmSize the vmSize value to set. * @return the ClusterManagerProperties object itself. */ @@ -262,7 +250,7 @@ public ClusterManagerProperties withVmSize(String vmSize) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -270,8 +258,9 @@ public void validate() { clusterVersions().forEach(e -> e.validate()); } if (fabricControllerId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property fabricControllerId in model ClusterManagerProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fabricControllerId in model ClusterManagerProperties")); } if (managedResourceGroupConfiguration() != null) { managedResourceGroupConfiguration().validate(); @@ -282,4 +271,70 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ClusterManagerProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fabricControllerId", this.fabricControllerId); + jsonWriter.writeStringField("analyticsWorkspaceId", this.analyticsWorkspaceId); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + jsonWriter.writeStringField("vmSize", this.vmSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterManagerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterManagerProperties 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 ClusterManagerProperties. + */ + public static ClusterManagerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterManagerProperties deserializedClusterManagerProperties = new ClusterManagerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fabricControllerId".equals(fieldName)) { + deserializedClusterManagerProperties.fabricControllerId = reader.getString(); + } else if ("analyticsWorkspaceId".equals(fieldName)) { + deserializedClusterManagerProperties.analyticsWorkspaceId = reader.getString(); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterManagerProperties.availabilityZones = availabilityZones; + } else if ("clusterVersions".equals(fieldName)) { + List clusterVersions + = reader.readArray(reader1 -> ClusterAvailableVersion.fromJson(reader1)); + deserializedClusterManagerProperties.clusterVersions = clusterVersions; + } else if ("detailedStatus".equals(fieldName)) { + deserializedClusterManagerProperties.detailedStatus + = ClusterManagerDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedClusterManagerProperties.detailedStatusMessage = reader.getString(); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedClusterManagerProperties.managedResourceGroupConfiguration + = ManagedResourceGroupConfiguration.fromJson(reader); + } else if ("managerExtendedLocation".equals(fieldName)) { + deserializedClusterManagerProperties.managerExtendedLocation = ExtendedLocation.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterManagerProperties.provisioningState + = ClusterManagerProvisioningState.fromString(reader.getString()); + } else if ("vmSize".equals(fieldName)) { + deserializedClusterManagerProperties.vmSize = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterManagerProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java index 3f6702e7c8d2d..a718b36814813 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java @@ -8,48 +8,60 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ClusterMetricsConfigurationDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. */ +/** + * ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ @Fluent public final class ClusterMetricsConfigurationInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private ClusterMetricsConfigurationProperties innerProperties = new ClusterMetricsConfigurationProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ClusterMetricsConfigurationInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ClusterMetricsConfigurationInner class. + */ public ClusterMetricsConfigurationInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -57,11 +69,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the ClusterMetricsConfigurationInner object itself. */ @@ -71,11 +80,8 @@ public ClusterMetricsConfigurationInner withExtendedLocation(ExtendedLocation ex } /** - * Get the innerProperties property: ClusterMetricsConfigurationProperties represents the properties of metrics - * configuration for the cluster. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ClusterMetricsConfigurationProperties innerProperties() { @@ -84,21 +90,55 @@ private ClusterMetricsConfigurationProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ClusterMetricsConfigurationInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClusterMetricsConfigurationInner withTags(Map tags) { super.withTags(tags); @@ -107,7 +147,7 @@ public ClusterMetricsConfigurationInner withTags(Map tags) { /** * Get the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @return the collectionInterval value. */ public long collectionInterval() { @@ -116,7 +156,7 @@ public long collectionInterval() { /** * Set the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @param collectionInterval the collectionInterval value to set. * @return the ClusterMetricsConfigurationInner object itself. */ @@ -130,7 +170,7 @@ public ClusterMetricsConfigurationInner withCollectionInterval(long collectionIn /** * Get the detailedStatus property: The more detailed status of the metrics configuration. - * + * * @return the detailedStatus value. */ public ClusterMetricsConfigurationDetailedStatus detailedStatus() { @@ -139,7 +179,7 @@ public ClusterMetricsConfigurationDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -149,7 +189,7 @@ public String detailedStatusMessage() { /** * Get the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the * moment. - * + * * @return the disabledMetrics value. */ public List disabledMetrics() { @@ -159,7 +199,7 @@ public List disabledMetrics() { /** * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @return the enabledMetrics value. */ public List enabledMetrics() { @@ -169,7 +209,7 @@ public List enabledMetrics() { /** * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @param enabledMetrics the enabledMetrics value to set. * @return the ClusterMetricsConfigurationInner object itself. */ @@ -183,7 +223,7 @@ public ClusterMetricsConfigurationInner withEnabledMetrics(List enabledM /** * Get the provisioningState property: The provisioning state of the metrics configuration. - * + * * @return the provisioningState value. */ public ClusterMetricsConfigurationProvisioningState provisioningState() { @@ -192,23 +232,82 @@ public ClusterMetricsConfigurationProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model ClusterMetricsConfigurationInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model ClusterMetricsConfigurationInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model ClusterMetricsConfigurationInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ClusterMetricsConfigurationInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterMetricsConfigurationInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMetricsConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMetricsConfigurationInner 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 ClusterMetricsConfigurationInner. + */ + public static ClusterMetricsConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMetricsConfigurationInner deserializedClusterMetricsConfigurationInner + = new ClusterMetricsConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterMetricsConfigurationInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.innerProperties + = ClusterMetricsConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterMetricsConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMetricsConfigurationInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java index 1c976e2ae0bc1..c689e834a672a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.networkcloud.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; import java.util.List; /** @@ -13,26 +17,27 @@ * patching. */ @Fluent -public final class ClusterMetricsConfigurationPatchProperties { +public final class ClusterMetricsConfigurationPatchProperties + implements JsonSerializable { /* * The interval in minutes by which metrics will be collected. */ - @JsonProperty(value = "collectionInterval") private Long collectionInterval; /* * The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. */ - @JsonProperty(value = "enabledMetrics") private List enabledMetrics; - /** Creates an instance of ClusterMetricsConfigurationPatchProperties class. */ + /** + * Creates an instance of ClusterMetricsConfigurationPatchProperties class. + */ public ClusterMetricsConfigurationPatchProperties() { } /** * Get the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @return the collectionInterval value. */ public Long collectionInterval() { @@ -41,7 +46,7 @@ public Long collectionInterval() { /** * Set the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @param collectionInterval the collectionInterval value to set. * @return the ClusterMetricsConfigurationPatchProperties object itself. */ @@ -53,7 +58,7 @@ public ClusterMetricsConfigurationPatchProperties withCollectionInterval(Long co /** * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @return the enabledMetrics value. */ public List enabledMetrics() { @@ -63,7 +68,7 @@ public List enabledMetrics() { /** * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @param enabledMetrics the enabledMetrics value to set. * @return the ClusterMetricsConfigurationPatchProperties object itself. */ @@ -74,9 +79,52 @@ public ClusterMetricsConfigurationPatchProperties withEnabledMetrics(List writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMetricsConfigurationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMetricsConfigurationPatchProperties 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 ClusterMetricsConfigurationPatchProperties. + */ + public static ClusterMetricsConfigurationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMetricsConfigurationPatchProperties deserializedClusterMetricsConfigurationPatchProperties + = new ClusterMetricsConfigurationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionInterval".equals(fieldName)) { + deserializedClusterMetricsConfigurationPatchProperties.collectionInterval + = reader.getNullable(JsonReader::getLong); + } else if ("enabledMetrics".equals(fieldName)) { + List enabledMetrics = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterMetricsConfigurationPatchProperties.enabledMetrics = enabledMetrics; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMetricsConfigurationPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java index f818eb325dce0..5715b9ad2c151 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java @@ -5,57 +5,60 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.ClusterMetricsConfigurationDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. */ +/** + * ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + */ @Fluent -public final class ClusterMetricsConfigurationProperties { +public final class ClusterMetricsConfigurationProperties + implements JsonSerializable { /* * The interval in minutes by which metrics will be collected. */ - @JsonProperty(value = "collectionInterval", required = true) private long collectionInterval; /* * The more detailed status of the metrics configuration. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private ClusterMetricsConfigurationDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The list of metrics that are available for the cluster but disabled at the moment. */ - @JsonProperty(value = "disabledMetrics", access = JsonProperty.Access.WRITE_ONLY) private List disabledMetrics; /* * The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. */ - @JsonProperty(value = "enabledMetrics") private List enabledMetrics; /* * The provisioning state of the metrics configuration. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ClusterMetricsConfigurationProvisioningState provisioningState; - /** Creates an instance of ClusterMetricsConfigurationProperties class. */ + /** + * Creates an instance of ClusterMetricsConfigurationProperties class. + */ public ClusterMetricsConfigurationProperties() { } /** * Get the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @return the collectionInterval value. */ public long collectionInterval() { @@ -64,7 +67,7 @@ public long collectionInterval() { /** * Set the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @param collectionInterval the collectionInterval value to set. * @return the ClusterMetricsConfigurationProperties object itself. */ @@ -75,7 +78,7 @@ public ClusterMetricsConfigurationProperties withCollectionInterval(long collect /** * Get the detailedStatus property: The more detailed status of the metrics configuration. - * + * * @return the detailedStatus value. */ public ClusterMetricsConfigurationDetailedStatus detailedStatus() { @@ -84,7 +87,7 @@ public ClusterMetricsConfigurationDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -94,7 +97,7 @@ public String detailedStatusMessage() { /** * Get the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the * moment. - * + * * @return the disabledMetrics value. */ public List disabledMetrics() { @@ -104,7 +107,7 @@ public List disabledMetrics() { /** * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @return the enabledMetrics value. */ public List enabledMetrics() { @@ -114,7 +117,7 @@ public List enabledMetrics() { /** * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @param enabledMetrics the enabledMetrics value to set. * @return the ClusterMetricsConfigurationProperties object itself. */ @@ -125,7 +128,7 @@ public ClusterMetricsConfigurationProperties withEnabledMetrics(List ena /** * Get the provisioningState property: The provisioning state of the metrics configuration. - * + * * @return the provisioningState value. */ public ClusterMetricsConfigurationProvisioningState provisioningState() { @@ -134,9 +137,63 @@ public ClusterMetricsConfigurationProvisioningState provisioningState() { /** * 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.writeLongField("collectionInterval", this.collectionInterval); + jsonWriter.writeArrayField("enabledMetrics", this.enabledMetrics, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMetricsConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMetricsConfigurationProperties 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 ClusterMetricsConfigurationProperties. + */ + public static ClusterMetricsConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMetricsConfigurationProperties deserializedClusterMetricsConfigurationProperties + = new ClusterMetricsConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionInterval".equals(fieldName)) { + deserializedClusterMetricsConfigurationProperties.collectionInterval = reader.getLong(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedClusterMetricsConfigurationProperties.detailedStatus + = ClusterMetricsConfigurationDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedClusterMetricsConfigurationProperties.detailedStatusMessage = reader.getString(); + } else if ("disabledMetrics".equals(fieldName)) { + List disabledMetrics = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterMetricsConfigurationProperties.disabledMetrics = disabledMetrics; + } else if ("enabledMetrics".equals(fieldName)) { + List enabledMetrics = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterMetricsConfigurationProperties.enabledMetrics = enabledMetrics; + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterMetricsConfigurationProperties.provisioningState + = ClusterMetricsConfigurationProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMetricsConfigurationProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java index e66da7904ef87..57b3e15101590 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java @@ -5,65 +5,102 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.AnalyticsOutputSettings; +import com.azure.resourcemanager.networkcloud.models.ClusterSecretArchive; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsPatch; +import java.io.IOException; import java.util.List; -/** ClusterPatchProperties represents the properties of the cluster for patching. */ +/** + * ClusterPatchProperties represents the properties of the cluster for patching. + */ @Fluent -public final class ClusterPatchProperties { +public final class ClusterPatchProperties implements JsonSerializable { /* - * RackDefinition represents details regarding the rack. - * * The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator * rack in a multi-rack cluster. */ - @JsonProperty(value = "aggregatorOrSingleRackDefinition") private RackDefinition aggregatorOrSingleRackDefinition; + /* + * The settings for the log analytics workspace used for output of logs from this cluster. + */ + private AnalyticsOutputSettings analyticsOutputSettings; + /* * The customer-provided location information to identify where the cluster resides. */ - @JsonProperty(value = "clusterLocation") private String clusterLocation; /* - * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc - * Appliance installation. - * * The service principal to be used by the cluster during Arc Appliance installation. */ - @JsonProperty(value = "clusterServicePrincipal") private ServicePrincipalInformation clusterServicePrincipal; /* - * ValidationThreshold indicates allowed machine and node hardware and deployment failures. - * + * The settings for commands run in this cluster, such as bare metal machine run read only commands and data + * extracts. + */ + private CommandOutputSettings commandOutputSettings; + + /* * The validation threshold indicating the allowable failures of compute machines during environment validation and * deployment. */ - @JsonProperty(value = "computeDeploymentThreshold") private ValidationThreshold computeDeploymentThreshold; /* * The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. */ - @JsonProperty(value = "computeRackDefinitions") private List computeRackDefinitions; - /** Creates an instance of ClusterPatchProperties class. */ + /* + * The settings for cluster runtime protection. + */ + private RuntimeProtectionConfiguration runtimeProtectionConfiguration; + + /* + * The configuration for use of a key vault to store secrets for later retrieval by the operator. + */ + private ClusterSecretArchive secretArchive; + + /* + * The settings for the secret archive used to hold credentials for the cluster. + */ + private SecretArchiveSettings secretArchiveSettings; + + /* + * The strategy for updating the cluster. + */ + private ClusterUpdateStrategy updateStrategy; + + /* + * The settings for how security vulnerability scanning is applied to the cluster. + */ + private VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings; + + /** + * Creates an instance of ClusterPatchProperties class. + */ public ClusterPatchProperties() { } /** - * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Get the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @return the aggregatorOrSingleRackDefinition value. */ public RackDefinition aggregatorOrSingleRackDefinition() { @@ -71,11 +108,9 @@ public RackDefinition aggregatorOrSingleRackDefinition() { } /** - * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Set the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. * @return the ClusterPatchProperties object itself. */ @@ -85,10 +120,32 @@ public RackDefinition aggregatorOrSingleRackDefinition() { return this; } + /** + * Get the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @return the analyticsOutputSettings value. + */ + public AnalyticsOutputSettings analyticsOutputSettings() { + return this.analyticsOutputSettings; + } + + /** + * Set the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @param analyticsOutputSettings the analyticsOutputSettings value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings) { + this.analyticsOutputSettings = analyticsOutputSettings; + return this; + } + /** * Get the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @return the clusterLocation value. */ public String clusterLocation() { @@ -98,7 +155,7 @@ public String clusterLocation() { /** * Set the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @param clusterLocation the clusterLocation value to set. * @return the ClusterPatchProperties object itself. */ @@ -108,11 +165,9 @@ public ClusterPatchProperties withClusterLocation(String clusterLocation) { } /** - * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Get the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @return the clusterServicePrincipal value. */ public ServicePrincipalInformation clusterServicePrincipal() { @@ -120,11 +175,9 @@ public ServicePrincipalInformation clusterServicePrincipal() { } /** - * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Set the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @param clusterServicePrincipal the clusterServicePrincipal value to set. * @return the ClusterPatchProperties object itself. */ @@ -134,12 +187,31 @@ public ClusterPatchProperties withClusterServicePrincipal(ServicePrincipalInform } /** - * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Get the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @return the commandOutputSettings value. + */ + public CommandOutputSettings commandOutputSettings() { + return this.commandOutputSettings; + } + + /** + * Set the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @param commandOutputSettings the commandOutputSettings value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withCommandOutputSettings(CommandOutputSettings commandOutputSettings) { + this.commandOutputSettings = commandOutputSettings; + return this; + } + + /** + * Get the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @return the computeDeploymentThreshold value. */ public ValidationThreshold computeDeploymentThreshold() { @@ -147,12 +219,9 @@ public ValidationThreshold computeDeploymentThreshold() { } /** - * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Set the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. * @return the ClusterPatchProperties object itself. */ @@ -164,7 +233,7 @@ public ClusterPatchProperties withComputeDeploymentThreshold(ValidationThreshold /** * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @return the computeRackDefinitions value. */ public List computeRackDefinitions() { @@ -174,7 +243,7 @@ public List computeRackDefinitions() { /** * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @param computeRackDefinitions the computeRackDefinitions value to set. * @return the ClusterPatchProperties object itself. */ @@ -183,23 +252,230 @@ public ClusterPatchProperties withComputeRackDefinitions(List co return this; } + /** + * Get the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @return the runtimeProtectionConfiguration value. + */ + public RuntimeProtectionConfiguration runtimeProtectionConfiguration() { + return this.runtimeProtectionConfiguration; + } + + /** + * Set the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @param runtimeProtectionConfiguration the runtimeProtectionConfiguration value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration) { + this.runtimeProtectionConfiguration = runtimeProtectionConfiguration; + return this; + } + + /** + * Get the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @return the secretArchive value. + */ + public ClusterSecretArchive secretArchive() { + return this.secretArchive; + } + + /** + * Set the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @param secretArchive the secretArchive value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withSecretArchive(ClusterSecretArchive secretArchive) { + this.secretArchive = secretArchive; + return this; + } + + /** + * Get the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @return the secretArchiveSettings value. + */ + public SecretArchiveSettings secretArchiveSettings() { + return this.secretArchiveSettings; + } + + /** + * Set the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @param secretArchiveSettings the secretArchiveSettings value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings) { + this.secretArchiveSettings = secretArchiveSettings; + return this; + } + + /** + * Get the updateStrategy property: The strategy for updating the cluster. + * + * @return the updateStrategy value. + */ + public ClusterUpdateStrategy updateStrategy() { + return this.updateStrategy; + } + + /** + * Set the updateStrategy property: The strategy for updating the cluster. + * + * @param updateStrategy the updateStrategy value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withUpdateStrategy(ClusterUpdateStrategy updateStrategy) { + this.updateStrategy = updateStrategy; + return this; + } + + /** + * Get the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @return the vulnerabilityScanningSettings value. + */ + public VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings() { + return this.vulnerabilityScanningSettings; + } + + /** + * Set the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @param vulnerabilityScanningSettings the vulnerabilityScanningSettings value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties + withVulnerabilityScanningSettings(VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings) { + this.vulnerabilityScanningSettings = vulnerabilityScanningSettings; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (aggregatorOrSingleRackDefinition() != null) { aggregatorOrSingleRackDefinition().validate(); } + if (analyticsOutputSettings() != null) { + analyticsOutputSettings().validate(); + } if (clusterServicePrincipal() != null) { clusterServicePrincipal().validate(); } + if (commandOutputSettings() != null) { + commandOutputSettings().validate(); + } if (computeDeploymentThreshold() != null) { computeDeploymentThreshold().validate(); } if (computeRackDefinitions() != null) { computeRackDefinitions().forEach(e -> e.validate()); } + if (runtimeProtectionConfiguration() != null) { + runtimeProtectionConfiguration().validate(); + } + if (secretArchive() != null) { + secretArchive().validate(); + } + if (secretArchiveSettings() != null) { + secretArchiveSettings().validate(); + } + if (updateStrategy() != null) { + updateStrategy().validate(); + } + if (vulnerabilityScanningSettings() != null) { + vulnerabilityScanningSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("aggregatorOrSingleRackDefinition", this.aggregatorOrSingleRackDefinition); + jsonWriter.writeJsonField("analyticsOutputSettings", this.analyticsOutputSettings); + jsonWriter.writeStringField("clusterLocation", this.clusterLocation); + jsonWriter.writeJsonField("clusterServicePrincipal", this.clusterServicePrincipal); + jsonWriter.writeJsonField("commandOutputSettings", this.commandOutputSettings); + jsonWriter.writeJsonField("computeDeploymentThreshold", this.computeDeploymentThreshold); + jsonWriter.writeArrayField("computeRackDefinitions", this.computeRackDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("runtimeProtectionConfiguration", this.runtimeProtectionConfiguration); + jsonWriter.writeJsonField("secretArchive", this.secretArchive); + jsonWriter.writeJsonField("secretArchiveSettings", this.secretArchiveSettings); + jsonWriter.writeJsonField("updateStrategy", this.updateStrategy); + jsonWriter.writeJsonField("vulnerabilityScanningSettings", this.vulnerabilityScanningSettings); + 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 ("aggregatorOrSingleRackDefinition".equals(fieldName)) { + deserializedClusterPatchProperties.aggregatorOrSingleRackDefinition + = RackDefinition.fromJson(reader); + } else if ("analyticsOutputSettings".equals(fieldName)) { + deserializedClusterPatchProperties.analyticsOutputSettings + = AnalyticsOutputSettings.fromJson(reader); + } else if ("clusterLocation".equals(fieldName)) { + deserializedClusterPatchProperties.clusterLocation = reader.getString(); + } else if ("clusterServicePrincipal".equals(fieldName)) { + deserializedClusterPatchProperties.clusterServicePrincipal + = ServicePrincipalInformation.fromJson(reader); + } else if ("commandOutputSettings".equals(fieldName)) { + deserializedClusterPatchProperties.commandOutputSettings = CommandOutputSettings.fromJson(reader); + } else if ("computeDeploymentThreshold".equals(fieldName)) { + deserializedClusterPatchProperties.computeDeploymentThreshold + = ValidationThreshold.fromJson(reader); + } else if ("computeRackDefinitions".equals(fieldName)) { + List computeRackDefinitions + = reader.readArray(reader1 -> RackDefinition.fromJson(reader1)); + deserializedClusterPatchProperties.computeRackDefinitions = computeRackDefinitions; + } else if ("runtimeProtectionConfiguration".equals(fieldName)) { + deserializedClusterPatchProperties.runtimeProtectionConfiguration + = RuntimeProtectionConfiguration.fromJson(reader); + } else if ("secretArchive".equals(fieldName)) { + deserializedClusterPatchProperties.secretArchive = ClusterSecretArchive.fromJson(reader); + } else if ("secretArchiveSettings".equals(fieldName)) { + deserializedClusterPatchProperties.secretArchiveSettings = SecretArchiveSettings.fromJson(reader); + } else if ("updateStrategy".equals(fieldName)) { + deserializedClusterPatchProperties.updateStrategy = ClusterUpdateStrategy.fromJson(reader); + } else if ("vulnerabilityScanningSettings".equals(fieldName)) { + deserializedClusterPatchProperties.vulnerabilityScanningSettings + = VulnerabilityScanningSettingsPatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchProperties; + }); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java index 819c15cf8cd26..3e8bbc08eb398 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java @@ -6,195 +6,205 @@ 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.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterSecretArchive; import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettings; +import java.io.IOException; import java.util.List; -/** ClusterProperties represents the properties of a cluster. */ +/** + * ClusterProperties represents the properties of a cluster. + */ @Fluent -public final class ClusterProperties { +public final class ClusterProperties implements JsonSerializable { /* - * RackDefinition represents details regarding the rack. - * * The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator * rack in a multi-rack cluster. */ - @JsonProperty(value = "aggregatorOrSingleRackDefinition", required = true) private RackDefinition aggregatorOrSingleRackDefinition; /* - * The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + * The settings for the log analytics workspace used for output of logs from this cluster. + */ + private AnalyticsOutputSettings analyticsOutputSettings; + + /* + * Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. */ - @JsonProperty(value = "analyticsWorkspaceId") private String analyticsWorkspaceId; /* * The list of cluster runtime version upgrades available for this cluster. */ - @JsonProperty(value = "availableUpgradeVersions", access = JsonProperty.Access.WRITE_ONLY) private List availableUpgradeVersions; /* - * ClusterCapacity represents various details regarding compute capacity. - * * The capacity supported by this cluster. */ - @JsonProperty(value = "clusterCapacity", access = JsonProperty.Access.WRITE_ONLY) private ClusterCapacity clusterCapacity; /* * The latest heartbeat status between the cluster manager and the cluster. */ - @JsonProperty(value = "clusterConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) private ClusterConnectionStatus clusterConnectionStatus; /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location (custom location) that represents the cluster's control plane location. This extended - * location is used to route the requests of child objects of the cluster that are handled by the platform - * operator. + * location is used to route the requests of child objects of the cluster that are handled by the platform operator. */ - @JsonProperty(value = "clusterExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) private ExtendedLocation clusterExtendedLocation; /* * The customer-provided location information to identify where the cluster resides. */ - @JsonProperty(value = "clusterLocation") private String clusterLocation; /* * The latest connectivity status between cluster manager and the cluster. */ - @JsonProperty(value = "clusterManagerConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) private ClusterManagerConnectionStatus clusterManagerConnectionStatus; /* * The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the * cluster is created. */ - @JsonProperty(value = "clusterManagerId", access = JsonProperty.Access.WRITE_ONLY) private String clusterManagerId; /* - * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc - * Appliance installation. - * * The service principal to be used by the cluster during Arc Appliance installation. */ - @JsonProperty(value = "clusterServicePrincipal") private ServicePrincipalInformation clusterServicePrincipal; /* * The type of rack configuration for the cluster. */ - @JsonProperty(value = "clusterType", required = true) private ClusterType clusterType; /* * The current runtime version of the cluster. */ - @JsonProperty(value = "clusterVersion", required = true) private String clusterVersion; /* - * ValidationThreshold indicates allowed machine and node hardware and deployment failures. - * + * The settings for commands run in this cluster, such as bare metal machine run read only commands and data + * extracts. + */ + private CommandOutputSettings commandOutputSettings; + + /* * The validation threshold indicating the allowable failures of compute machines during environment validation and * deployment. */ - @JsonProperty(value = "computeDeploymentThreshold") private ValidationThreshold computeDeploymentThreshold; /* * The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. */ - @JsonProperty(value = "computeRackDefinitions") private List computeRackDefinitions; /* * The current detailed status of the cluster. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private ClusterDetailedStatus detailedStatus; /* * The descriptive message about the detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom * location) that represents the Hybrid AKS control plane location. This extended location is used when creating * provisioned clusters (Hybrid AKS clusters). */ - @JsonProperty(value = "hybridAksExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) private ExtendedLocation hybridAksExtendedLocation; /* - * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. - * * The configuration of the managed resource group associated with the resource. */ - @JsonProperty(value = "managedResourceGroupConfiguration") private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; /* * The count of Manual Action Taken (MAT) events that have not been validated. */ - @JsonProperty(value = "manualActionCount", access = JsonProperty.Access.WRITE_ONLY) private Long manualActionCount; /* * The resource ID of the Network Fabric associated with the cluster. */ - @JsonProperty(value = "networkFabricId", required = true) private String networkFabricId; /* * The provisioning state of the cluster. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ClusterProvisioningState provisioningState; + /* + * The settings for cluster runtime protection. + */ + private RuntimeProtectionConfiguration runtimeProtectionConfiguration; + + /* + * The configuration for use of a key vault to store secrets for later retrieval by the operator. + */ + private ClusterSecretArchive secretArchive; + + /* + * The settings for the secret archive used to hold credentials for the cluster. + */ + private SecretArchiveSettings secretArchiveSettings; + /* * The support end date of the runtime version of the cluster. */ - @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) private String supportExpiryDate; + /* + * The strategy for updating the cluster. + */ + private ClusterUpdateStrategy updateStrategy; + + /* + * The settings for how security vulnerability scanning is applied to the cluster. + */ + private VulnerabilityScanningSettings vulnerabilityScanningSettings; + /* * The list of workload resource IDs that are hosted within this cluster. */ - @JsonProperty(value = "workloadResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List workloadResourceIds; - /** Creates an instance of ClusterProperties class. */ + /** + * Creates an instance of ClusterProperties class. + */ public ClusterProperties() { } /** - * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Get the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @return the aggregatorOrSingleRackDefinition value. */ public RackDefinition aggregatorOrSingleRackDefinition() { @@ -202,11 +212,9 @@ public RackDefinition aggregatorOrSingleRackDefinition() { } /** - * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Set the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. * @return the ClusterProperties object itself. */ @@ -216,9 +224,31 @@ public ClusterProperties withAggregatorOrSingleRackDefinition(RackDefinition agg } /** - * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for - * storing relevant logs. - * + * Get the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @return the analyticsOutputSettings value. + */ + public AnalyticsOutputSettings analyticsOutputSettings() { + return this.analyticsOutputSettings; + } + + /** + * Set the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @param analyticsOutputSettings the analyticsOutputSettings value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings) { + this.analyticsOutputSettings = analyticsOutputSettings; + return this; + } + + /** + * Get the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics Workspace that will + * be used for storing relevant logs. + * * @return the analyticsWorkspaceId value. */ public String analyticsWorkspaceId() { @@ -226,9 +256,9 @@ public String analyticsWorkspaceId() { } /** - * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for - * storing relevant logs. - * + * Set the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics Workspace that will + * be used for storing relevant logs. + * * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. * @return the ClusterProperties object itself. */ @@ -240,7 +270,7 @@ public ClusterProperties withAnalyticsWorkspaceId(String analyticsWorkspaceId) { /** * Get the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this * cluster. - * + * * @return the availableUpgradeVersions value. */ public List availableUpgradeVersions() { @@ -248,10 +278,8 @@ public List availableUpgradeVersions() { } /** - * Get the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. - * - *

The capacity supported by this cluster. - * + * Get the clusterCapacity property: The capacity supported by this cluster. + * * @return the clusterCapacity value. */ public ClusterCapacity clusterCapacity() { @@ -261,7 +289,7 @@ public ClusterCapacity clusterCapacity() { /** * Get the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the * cluster. - * + * * @return the clusterConnectionStatus value. */ public ClusterConnectionStatus clusterConnectionStatus() { @@ -269,12 +297,10 @@ public ClusterConnectionStatus clusterConnectionStatus() { } /** - * Get the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster's control plane location. This extended - * location is used to route the requests of child objects of the cluster that are handled by the platform operator. - * + * Get the clusterExtendedLocation property: The extended location (custom location) that represents the cluster's + * control plane location. This extended location is used to route the requests of child objects of the cluster that + * are handled by the platform operator. + * * @return the clusterExtendedLocation value. */ public ExtendedLocation clusterExtendedLocation() { @@ -284,7 +310,7 @@ public ExtendedLocation clusterExtendedLocation() { /** * Get the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @return the clusterLocation value. */ public String clusterLocation() { @@ -294,7 +320,7 @@ public String clusterLocation() { /** * Set the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @param clusterLocation the clusterLocation value to set. * @return the ClusterProperties object itself. */ @@ -306,7 +332,7 @@ public ClusterProperties withClusterLocation(String clusterLocation) { /** * Get the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the * cluster. - * + * * @return the clusterManagerConnectionStatus value. */ public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { @@ -316,7 +342,7 @@ public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { /** * Get the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set * by the Cluster Manager when the cluster is created. - * + * * @return the clusterManagerId value. */ public String clusterManagerId() { @@ -324,11 +350,9 @@ public String clusterManagerId() { } /** - * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Get the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @return the clusterServicePrincipal value. */ public ServicePrincipalInformation clusterServicePrincipal() { @@ -336,11 +360,9 @@ public ServicePrincipalInformation clusterServicePrincipal() { } /** - * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Set the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @param clusterServicePrincipal the clusterServicePrincipal value to set. * @return the ClusterProperties object itself. */ @@ -351,7 +373,7 @@ public ClusterProperties withClusterServicePrincipal(ServicePrincipalInformation /** * Get the clusterType property: The type of rack configuration for the cluster. - * + * * @return the clusterType value. */ public ClusterType clusterType() { @@ -360,7 +382,7 @@ public ClusterType clusterType() { /** * Set the clusterType property: The type of rack configuration for the cluster. - * + * * @param clusterType the clusterType value to set. * @return the ClusterProperties object itself. */ @@ -371,7 +393,7 @@ public ClusterProperties withClusterType(ClusterType clusterType) { /** * Get the clusterVersion property: The current runtime version of the cluster. - * + * * @return the clusterVersion value. */ public String clusterVersion() { @@ -380,7 +402,7 @@ public String clusterVersion() { /** * Set the clusterVersion property: The current runtime version of the cluster. - * + * * @param clusterVersion the clusterVersion value to set. * @return the ClusterProperties object itself. */ @@ -390,12 +412,31 @@ public ClusterProperties withClusterVersion(String clusterVersion) { } /** - * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Get the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @return the commandOutputSettings value. + */ + public CommandOutputSettings commandOutputSettings() { + return this.commandOutputSettings; + } + + /** + * Set the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @param commandOutputSettings the commandOutputSettings value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withCommandOutputSettings(CommandOutputSettings commandOutputSettings) { + this.commandOutputSettings = commandOutputSettings; + return this; + } + + /** + * Get the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @return the computeDeploymentThreshold value. */ public ValidationThreshold computeDeploymentThreshold() { @@ -403,12 +444,9 @@ public ValidationThreshold computeDeploymentThreshold() { } /** - * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Set the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. * @return the ClusterProperties object itself. */ @@ -420,7 +458,7 @@ public ClusterProperties withComputeDeploymentThreshold(ValidationThreshold comp /** * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @return the computeRackDefinitions value. */ public List computeRackDefinitions() { @@ -430,7 +468,7 @@ public List computeRackDefinitions() { /** * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @param computeRackDefinitions the computeRackDefinitions value to set. * @return the ClusterProperties object itself. */ @@ -441,7 +479,7 @@ public ClusterProperties withComputeRackDefinitions(List compute /** * Get the detailedStatus property: The current detailed status of the cluster. - * + * * @return the detailedStatus value. */ public ClusterDetailedStatus detailedStatus() { @@ -450,7 +488,7 @@ public ClusterDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -458,13 +496,10 @@ public String detailedStatusMessage() { } /** - * Get the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom - * location) that represents the Hybrid AKS control plane location. This extended location is used when creating - * provisioned clusters (Hybrid AKS clusters). - * + * Get the hybridAksExtendedLocation property: Field Deprecated. This field will not be populated in an upcoming + * version. The extended location (custom location) that represents the Hybrid AKS control plane location. This + * extended location is used when creating provisioned clusters (Hybrid AKS clusters). + * * @return the hybridAksExtendedLocation value. */ public ExtendedLocation hybridAksExtendedLocation() { @@ -472,11 +507,9 @@ public ExtendedLocation hybridAksExtendedLocation() { } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -484,11 +517,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the ClusterProperties object itself. */ @@ -500,7 +531,7 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { /** * Get the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. - * + * * @return the manualActionCount value. */ public Long manualActionCount() { @@ -509,7 +540,7 @@ public Long manualActionCount() { /** * Get the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. - * + * * @return the networkFabricId value. */ public String networkFabricId() { @@ -518,7 +549,7 @@ public String networkFabricId() { /** * Set the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. - * + * * @param networkFabricId the networkFabricId value to set. * @return the ClusterProperties object itself. */ @@ -529,25 +560,133 @@ public ClusterProperties withNetworkFabricId(String networkFabricId) { /** * Get the provisioningState property: The provisioning state of the cluster. - * + * * @return the provisioningState value. */ public ClusterProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @return the runtimeProtectionConfiguration value. + */ + public RuntimeProtectionConfiguration runtimeProtectionConfiguration() { + return this.runtimeProtectionConfiguration; + } + + /** + * Set the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @param runtimeProtectionConfiguration the runtimeProtectionConfiguration value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration) { + this.runtimeProtectionConfiguration = runtimeProtectionConfiguration; + return this; + } + + /** + * Get the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @return the secretArchive value. + */ + public ClusterSecretArchive secretArchive() { + return this.secretArchive; + } + + /** + * Set the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @param secretArchive the secretArchive value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withSecretArchive(ClusterSecretArchive secretArchive) { + this.secretArchive = secretArchive; + return this; + } + + /** + * Get the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @return the secretArchiveSettings value. + */ + public SecretArchiveSettings secretArchiveSettings() { + return this.secretArchiveSettings; + } + + /** + * Set the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @param secretArchiveSettings the secretArchiveSettings value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings) { + this.secretArchiveSettings = secretArchiveSettings; + return this; + } + /** * Get the supportExpiryDate property: The support end date of the runtime version of the cluster. - * + * * @return the supportExpiryDate value. */ public String supportExpiryDate() { return this.supportExpiryDate; } + /** + * Get the updateStrategy property: The strategy for updating the cluster. + * + * @return the updateStrategy value. + */ + public ClusterUpdateStrategy updateStrategy() { + return this.updateStrategy; + } + + /** + * Set the updateStrategy property: The strategy for updating the cluster. + * + * @param updateStrategy the updateStrategy value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withUpdateStrategy(ClusterUpdateStrategy updateStrategy) { + this.updateStrategy = updateStrategy; + return this; + } + + /** + * Get the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @return the vulnerabilityScanningSettings value. + */ + public VulnerabilityScanningSettings vulnerabilityScanningSettings() { + return this.vulnerabilityScanningSettings; + } + + /** + * Set the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @param vulnerabilityScanningSettings the vulnerabilityScanningSettings value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties + withVulnerabilityScanningSettings(VulnerabilityScanningSettings vulnerabilityScanningSettings) { + this.vulnerabilityScanningSettings = vulnerabilityScanningSettings; + return this; + } + /** * Get the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. - * + * * @return the workloadResourceIds value. */ public List workloadResourceIds() { @@ -556,16 +695,20 @@ public List workloadResourceIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (aggregatorOrSingleRackDefinition() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property aggregatorOrSingleRackDefinition in model ClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property aggregatorOrSingleRackDefinition in model ClusterProperties")); } else { aggregatorOrSingleRackDefinition().validate(); } + if (analyticsOutputSettings() != null) { + analyticsOutputSettings().validate(); + } if (availableUpgradeVersions() != null) { availableUpgradeVersions().forEach(e -> e.validate()); } @@ -579,12 +722,16 @@ public void validate() { clusterServicePrincipal().validate(); } if (clusterType() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property clusterType in model ClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clusterType in model ClusterProperties")); } if (clusterVersion() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property clusterVersion in model ClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clusterVersion in model ClusterProperties")); + } + if (commandOutputSettings() != null) { + commandOutputSettings().validate(); } if (computeDeploymentThreshold() != null) { computeDeploymentThreshold().validate(); @@ -599,10 +746,150 @@ public void validate() { managedResourceGroupConfiguration().validate(); } if (networkFabricId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property networkFabricId in model ClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkFabricId in model ClusterProperties")); + } + if (runtimeProtectionConfiguration() != null) { + runtimeProtectionConfiguration().validate(); + } + if (secretArchive() != null) { + secretArchive().validate(); + } + if (secretArchiveSettings() != null) { + secretArchiveSettings().validate(); + } + if (updateStrategy() != null) { + updateStrategy().validate(); + } + if (vulnerabilityScanningSettings() != null) { + vulnerabilityScanningSettings().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("aggregatorOrSingleRackDefinition", this.aggregatorOrSingleRackDefinition); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeStringField("clusterVersion", this.clusterVersion); + jsonWriter.writeStringField("networkFabricId", this.networkFabricId); + jsonWriter.writeJsonField("analyticsOutputSettings", this.analyticsOutputSettings); + jsonWriter.writeStringField("analyticsWorkspaceId", this.analyticsWorkspaceId); + jsonWriter.writeStringField("clusterLocation", this.clusterLocation); + jsonWriter.writeJsonField("clusterServicePrincipal", this.clusterServicePrincipal); + jsonWriter.writeJsonField("commandOutputSettings", this.commandOutputSettings); + jsonWriter.writeJsonField("computeDeploymentThreshold", this.computeDeploymentThreshold); + jsonWriter.writeArrayField("computeRackDefinitions", this.computeRackDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + jsonWriter.writeJsonField("runtimeProtectionConfiguration", this.runtimeProtectionConfiguration); + jsonWriter.writeJsonField("secretArchive", this.secretArchive); + jsonWriter.writeJsonField("secretArchiveSettings", this.secretArchiveSettings); + jsonWriter.writeJsonField("updateStrategy", this.updateStrategy); + jsonWriter.writeJsonField("vulnerabilityScanningSettings", this.vulnerabilityScanningSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterProperties 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 ClusterProperties. + */ + public static ClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterProperties deserializedClusterProperties = new ClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aggregatorOrSingleRackDefinition".equals(fieldName)) { + deserializedClusterProperties.aggregatorOrSingleRackDefinition = RackDefinition.fromJson(reader); + } else if ("clusterType".equals(fieldName)) { + deserializedClusterProperties.clusterType = ClusterType.fromString(reader.getString()); + } else if ("clusterVersion".equals(fieldName)) { + deserializedClusterProperties.clusterVersion = reader.getString(); + } else if ("networkFabricId".equals(fieldName)) { + deserializedClusterProperties.networkFabricId = reader.getString(); + } else if ("analyticsOutputSettings".equals(fieldName)) { + deserializedClusterProperties.analyticsOutputSettings = AnalyticsOutputSettings.fromJson(reader); + } else if ("analyticsWorkspaceId".equals(fieldName)) { + deserializedClusterProperties.analyticsWorkspaceId = reader.getString(); + } else if ("availableUpgradeVersions".equals(fieldName)) { + List availableUpgradeVersions + = reader.readArray(reader1 -> ClusterAvailableUpgradeVersion.fromJson(reader1)); + deserializedClusterProperties.availableUpgradeVersions = availableUpgradeVersions; + } else if ("clusterCapacity".equals(fieldName)) { + deserializedClusterProperties.clusterCapacity = ClusterCapacity.fromJson(reader); + } else if ("clusterConnectionStatus".equals(fieldName)) { + deserializedClusterProperties.clusterConnectionStatus + = ClusterConnectionStatus.fromString(reader.getString()); + } else if ("clusterExtendedLocation".equals(fieldName)) { + deserializedClusterProperties.clusterExtendedLocation = ExtendedLocation.fromJson(reader); + } else if ("clusterLocation".equals(fieldName)) { + deserializedClusterProperties.clusterLocation = reader.getString(); + } else if ("clusterManagerConnectionStatus".equals(fieldName)) { + deserializedClusterProperties.clusterManagerConnectionStatus + = ClusterManagerConnectionStatus.fromString(reader.getString()); + } else if ("clusterManagerId".equals(fieldName)) { + deserializedClusterProperties.clusterManagerId = reader.getString(); + } else if ("clusterServicePrincipal".equals(fieldName)) { + deserializedClusterProperties.clusterServicePrincipal + = ServicePrincipalInformation.fromJson(reader); + } else if ("commandOutputSettings".equals(fieldName)) { + deserializedClusterProperties.commandOutputSettings = CommandOutputSettings.fromJson(reader); + } else if ("computeDeploymentThreshold".equals(fieldName)) { + deserializedClusterProperties.computeDeploymentThreshold = ValidationThreshold.fromJson(reader); + } else if ("computeRackDefinitions".equals(fieldName)) { + List computeRackDefinitions + = reader.readArray(reader1 -> RackDefinition.fromJson(reader1)); + deserializedClusterProperties.computeRackDefinitions = computeRackDefinitions; + } else if ("detailedStatus".equals(fieldName)) { + deserializedClusterProperties.detailedStatus = ClusterDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedClusterProperties.detailedStatusMessage = reader.getString(); + } else if ("hybridAksExtendedLocation".equals(fieldName)) { + deserializedClusterProperties.hybridAksExtendedLocation = ExtendedLocation.fromJson(reader); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedClusterProperties.managedResourceGroupConfiguration + = ManagedResourceGroupConfiguration.fromJson(reader); + } else if ("manualActionCount".equals(fieldName)) { + deserializedClusterProperties.manualActionCount = reader.getNullable(JsonReader::getLong); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterProperties.provisioningState + = ClusterProvisioningState.fromString(reader.getString()); + } else if ("runtimeProtectionConfiguration".equals(fieldName)) { + deserializedClusterProperties.runtimeProtectionConfiguration + = RuntimeProtectionConfiguration.fromJson(reader); + } else if ("secretArchive".equals(fieldName)) { + deserializedClusterProperties.secretArchive = ClusterSecretArchive.fromJson(reader); + } else if ("secretArchiveSettings".equals(fieldName)) { + deserializedClusterProperties.secretArchiveSettings = SecretArchiveSettings.fromJson(reader); + } else if ("supportExpiryDate".equals(fieldName)) { + deserializedClusterProperties.supportExpiryDate = reader.getString(); + } else if ("updateStrategy".equals(fieldName)) { + deserializedClusterProperties.updateStrategy = ClusterUpdateStrategy.fromJson(reader); + } else if ("vulnerabilityScanningSettings".equals(fieldName)) { + deserializedClusterProperties.vulnerabilityScanningSettings + = VulnerabilityScanningSettings.fromJson(reader); + } else if ("workloadResourceIds".equals(fieldName)) { + List workloadResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterProperties.workloadResourceIds = workloadResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java index 6b709c572c620..c6875e5002ba7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java @@ -8,50 +8,63 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ConsoleDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; import com.azure.resourcemanager.networkcloud.models.ConsoleProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -/** Console represents the console of an on-premises Network Cloud virtual machine. */ +/** + * Console represents the console of an on-premises Network Cloud virtual machine. + */ @Fluent public final class ConsoleInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster manager associated with the cluster this virtual machine is created on. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * ConsoleProperties represents the properties of the virtual machine console. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private ConsoleProperties innerProperties = new ConsoleProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ConsoleInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConsoleInner class. + */ public ConsoleInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. - * + * Get the extendedLocation property: The extended location of the cluster manager associated with the cluster this + * virtual machine is created on. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -59,11 +72,9 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. - * + * Set the extendedLocation property: The extended location of the cluster manager associated with the cluster this + * virtual machine is created on. + * * @param extendedLocation the extendedLocation value to set. * @return the ConsoleInner object itself. */ @@ -73,10 +84,8 @@ public ConsoleInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: ConsoleProperties represents the properties of the virtual machine console. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ConsoleProperties innerProperties() { @@ -85,21 +94,55 @@ private ConsoleProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ConsoleInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConsoleInner withTags(Map tags) { super.withTags(tags); @@ -108,7 +151,7 @@ public ConsoleInner withTags(Map tags) { /** * Get the detailedStatus property: The more detailed status of the console. - * + * * @return the detailedStatus value. */ public ConsoleDetailedStatus detailedStatus() { @@ -117,7 +160,7 @@ public ConsoleDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -126,7 +169,7 @@ public String detailedStatusMessage() { /** * Get the enabled property: The indicator of whether the console access is enabled. - * + * * @return the enabled value. */ public ConsoleEnabled enabled() { @@ -135,7 +178,7 @@ public ConsoleEnabled enabled() { /** * Set the enabled property: The indicator of whether the console access is enabled. - * + * * @param enabled the enabled value to set. * @return the ConsoleInner object itself. */ @@ -149,7 +192,7 @@ public ConsoleInner withEnabled(ConsoleEnabled enabled) { /** * Get the expiration property: The date and time after which the key will be disallowed access. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -158,7 +201,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the key will be disallowed access. - * + * * @param expiration the expiration value to set. * @return the ConsoleInner object itself. */ @@ -173,7 +216,7 @@ public ConsoleInner withExpiration(OffsetDateTime expiration) { /** * Get the privateLinkServiceId property: The resource ID of the private link service that is used to provide * virtual machine console access. - * + * * @return the privateLinkServiceId value. */ public String privateLinkServiceId() { @@ -182,7 +225,7 @@ public String privateLinkServiceId() { /** * Get the provisioningState property: The provisioning state of the virtual machine console. - * + * * @return the provisioningState value. */ public ConsoleProvisioningState provisioningState() { @@ -190,12 +233,9 @@ public ConsoleProvisioningState provisioningState() { } /** - * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Get the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ public SshPublicKey sshPublicKey() { @@ -203,12 +243,9 @@ public SshPublicKey sshPublicKey() { } /** - * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Set the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @param sshPublicKey the sshPublicKey value to set. * @return the ConsoleInner object itself. */ @@ -223,7 +260,7 @@ public ConsoleInner withSshPublicKey(SshPublicKey sshPublicKey) { /** * Get the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access the * console. - * + * * @return the virtualMachineAccessId value. */ public String virtualMachineAccessId() { @@ -232,23 +269,78 @@ public String virtualMachineAccessId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model ConsoleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property extendedLocation in model ConsoleInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ConsoleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model ConsoleInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ConsoleInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsoleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsoleInner 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 ConsoleInner. + */ + public static ConsoleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsoleInner deserializedConsoleInner = new ConsoleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConsoleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConsoleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConsoleInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConsoleInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConsoleInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedConsoleInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedConsoleInner.innerProperties = ConsoleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConsoleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConsoleInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java index 36ee13844b0d6..da31a3bc4915c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.networkcloud.fluent.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 com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; import com.azure.resourcemanager.networkcloud.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** ConsolePatchProperties represents the properties of the virtual machine console that can be patched. */ +/** + * ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + */ @Fluent -public final class ConsolePatchProperties { +public final class ConsolePatchProperties implements JsonSerializable { /* - * The credentials used to login to the image repository that has access to the specified image. + * The indicator of whether the console access is enabled. */ - @JsonProperty(value = "enabled") private ConsoleEnabled enabled; /* * The date and time after which the key will be disallowed access. */ - @JsonProperty(value = "expiration") private OffsetDateTime expiration; /* - * SshPublicKey represents the public key used to authenticate with a resource through SSH. - * * The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH * private key for logging in. */ - @JsonProperty(value = "sshPublicKey") private SshPublicKey sshPublicKey; - /** Creates an instance of ConsolePatchProperties class. */ + /** + * Creates an instance of ConsolePatchProperties class. + */ public ConsolePatchProperties() { } /** - * Get the enabled property: The credentials used to login to the image repository that has access to the specified - * image. - * + * Get the enabled property: The indicator of whether the console access is enabled. + * * @return the enabled value. */ public ConsoleEnabled enabled() { @@ -49,9 +53,8 @@ public ConsoleEnabled enabled() { } /** - * Set the enabled property: The credentials used to login to the image repository that has access to the specified - * image. - * + * Set the enabled property: The indicator of whether the console access is enabled. + * * @param enabled the enabled value to set. * @return the ConsolePatchProperties object itself. */ @@ -62,7 +65,7 @@ public ConsolePatchProperties withEnabled(ConsoleEnabled enabled) { /** * Get the expiration property: The date and time after which the key will be disallowed access. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -71,7 +74,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the key will be disallowed access. - * + * * @param expiration the expiration value to set. * @return the ConsolePatchProperties object itself. */ @@ -81,12 +84,9 @@ public ConsolePatchProperties withExpiration(OffsetDateTime expiration) { } /** - * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Get the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ public SshPublicKey sshPublicKey() { @@ -94,12 +94,9 @@ public SshPublicKey sshPublicKey() { } /** - * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Set the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @param sshPublicKey the sshPublicKey value to set. * @return the ConsolePatchProperties object itself. */ @@ -110,7 +107,7 @@ public ConsolePatchProperties withSshPublicKey(SshPublicKey sshPublicKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +115,48 @@ public void validate() { sshPublicKey().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enabled", this.enabled == null ? null : this.enabled.toString()); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + jsonWriter.writeJsonField("sshPublicKey", this.sshPublicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsolePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsolePatchProperties 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 ConsolePatchProperties. + */ + public static ConsolePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsolePatchProperties deserializedConsolePatchProperties = new ConsolePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedConsolePatchProperties.enabled = ConsoleEnabled.fromString(reader.getString()); + } else if ("expiration".equals(fieldName)) { + deserializedConsolePatchProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sshPublicKey".equals(fieldName)) { + deserializedConsolePatchProperties.sshPublicKey = SshPublicKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConsolePatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java index c3cba45b787f3..f6618fed450e1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java @@ -5,75 +5,75 @@ package com.azure.resourcemanager.networkcloud.fluent.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.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkcloud.models.ConsoleDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; import com.azure.resourcemanager.networkcloud.models.ConsoleProvisioningState; import com.azure.resourcemanager.networkcloud.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** ConsoleProperties represents the properties of the virtual machine console. */ +/** + * ConsoleProperties represents the properties of the virtual machine console. + */ @Fluent -public final class ConsoleProperties { +public final class ConsoleProperties implements JsonSerializable { /* * The more detailed status of the console. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private ConsoleDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The indicator of whether the console access is enabled. */ - @JsonProperty(value = "enabled", required = true) private ConsoleEnabled enabled; /* * The date and time after which the key will be disallowed access. */ - @JsonProperty(value = "expiration") private OffsetDateTime expiration; /* * The resource ID of the private link service that is used to provide virtual machine console access. */ - @JsonProperty(value = "privateLinkServiceId", access = JsonProperty.Access.WRITE_ONLY) private String privateLinkServiceId; /* * The provisioning state of the virtual machine console. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ConsoleProvisioningState provisioningState; /* - * SshPublicKey represents the public key used to authenticate with a resource through SSH. - * * The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH * private key for logging in. */ - @JsonProperty(value = "sshPublicKey", required = true) private SshPublicKey sshPublicKey; /* * The unique identifier for the virtual machine that is used to access the console. */ - @JsonProperty(value = "virtualMachineAccessId", access = JsonProperty.Access.WRITE_ONLY) private String virtualMachineAccessId; - /** Creates an instance of ConsoleProperties class. */ + /** + * Creates an instance of ConsoleProperties class. + */ public ConsoleProperties() { } /** * Get the detailedStatus property: The more detailed status of the console. - * + * * @return the detailedStatus value. */ public ConsoleDetailedStatus detailedStatus() { @@ -82,7 +82,7 @@ public ConsoleDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -91,7 +91,7 @@ public String detailedStatusMessage() { /** * Get the enabled property: The indicator of whether the console access is enabled. - * + * * @return the enabled value. */ public ConsoleEnabled enabled() { @@ -100,7 +100,7 @@ public ConsoleEnabled enabled() { /** * Set the enabled property: The indicator of whether the console access is enabled. - * + * * @param enabled the enabled value to set. * @return the ConsoleProperties object itself. */ @@ -111,7 +111,7 @@ public ConsoleProperties withEnabled(ConsoleEnabled enabled) { /** * Get the expiration property: The date and time after which the key will be disallowed access. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -120,7 +120,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the key will be disallowed access. - * + * * @param expiration the expiration value to set. * @return the ConsoleProperties object itself. */ @@ -132,7 +132,7 @@ public ConsoleProperties withExpiration(OffsetDateTime expiration) { /** * Get the privateLinkServiceId property: The resource ID of the private link service that is used to provide * virtual machine console access. - * + * * @return the privateLinkServiceId value. */ public String privateLinkServiceId() { @@ -141,7 +141,7 @@ public String privateLinkServiceId() { /** * Get the provisioningState property: The provisioning state of the virtual machine console. - * + * * @return the provisioningState value. */ public ConsoleProvisioningState provisioningState() { @@ -149,12 +149,9 @@ public ConsoleProvisioningState provisioningState() { } /** - * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Get the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ public SshPublicKey sshPublicKey() { @@ -162,12 +159,9 @@ public SshPublicKey sshPublicKey() { } /** - * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Set the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @param sshPublicKey the sshPublicKey value to set. * @return the ConsoleProperties object itself. */ @@ -179,7 +173,7 @@ public ConsoleProperties withSshPublicKey(SshPublicKey sshPublicKey) { /** * Get the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access the * console. - * + * * @return the virtualMachineAccessId value. */ public String virtualMachineAccessId() { @@ -188,21 +182,77 @@ public String virtualMachineAccessId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (enabled() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property enabled in model ConsoleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property enabled in model ConsoleProperties")); } if (sshPublicKey() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property sshPublicKey in model ConsoleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sshPublicKey in model ConsoleProperties")); } else { sshPublicKey().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ConsoleProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enabled", this.enabled == null ? null : this.enabled.toString()); + jsonWriter.writeJsonField("sshPublicKey", this.sshPublicKey); + jsonWriter.writeStringField("expiration", + this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsoleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsoleProperties 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 ConsoleProperties. + */ + public static ConsoleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsoleProperties deserializedConsoleProperties = new ConsoleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedConsoleProperties.enabled = ConsoleEnabled.fromString(reader.getString()); + } else if ("sshPublicKey".equals(fieldName)) { + deserializedConsoleProperties.sshPublicKey = SshPublicKey.fromJson(reader); + } else if ("detailedStatus".equals(fieldName)) { + deserializedConsoleProperties.detailedStatus = ConsoleDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedConsoleProperties.detailedStatusMessage = reader.getString(); + } else if ("expiration".equals(fieldName)) { + deserializedConsoleProperties.expiration = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("privateLinkServiceId".equals(fieldName)) { + deserializedConsoleProperties.privateLinkServiceId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedConsoleProperties.provisioningState + = ConsoleProvisioningState.fromString(reader.getString()); + } else if ("virtualMachineAccessId".equals(fieldName)) { + deserializedConsoleProperties.virtualMachineAccessId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConsoleProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureInner.java new file mode 100644 index 0000000000000..bc748c623f4c5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureInner.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +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.networkcloud.models.KubernetesClusterFeatureAvailabilityLifecycle; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureProvisioningState; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureRequired; +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * KubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ +@Fluent +public final class KubernetesClusterFeatureInner extends Resource { + /* + * The list of the resource properties. + */ + private KubernetesClusterFeatureProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of KubernetesClusterFeatureInner class. + */ + public KubernetesClusterFeatureInner() { + } + + /** + * Get the innerProperties property: The list of the resource properties. + * + * @return the innerProperties value. + */ + private KubernetesClusterFeatureProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public KubernetesClusterFeatureInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public KubernetesClusterFeatureInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the availabilityLifecycle property: The lifecycle indicator of the feature. + * + * @return the availabilityLifecycle value. + */ + public KubernetesClusterFeatureAvailabilityLifecycle availabilityLifecycle() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityLifecycle(); + } + + /** + * Get the detailedStatus property: The detailed status of the feature. + * + * @return the detailedStatus value. + */ + public KubernetesClusterFeatureDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message for the detailed status of the feature. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the options property: The configured options for the feature. + * + * @return the options value. + */ + public List options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: The configured options for the feature. + * + * @param options the options value to set. + * @return the KubernetesClusterFeatureInner object itself. + */ + public KubernetesClusterFeatureInner withOptions(List options) { + if (this.innerProperties() == null) { + this.innerProperties = new KubernetesClusterFeatureProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Kubernetes cluster feature. + * + * @return the provisioningState value. + */ + public KubernetesClusterFeatureProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the required property: The indicator of if the feature is required or optional. Optional features may be + * deleted by the user, while required features are managed with the kubernetes cluster lifecycle. + * + * @return the required value. + */ + public KubernetesClusterFeatureRequired required() { + return this.innerProperties() == null ? null : this.innerProperties().required(); + } + + /** + * Get the version property: The version of the feature. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterFeatureInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterFeatureInner 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 KubernetesClusterFeatureInner. + */ + public static KubernetesClusterFeatureInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterFeatureInner deserializedKubernetesClusterFeatureInner + = new KubernetesClusterFeatureInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesClusterFeatureInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.innerProperties + = KubernetesClusterFeatureProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedKubernetesClusterFeatureInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterFeatureInner; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeaturePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeaturePatchProperties.java new file mode 100644 index 0000000000000..d17ed34423d85 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeaturePatchProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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.networkcloud.models.StringKeyValuePair; +import java.io.IOException; +import java.util.List; + +/** + * KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. + */ +@Fluent +public final class KubernetesClusterFeaturePatchProperties + implements JsonSerializable { + /* + * The configured options for the feature. + */ + private List options; + + /** + * Creates an instance of KubernetesClusterFeaturePatchProperties class. + */ + public KubernetesClusterFeaturePatchProperties() { + } + + /** + * Get the options property: The configured options for the feature. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The configured options for the feature. + * + * @param options the options value to set. + * @return the KubernetesClusterFeaturePatchProperties object itself. + */ + public KubernetesClusterFeaturePatchProperties withOptions(List options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (options() != null) { + options().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("options", this.options, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterFeaturePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterFeaturePatchProperties 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 KubernetesClusterFeaturePatchProperties. + */ + public static KubernetesClusterFeaturePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterFeaturePatchProperties deserializedKubernetesClusterFeaturePatchProperties + = new KubernetesClusterFeaturePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("options".equals(fieldName)) { + List options + = reader.readArray(reader1 -> StringKeyValuePair.fromJson(reader1)); + deserializedKubernetesClusterFeaturePatchProperties.options = options; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterFeaturePatchProperties; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureProperties.java new file mode 100644 index 0000000000000..961eff3acc596 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterFeatureProperties.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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.networkcloud.models.KubernetesClusterFeatureAvailabilityLifecycle; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureProvisioningState; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureRequired; +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.io.IOException; +import java.util.List; + +/** + * KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + */ +@Fluent +public final class KubernetesClusterFeatureProperties implements JsonSerializable { + /* + * The lifecycle indicator of the feature. + */ + private KubernetesClusterFeatureAvailabilityLifecycle availabilityLifecycle; + + /* + * The detailed status of the feature. + */ + private KubernetesClusterFeatureDetailedStatus detailedStatus; + + /* + * The descriptive message for the detailed status of the feature. + */ + private String detailedStatusMessage; + + /* + * The configured options for the feature. + */ + private List options; + + /* + * The provisioning state of the Kubernetes cluster feature. + */ + private KubernetesClusterFeatureProvisioningState provisioningState; + + /* + * The indicator of if the feature is required or optional. Optional features may be deleted by the user, while + * required features are managed with the kubernetes cluster lifecycle. + */ + private KubernetesClusterFeatureRequired required; + + /* + * The version of the feature. + */ + private String version; + + /** + * Creates an instance of KubernetesClusterFeatureProperties class. + */ + public KubernetesClusterFeatureProperties() { + } + + /** + * Get the availabilityLifecycle property: The lifecycle indicator of the feature. + * + * @return the availabilityLifecycle value. + */ + public KubernetesClusterFeatureAvailabilityLifecycle availabilityLifecycle() { + return this.availabilityLifecycle; + } + + /** + * Get the detailedStatus property: The detailed status of the feature. + * + * @return the detailedStatus value. + */ + public KubernetesClusterFeatureDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message for the detailed status of the feature. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the options property: The configured options for the feature. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The configured options for the feature. + * + * @param options the options value to set. + * @return the KubernetesClusterFeatureProperties object itself. + */ + public KubernetesClusterFeatureProperties withOptions(List options) { + this.options = options; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Kubernetes cluster feature. + * + * @return the provisioningState value. + */ + public KubernetesClusterFeatureProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the required property: The indicator of if the feature is required or optional. Optional features may be + * deleted by the user, while required features are managed with the kubernetes cluster lifecycle. + * + * @return the required value. + */ + public KubernetesClusterFeatureRequired required() { + return this.required; + } + + /** + * Get the version property: The version of the feature. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (options() != null) { + options().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("options", this.options, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterFeatureProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterFeatureProperties 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 KubernetesClusterFeatureProperties. + */ + public static KubernetesClusterFeatureProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterFeatureProperties deserializedKubernetesClusterFeatureProperties + = new KubernetesClusterFeatureProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityLifecycle".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.availabilityLifecycle + = KubernetesClusterFeatureAvailabilityLifecycle.fromString(reader.getString()); + } else if ("detailedStatus".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.detailedStatus + = KubernetesClusterFeatureDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.detailedStatusMessage = reader.getString(); + } else if ("options".equals(fieldName)) { + List options + = reader.readArray(reader1 -> StringKeyValuePair.fromJson(reader1)); + deserializedKubernetesClusterFeatureProperties.options = options; + } else if ("provisioningState".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.provisioningState + = KubernetesClusterFeatureProvisioningState.fromString(reader.getString()); + } else if ("required".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.required + = KubernetesClusterFeatureRequired.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedKubernetesClusterFeatureProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterFeatureProperties; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterInner.java index 37b7dffebd00e..c2d6fdd5799f7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; 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.networkcloud.models.AadConfiguration; import com.azure.resourcemanager.networkcloud.models.AdministratorConfiguration; import com.azure.resourcemanager.networkcloud.models.AvailableUpgrade; @@ -20,45 +23,54 @@ import com.azure.resourcemanager.networkcloud.models.KubernetesClusterProvisioningState; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; import com.azure.resourcemanager.networkcloud.models.NetworkConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. */ +/** + * KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + */ @Fluent public final class KubernetesClusterInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private KubernetesClusterProperties innerProperties = new KubernetesClusterProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of KubernetesClusterInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of KubernetesClusterInner class. + */ public KubernetesClusterInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -66,11 +78,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the KubernetesClusterInner object itself. */ @@ -80,11 +89,8 @@ public KubernetesClusterInner withExtendedLocation(ExtendedLocation extendedLoca } /** - * Get the innerProperties property: KubernetesClusterProperties represents the properties of Kubernetes cluster - * resource. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private KubernetesClusterProperties innerProperties() { @@ -93,21 +99,55 @@ private KubernetesClusterProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public KubernetesClusterInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesClusterInner withTags(Map tags) { super.withTags(tags); @@ -115,10 +155,8 @@ public KubernetesClusterInner withTags(Map tags) { } /** - * Get the aadConfiguration property: AadConfiguration represents the Azure Active Directory Integration properties. - * - *

The Azure Active Directory Integration properties. - * + * Get the aadConfiguration property: The Azure Active Directory Integration properties. + * * @return the aadConfiguration value. */ public AadConfiguration aadConfiguration() { @@ -126,10 +164,8 @@ public AadConfiguration aadConfiguration() { } /** - * Set the aadConfiguration property: AadConfiguration represents the Azure Active Directory Integration properties. - * - *

The Azure Active Directory Integration properties. - * + * Set the aadConfiguration property: The Azure Active Directory Integration properties. + * * @param aadConfiguration the aadConfiguration value to set. * @return the KubernetesClusterInner object itself. */ @@ -142,12 +178,9 @@ public KubernetesClusterInner withAadConfiguration(AadConfiguration aadConfigura } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. - * + * Get the administratorConfiguration property: The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -155,12 +188,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. - * + * Set the administratorConfiguration property: The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the KubernetesClusterInner object itself. */ @@ -176,7 +206,7 @@ public AdministratorConfiguration administratorConfiguration() { /** * Get the attachedNetworkIds property: The full list of network resource IDs that are attached to this cluster, * including those attached only to specific agent pools. - * + * * @return the attachedNetworkIds value. */ public List attachedNetworkIds() { @@ -185,7 +215,7 @@ public List attachedNetworkIds() { /** * Get the availableUpgrades property: The list of versions that this Kubernetes cluster can be upgraded to. - * + * * @return the availableUpgrades value. */ public List availableUpgrades() { @@ -194,7 +224,7 @@ public List availableUpgrades() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster. - * + * * @return the clusterId value. */ public String clusterId() { @@ -204,7 +234,7 @@ public String clusterId() { /** * Get the connectedClusterId property: The resource ID of the connected cluster set up when this Kubernetes cluster * is created. - * + * * @return the connectedClusterId value. */ public String connectedClusterId() { @@ -213,7 +243,7 @@ public String connectedClusterId() { /** * Get the controlPlaneKubernetesVersion property: The current running version of Kubernetes on the control plane. - * + * * @return the controlPlaneKubernetesVersion value. */ public String controlPlaneKubernetesVersion() { @@ -221,11 +251,9 @@ public String controlPlaneKubernetesVersion() { } /** - * Get the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the selection of virtual - * machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster. - * + * Get the controlPlaneNodeConfiguration property: The defining characteristics of the control plane for this + * Kubernetes Cluster. + * * @return the controlPlaneNodeConfiguration value. */ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { @@ -233,11 +261,9 @@ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { } /** - * Set the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the selection of virtual - * machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster. - * + * Set the controlPlaneNodeConfiguration property: The defining characteristics of the control plane for this + * Kubernetes Cluster. + * * @param controlPlaneNodeConfiguration the controlPlaneNodeConfiguration value to set. * @return the KubernetesClusterInner object itself. */ @@ -252,7 +278,7 @@ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { /** * Get the detailedStatus property: The current status of the Kubernetes cluster. - * + * * @return the detailedStatus value. */ public KubernetesClusterDetailedStatus detailedStatus() { @@ -261,7 +287,7 @@ public KubernetesClusterDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -270,7 +296,7 @@ public String detailedStatusMessage() { /** * Get the featureStatuses property: The current feature settings. - * + * * @return the featureStatuses value. */ public List featureStatuses() { @@ -282,7 +308,7 @@ public List featureStatuses() { * for running critical system services and workloads. This data in this field is only used during creation, and the * field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent * pools is done using the agentPools sub-resource. - * + * * @return the initialAgentPoolConfigurations value. */ public List initialAgentPoolConfigurations() { @@ -294,7 +320,7 @@ public List initialAgentPoolConfigurations() { * for running critical system services and workloads. This data in this field is only used during creation, and the * field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent * pools is done using the agentPools sub-resource. - * + * * @param initialAgentPoolConfigurations the initialAgentPoolConfigurations value to set. * @return the KubernetesClusterInner object itself. */ @@ -308,9 +334,8 @@ public List initialAgentPoolConfigurations() { } /** - * Get the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Get the kubernetesVersion property: The Kubernetes version for this cluster. + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -318,9 +343,8 @@ public String kubernetesVersion() { } /** - * Set the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Set the kubernetesVersion property: The Kubernetes version for this cluster. + * * @param kubernetesVersion the kubernetesVersion value to set. * @return the KubernetesClusterInner object itself. */ @@ -333,11 +357,9 @@ public KubernetesClusterInner withKubernetesVersion(String kubernetesVersion) { } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -345,11 +367,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the KubernetesClusterInner object itself. */ @@ -363,12 +383,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Get the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span the - * cluster. - * + * Get the networkConfiguration property: The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. + * * @return the networkConfiguration value. */ public NetworkConfiguration networkConfiguration() { @@ -376,12 +393,9 @@ public NetworkConfiguration networkConfiguration() { } /** - * Set the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span the - * cluster. - * + * Set the networkConfiguration property: The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. + * * @param networkConfiguration the networkConfiguration value to set. * @return the KubernetesClusterInner object itself. */ @@ -395,7 +409,7 @@ public KubernetesClusterInner withNetworkConfiguration(NetworkConfiguration netw /** * Get the nodes property: The details of the nodes in this cluster. - * + * * @return the nodes value. */ public List nodes() { @@ -404,7 +418,7 @@ public List nodes() { /** * Get the provisioningState property: The provisioning state of the Kubernetes cluster resource. - * + * * @return the provisioningState value. */ public KubernetesClusterProvisioningState provisioningState() { @@ -413,23 +427,80 @@ public KubernetesClusterProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model KubernetesClusterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model KubernetesClusterInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model KubernetesClusterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model KubernetesClusterInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(KubernetesClusterInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterInner 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 KubernetesClusterInner. + */ + public static KubernetesClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterInner deserializedKubernetesClusterInner = new KubernetesClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKubernetesClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKubernetesClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKubernetesClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKubernetesClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesClusterInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedKubernetesClusterInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedKubernetesClusterInner.innerProperties = KubernetesClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedKubernetesClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterPatchProperties.java index 43ea79c173f2b..4113588ce3942 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterPatchProperties.java @@ -5,38 +5,65 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.AdministratorConfigurationPatch; import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. */ +/** + * KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + */ @Fluent -public final class KubernetesClusterPatchProperties { +public final class KubernetesClusterPatchProperties implements JsonSerializable { + /* + * The configuration of the default administrator credentials. + */ + private AdministratorConfigurationPatch administratorConfiguration; + /* - * ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this - * Kubernetes cluster. - * * The defining characteristics of the control plane that can be patched for this Kubernetes cluster. */ - @JsonProperty(value = "controlPlaneNodeConfiguration") private ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration; /* - * The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. The interpreted version used - * will be resolved into this field after creation or update. + * The Kubernetes version for this cluster. */ - @JsonProperty(value = "kubernetesVersion") private String kubernetesVersion; - /** Creates an instance of KubernetesClusterPatchProperties class. */ + /** + * Creates an instance of KubernetesClusterPatchProperties class. + */ public KubernetesClusterPatchProperties() { } /** - * Get the controlPlaneNodeConfiguration property: ControlPlaneNodePatchConfiguration represents the properties of - * the control plane that can be patched for this Kubernetes cluster. - * - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - * + * Get the administratorConfiguration property: The configuration of the default administrator credentials. + * + * @return the administratorConfiguration value. + */ + public AdministratorConfigurationPatch administratorConfiguration() { + return this.administratorConfiguration; + } + + /** + * Set the administratorConfiguration property: The configuration of the default administrator credentials. + * + * @param administratorConfiguration the administratorConfiguration value to set. + * @return the KubernetesClusterPatchProperties object itself. + */ + public KubernetesClusterPatchProperties + withAdministratorConfiguration(AdministratorConfigurationPatch administratorConfiguration) { + this.administratorConfiguration = administratorConfiguration; + return this; + } + + /** + * Get the controlPlaneNodeConfiguration property: The defining characteristics of the control plane that can be + * patched for this Kubernetes cluster. + * * @return the controlPlaneNodeConfiguration value. */ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { @@ -44,11 +71,9 @@ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { } /** - * Set the controlPlaneNodeConfiguration property: ControlPlaneNodePatchConfiguration represents the properties of - * the control plane that can be patched for this Kubernetes cluster. - * - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - * + * Set the controlPlaneNodeConfiguration property: The defining characteristics of the control plane that can be + * patched for this Kubernetes cluster. + * * @param controlPlaneNodeConfiguration the controlPlaneNodeConfiguration value to set. * @return the KubernetesClusterPatchProperties object itself. */ @@ -59,9 +84,8 @@ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { } /** - * Get the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Get the kubernetesVersion property: The Kubernetes version for this cluster. + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -69,9 +93,8 @@ public String kubernetesVersion() { } /** - * Set the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Set the kubernetesVersion property: The Kubernetes version for this cluster. + * * @param kubernetesVersion the kubernetesVersion value to set. * @return the KubernetesClusterPatchProperties object itself. */ @@ -82,12 +105,60 @@ public KubernetesClusterPatchProperties withKubernetesVersion(String kubernetesV /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (administratorConfiguration() != null) { + administratorConfiguration().validate(); + } if (controlPlaneNodeConfiguration() != null) { controlPlaneNodeConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeJsonField("controlPlaneNodeConfiguration", this.controlPlaneNodeConfiguration); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterPatchProperties 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 KubernetesClusterPatchProperties. + */ + public static KubernetesClusterPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterPatchProperties deserializedKubernetesClusterPatchProperties + = new KubernetesClusterPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorConfiguration".equals(fieldName)) { + deserializedKubernetesClusterPatchProperties.administratorConfiguration + = AdministratorConfigurationPatch.fromJson(reader); + } else if ("controlPlaneNodeConfiguration".equals(fieldName)) { + deserializedKubernetesClusterPatchProperties.controlPlaneNodeConfiguration + = ControlPlaneNodePatchConfiguration.fromJson(reader); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedKubernetesClusterPatchProperties.kubernetesVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterProperties.java index f755827b31a8e..b361ef1cdb086 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/KubernetesClusterProperties.java @@ -6,6 +6,10 @@ 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.networkcloud.models.AadConfiguration; import com.azure.resourcemanager.networkcloud.models.AdministratorConfiguration; import com.azure.resourcemanager.networkcloud.models.AvailableUpgrade; @@ -17,142 +21,113 @@ import com.azure.resourcemanager.networkcloud.models.KubernetesClusterProvisioningState; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; import com.azure.resourcemanager.networkcloud.models.NetworkConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** KubernetesClusterProperties represents the properties of Kubernetes cluster resource. */ +/** + * KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + */ @Fluent -public final class KubernetesClusterProperties { +public final class KubernetesClusterProperties implements JsonSerializable { /* - * AadConfiguration represents the Azure Active Directory Integration properties. - * * The Azure Active Directory Integration properties. */ - @JsonProperty(value = "aadConfiguration") private AadConfiguration aadConfiguration; /* - * AdministratorConfiguration represents the administrative credentials that will be applied to the control plane - * and agent pool nodes in Kubernetes clusters. - * - * The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. + * The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify + * their own values. */ - @JsonProperty(value = "administratorConfiguration") private AdministratorConfiguration administratorConfiguration; /* * The full list of network resource IDs that are attached to this cluster, including those attached only to * specific agent pools. */ - @JsonProperty(value = "attachedNetworkIds", access = JsonProperty.Access.WRITE_ONLY) private List attachedNetworkIds; /* * The list of versions that this Kubernetes cluster can be upgraded to. */ - @JsonProperty(value = "availableUpgrades", access = JsonProperty.Access.WRITE_ONLY) private List availableUpgrades; /* * The resource ID of the Network Cloud cluster. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The resource ID of the connected cluster set up when this Kubernetes cluster is created. */ - @JsonProperty(value = "connectedClusterId", access = JsonProperty.Access.WRITE_ONLY) private String connectedClusterId; /* * The current running version of Kubernetes on the control plane. */ - @JsonProperty(value = "controlPlaneKubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) private String controlPlaneKubernetesVersion; /* - * ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a - * Kubernetes cluster. - * * The defining characteristics of the control plane for this Kubernetes Cluster. */ - @JsonProperty(value = "controlPlaneNodeConfiguration", required = true) private ControlPlaneNodeConfiguration controlPlaneNodeConfiguration; /* * The current status of the Kubernetes cluster. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private KubernetesClusterDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The current feature settings. */ - @JsonProperty(value = "featureStatuses", access = JsonProperty.Access.WRITE_ONLY) private List featureStatuses; /* - * The agent pools that are created with this Kubernetes cluster for running critical system services and - * workloads. This data in this field is only used during creation, and the field will be empty following the - * creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools - * sub-resource. + * The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. + * This data in this field is only used during creation, and the field will be empty following the creation of the + * Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. */ - @JsonProperty(value = "initialAgentPoolConfigurations", required = true) private List initialAgentPoolConfigurations; /* - * The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. The interpreted version used - * will be resolved into this field after creation or update. + * The Kubernetes version for this cluster. */ - @JsonProperty(value = "kubernetesVersion", required = true) private String kubernetesVersion; /* - * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. - * * The configuration of the managed resource group associated with the resource. */ - @JsonProperty(value = "managedResourceGroupConfiguration") private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; /* - * NetworkConfiguration specifies the Kubernetes cluster network related configuration. - * * The configuration of the Kubernetes cluster networking, including the attachment of networks that span the * cluster. */ - @JsonProperty(value = "networkConfiguration", required = true) private NetworkConfiguration networkConfiguration; /* * The details of the nodes in this cluster. */ - @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) private List nodes; /* * The provisioning state of the Kubernetes cluster resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private KubernetesClusterProvisioningState provisioningState; - /** Creates an instance of KubernetesClusterProperties class. */ + /** + * Creates an instance of KubernetesClusterProperties class. + */ public KubernetesClusterProperties() { } /** - * Get the aadConfiguration property: AadConfiguration represents the Azure Active Directory Integration properties. - * - *

The Azure Active Directory Integration properties. - * + * Get the aadConfiguration property: The Azure Active Directory Integration properties. + * * @return the aadConfiguration value. */ public AadConfiguration aadConfiguration() { @@ -160,10 +135,8 @@ public AadConfiguration aadConfiguration() { } /** - * Set the aadConfiguration property: AadConfiguration represents the Azure Active Directory Integration properties. - * - *

The Azure Active Directory Integration properties. - * + * Set the aadConfiguration property: The Azure Active Directory Integration properties. + * * @param aadConfiguration the aadConfiguration value to set. * @return the KubernetesClusterProperties object itself. */ @@ -173,12 +146,9 @@ public KubernetesClusterProperties withAadConfiguration(AadConfiguration aadConf } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. - * + * Get the administratorConfiguration property: The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -186,12 +156,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. - * + * Set the administratorConfiguration property: The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the KubernetesClusterProperties object itself. */ @@ -204,7 +171,7 @@ public AdministratorConfiguration administratorConfiguration() { /** * Get the attachedNetworkIds property: The full list of network resource IDs that are attached to this cluster, * including those attached only to specific agent pools. - * + * * @return the attachedNetworkIds value. */ public List attachedNetworkIds() { @@ -213,7 +180,7 @@ public List attachedNetworkIds() { /** * Get the availableUpgrades property: The list of versions that this Kubernetes cluster can be upgraded to. - * + * * @return the availableUpgrades value. */ public List availableUpgrades() { @@ -222,7 +189,7 @@ public List availableUpgrades() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster. - * + * * @return the clusterId value. */ public String clusterId() { @@ -232,7 +199,7 @@ public String clusterId() { /** * Get the connectedClusterId property: The resource ID of the connected cluster set up when this Kubernetes cluster * is created. - * + * * @return the connectedClusterId value. */ public String connectedClusterId() { @@ -241,7 +208,7 @@ public String connectedClusterId() { /** * Get the controlPlaneKubernetesVersion property: The current running version of Kubernetes on the control plane. - * + * * @return the controlPlaneKubernetesVersion value. */ public String controlPlaneKubernetesVersion() { @@ -249,11 +216,9 @@ public String controlPlaneKubernetesVersion() { } /** - * Get the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the selection of virtual - * machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster. - * + * Get the controlPlaneNodeConfiguration property: The defining characteristics of the control plane for this + * Kubernetes Cluster. + * * @return the controlPlaneNodeConfiguration value. */ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { @@ -261,11 +226,9 @@ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { } /** - * Set the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the selection of virtual - * machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster. - * + * Set the controlPlaneNodeConfiguration property: The defining characteristics of the control plane for this + * Kubernetes Cluster. + * * @param controlPlaneNodeConfiguration the controlPlaneNodeConfiguration value to set. * @return the KubernetesClusterProperties object itself. */ @@ -277,7 +240,7 @@ public ControlPlaneNodeConfiguration controlPlaneNodeConfiguration() { /** * Get the detailedStatus property: The current status of the Kubernetes cluster. - * + * * @return the detailedStatus value. */ public KubernetesClusterDetailedStatus detailedStatus() { @@ -286,7 +249,7 @@ public KubernetesClusterDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -295,7 +258,7 @@ public String detailedStatusMessage() { /** * Get the featureStatuses property: The current feature settings. - * + * * @return the featureStatuses value. */ public List featureStatuses() { @@ -307,7 +270,7 @@ public List featureStatuses() { * for running critical system services and workloads. This data in this field is only used during creation, and the * field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent * pools is done using the agentPools sub-resource. - * + * * @return the initialAgentPoolConfigurations value. */ public List initialAgentPoolConfigurations() { @@ -319,7 +282,7 @@ public List initialAgentPoolConfigurations() { * for running critical system services and workloads. This data in this field is only used during creation, and the * field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent * pools is done using the agentPools sub-resource. - * + * * @param initialAgentPoolConfigurations the initialAgentPoolConfigurations value to set. * @return the KubernetesClusterProperties object itself. */ @@ -330,9 +293,8 @@ public List initialAgentPoolConfigurations() { } /** - * Get the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Get the kubernetesVersion property: The Kubernetes version for this cluster. + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -340,9 +302,8 @@ public String kubernetesVersion() { } /** - * Set the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Set the kubernetesVersion property: The Kubernetes version for this cluster. + * * @param kubernetesVersion the kubernetesVersion value to set. * @return the KubernetesClusterProperties object itself. */ @@ -352,11 +313,9 @@ public KubernetesClusterProperties withKubernetesVersion(String kubernetesVersio } /** - * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Get the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { @@ -364,11 +323,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Set the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the KubernetesClusterProperties object itself. */ @@ -379,12 +336,9 @@ public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { } /** - * Get the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span the - * cluster. - * + * Get the networkConfiguration property: The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. + * * @return the networkConfiguration value. */ public NetworkConfiguration networkConfiguration() { @@ -392,12 +346,9 @@ public NetworkConfiguration networkConfiguration() { } /** - * Set the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span the - * cluster. - * + * Set the networkConfiguration property: The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. + * * @param networkConfiguration the networkConfiguration value to set. * @return the KubernetesClusterProperties object itself. */ @@ -408,7 +359,7 @@ public KubernetesClusterProperties withNetworkConfiguration(NetworkConfiguration /** * Get the nodes property: The details of the nodes in this cluster. - * + * * @return the nodes value. */ public List nodes() { @@ -417,7 +368,7 @@ public List nodes() { /** * Get the provisioningState property: The provisioning state of the Kubernetes cluster resource. - * + * * @return the provisioningState value. */ public KubernetesClusterProvisioningState provisioningState() { @@ -426,7 +377,7 @@ public KubernetesClusterProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -440,8 +391,9 @@ public void validate() { availableUpgrades().forEach(e -> e.validate()); } if (controlPlaneNodeConfiguration() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property controlPlaneNodeConfiguration in model" + " KubernetesClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property controlPlaneNodeConfiguration in model KubernetesClusterProperties")); } else { controlPlaneNodeConfiguration().validate(); } @@ -449,21 +401,24 @@ public void validate() { featureStatuses().forEach(e -> e.validate()); } if (initialAgentPoolConfigurations() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property initialAgentPoolConfigurations in model" + " KubernetesClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property initialAgentPoolConfigurations in model KubernetesClusterProperties")); } else { initialAgentPoolConfigurations().forEach(e -> e.validate()); } if (kubernetesVersion() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property kubernetesVersion in model KubernetesClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property kubernetesVersion in model KubernetesClusterProperties")); } if (managedResourceGroupConfiguration() != null) { managedResourceGroupConfiguration().validate(); } if (networkConfiguration() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property networkConfiguration in model KubernetesClusterProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkConfiguration in model KubernetesClusterProperties")); } else { networkConfiguration().validate(); } @@ -473,4 +428,95 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(KubernetesClusterProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("controlPlaneNodeConfiguration", this.controlPlaneNodeConfiguration); + jsonWriter.writeArrayField("initialAgentPoolConfigurations", this.initialAgentPoolConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeJsonField("aadConfiguration", this.aadConfiguration); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterProperties 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 KubernetesClusterProperties. + */ + public static KubernetesClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterProperties deserializedKubernetesClusterProperties = new KubernetesClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("controlPlaneNodeConfiguration".equals(fieldName)) { + deserializedKubernetesClusterProperties.controlPlaneNodeConfiguration + = ControlPlaneNodeConfiguration.fromJson(reader); + } else if ("initialAgentPoolConfigurations".equals(fieldName)) { + List initialAgentPoolConfigurations + = reader.readArray(reader1 -> InitialAgentPoolConfiguration.fromJson(reader1)); + deserializedKubernetesClusterProperties.initialAgentPoolConfigurations + = initialAgentPoolConfigurations; + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedKubernetesClusterProperties.kubernetesVersion = reader.getString(); + } else if ("networkConfiguration".equals(fieldName)) { + deserializedKubernetesClusterProperties.networkConfiguration + = NetworkConfiguration.fromJson(reader); + } else if ("aadConfiguration".equals(fieldName)) { + deserializedKubernetesClusterProperties.aadConfiguration = AadConfiguration.fromJson(reader); + } else if ("administratorConfiguration".equals(fieldName)) { + deserializedKubernetesClusterProperties.administratorConfiguration + = AdministratorConfiguration.fromJson(reader); + } else if ("attachedNetworkIds".equals(fieldName)) { + List attachedNetworkIds = reader.readArray(reader1 -> reader1.getString()); + deserializedKubernetesClusterProperties.attachedNetworkIds = attachedNetworkIds; + } else if ("availableUpgrades".equals(fieldName)) { + List availableUpgrades + = reader.readArray(reader1 -> AvailableUpgrade.fromJson(reader1)); + deserializedKubernetesClusterProperties.availableUpgrades = availableUpgrades; + } else if ("clusterId".equals(fieldName)) { + deserializedKubernetesClusterProperties.clusterId = reader.getString(); + } else if ("connectedClusterId".equals(fieldName)) { + deserializedKubernetesClusterProperties.connectedClusterId = reader.getString(); + } else if ("controlPlaneKubernetesVersion".equals(fieldName)) { + deserializedKubernetesClusterProperties.controlPlaneKubernetesVersion = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedKubernetesClusterProperties.detailedStatus + = KubernetesClusterDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedKubernetesClusterProperties.detailedStatusMessage = reader.getString(); + } else if ("featureStatuses".equals(fieldName)) { + List featureStatuses = reader.readArray(reader1 -> FeatureStatus.fromJson(reader1)); + deserializedKubernetesClusterProperties.featureStatuses = featureStatuses; + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedKubernetesClusterProperties.managedResourceGroupConfiguration + = ManagedResourceGroupConfiguration.fromJson(reader); + } else if ("nodes".equals(fieldName)) { + List nodes + = reader.readArray(reader1 -> KubernetesClusterNode.fromJson(reader1)); + deserializedKubernetesClusterProperties.nodes = nodes; + } else if ("provisioningState".equals(fieldName)) { + deserializedKubernetesClusterProperties.provisioningState + = KubernetesClusterProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java index 2418c0a19e661..c69ca70fc028e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java @@ -8,49 +8,61 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.L2NetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.L2NetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. */ +/** + * L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ @Fluent public final class L2NetworkInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * L2NetworkProperties represents properties of the L2 network. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private L2NetworkProperties innerProperties = new L2NetworkProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of L2NetworkInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of L2NetworkInner class. + */ public L2NetworkInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -58,11 +70,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the L2NetworkInner object itself. */ @@ -72,10 +81,8 @@ public L2NetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: L2NetworkProperties represents properties of the L2 network. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private L2NetworkProperties innerProperties() { @@ -84,21 +91,55 @@ private L2NetworkProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public L2NetworkInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public L2NetworkInner withTags(Map tags) { super.withTags(tags); @@ -108,7 +149,7 @@ public L2NetworkInner withTags(Map tags) { /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -117,7 +158,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -126,7 +167,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the L2 network. - * + * * @return the detailedStatus value. */ public L2NetworkDetailedStatus detailedStatus() { @@ -135,7 +176,7 @@ public L2NetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -145,7 +186,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -155,7 +196,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -165,7 +206,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the L2NetworkInner object itself. */ @@ -180,7 +221,7 @@ public L2NetworkInner withHybridAksPluginType(HybridAksPluginType hybridAksPlugi /** * Get the interfaceName property: The default interface name for this L2 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -190,7 +231,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this L2 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the L2NetworkInner object itself. */ @@ -204,7 +245,7 @@ public L2NetworkInner withInterfaceName(String interfaceName) { /** * Get the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. - * + * * @return the l2IsolationDomainId value. */ public String l2IsolationDomainId() { @@ -213,7 +254,7 @@ public String l2IsolationDomainId() { /** * Set the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. - * + * * @param l2IsolationDomainId the l2IsolationDomainId value to set. * @return the L2NetworkInner object itself. */ @@ -227,7 +268,7 @@ public L2NetworkInner withL2IsolationDomainId(String l2IsolationDomainId) { /** * Get the provisioningState property: The provisioning state of the L2 network. - * + * * @return the provisioningState value. */ public L2NetworkProvisioningState provisioningState() { @@ -238,7 +279,7 @@ public L2NetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -247,23 +288,79 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model L2NetworkInner")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property extendedLocation in model L2NetworkInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model L2NetworkInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model L2NetworkInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(L2NetworkInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2NetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2NetworkInner 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 L2NetworkInner. + */ + public static L2NetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2NetworkInner deserializedL2NetworkInner = new L2NetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedL2NetworkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedL2NetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedL2NetworkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedL2NetworkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedL2NetworkInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedL2NetworkInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedL2NetworkInner.innerProperties = L2NetworkProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedL2NetworkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedL2NetworkInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java index 1577a4a7d2c3f..51c841ca72556 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java @@ -6,87 +6,85 @@ 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.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.L2NetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.L2NetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** L2NetworkProperties represents properties of the L2 network. */ +/** + * L2NetworkProperties represents properties of the L2 network. + */ @Fluent -public final class L2NetworkProperties { +public final class L2NetworkProperties implements JsonSerializable { /* * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. */ - @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List associatedResourceIds; /* * The resource ID of the Network Cloud cluster this L2 network is associated with. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The more detailed status of the L2 network. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private L2NetworkDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are * associated with this L2 network. */ - @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List hybridAksClustersAssociatedIds; /* * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. * The network plugin type for Hybrid AKS. */ - @JsonProperty(value = "hybridAksPluginType") private HybridAksPluginType hybridAksPluginType; /* * The default interface name for this L2 network in the virtual machine. This name can be overridden by the name * supplied in the network attachment configuration of that virtual machine. */ - @JsonProperty(value = "interfaceName") private String interfaceName; /* * The resource ID of the Network Fabric l2IsolationDomain. */ - @JsonProperty(value = "l2IsolationDomainId", required = true) private String l2IsolationDomainId; /* * The provisioning state of the L2 network. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private L2NetworkProvisioningState provisioningState; /* * Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any * Hybrid AKS virtual machines, that are currently using this L2 network. */ - @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List virtualMachinesAssociatedIds; - /** Creates an instance of L2NetworkProperties class. */ + /** + * Creates an instance of L2NetworkProperties class. + */ public L2NetworkProperties() { } /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -95,7 +93,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -104,7 +102,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the L2 network. - * + * * @return the detailedStatus value. */ public L2NetworkDetailedStatus detailedStatus() { @@ -113,7 +111,7 @@ public L2NetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -123,7 +121,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -133,7 +131,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -143,7 +141,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the L2NetworkProperties object itself. */ @@ -155,7 +153,7 @@ public L2NetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAks /** * Get the interfaceName property: The default interface name for this L2 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -165,7 +163,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this L2 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the L2NetworkProperties object itself. */ @@ -176,7 +174,7 @@ public L2NetworkProperties withInterfaceName(String interfaceName) { /** * Get the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. - * + * * @return the l2IsolationDomainId value. */ public String l2IsolationDomainId() { @@ -185,7 +183,7 @@ public String l2IsolationDomainId() { /** * Set the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. - * + * * @param l2IsolationDomainId the l2IsolationDomainId value to set. * @return the L2NetworkProperties object itself. */ @@ -196,7 +194,7 @@ public L2NetworkProperties withL2IsolationDomainId(String l2IsolationDomainId) { /** * Get the provisioningState property: The provisioning state of the L2 network. - * + * * @return the provisioningState value. */ public L2NetworkProvisioningState provisioningState() { @@ -207,7 +205,7 @@ public L2NetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -216,15 +214,80 @@ public List virtualMachinesAssociatedIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (l2IsolationDomainId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property l2IsolationDomainId in model L2NetworkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property l2IsolationDomainId in model L2NetworkProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(L2NetworkProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("l2IsolationDomainId", this.l2IsolationDomainId); + jsonWriter.writeStringField("hybridAksPluginType", + this.hybridAksPluginType == null ? null : this.hybridAksPluginType.toString()); + jsonWriter.writeStringField("interfaceName", this.interfaceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2NetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2NetworkProperties 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 L2NetworkProperties. + */ + public static L2NetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2NetworkProperties deserializedL2NetworkProperties = new L2NetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("l2IsolationDomainId".equals(fieldName)) { + deserializedL2NetworkProperties.l2IsolationDomainId = reader.getString(); + } else if ("associatedResourceIds".equals(fieldName)) { + List associatedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL2NetworkProperties.associatedResourceIds = associatedResourceIds; + } else if ("clusterId".equals(fieldName)) { + deserializedL2NetworkProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedL2NetworkProperties.detailedStatus + = L2NetworkDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedL2NetworkProperties.detailedStatusMessage = reader.getString(); + } else if ("hybridAksClustersAssociatedIds".equals(fieldName)) { + List hybridAksClustersAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL2NetworkProperties.hybridAksClustersAssociatedIds = hybridAksClustersAssociatedIds; + } else if ("hybridAksPluginType".equals(fieldName)) { + deserializedL2NetworkProperties.hybridAksPluginType + = HybridAksPluginType.fromString(reader.getString()); + } else if ("interfaceName".equals(fieldName)) { + deserializedL2NetworkProperties.interfaceName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedL2NetworkProperties.provisioningState + = L2NetworkProvisioningState.fromString(reader.getString()); + } else if ("virtualMachinesAssociatedIds".equals(fieldName)) { + List virtualMachinesAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL2NetworkProperties.virtualMachinesAssociatedIds = virtualMachinesAssociatedIds; + } else { + reader.skipChildren(); + } + } + + return deserializedL2NetworkProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java index 2b07fe114c541..64483dd58fe85 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java @@ -8,51 +8,63 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.IpAllocationType; import com.azure.resourcemanager.networkcloud.models.L3NetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.L3NetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. */ +/** + * L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ @Fluent public final class L3NetworkInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * L3NetworkProperties represents properties of the L3 network. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private L3NetworkProperties innerProperties = new L3NetworkProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of L3NetworkInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of L3NetworkInner class. + */ public L3NetworkInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -60,11 +72,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the L3NetworkInner object itself. */ @@ -74,10 +83,8 @@ public L3NetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: L3NetworkProperties represents properties of the L3 network. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private L3NetworkProperties innerProperties() { @@ -86,21 +93,55 @@ private L3NetworkProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public L3NetworkInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public L3NetworkInner withTags(Map tags) { super.withTags(tags); @@ -110,7 +151,7 @@ public L3NetworkInner withTags(Map tags) { /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -119,7 +160,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -128,7 +169,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the L3 network. - * + * * @return the detailedStatus value. */ public L3NetworkDetailedStatus detailedStatus() { @@ -137,7 +178,7 @@ public L3NetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -147,7 +188,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this L3 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -158,7 +199,7 @@ public List hybridAksClustersAssociatedIds() { * Get the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network * attachment definition injected into the Hybrid AKS Cluster. - * + * * @return the hybridAksIpamEnabled value. */ public HybridAksIpamEnabled hybridAksIpamEnabled() { @@ -169,7 +210,7 @@ public HybridAksIpamEnabled hybridAksIpamEnabled() { * Set the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network * attachment definition injected into the Hybrid AKS Cluster. - * + * * @param hybridAksIpamEnabled the hybridAksIpamEnabled value to set. * @return the L3NetworkInner object itself. */ @@ -184,7 +225,7 @@ public L3NetworkInner withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpa /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -194,7 +235,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the L3NetworkInner object itself. */ @@ -209,7 +250,7 @@ public L3NetworkInner withHybridAksPluginType(HybridAksPluginType hybridAksPlugi /** * Get the interfaceName property: The default interface name for this L3 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -219,7 +260,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this L3 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the L3NetworkInner object itself. */ @@ -233,7 +274,7 @@ public L3NetworkInner withInterfaceName(String interfaceName) { /** * Get the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". - * + * * @return the ipAllocationType value. */ public IpAllocationType ipAllocationType() { @@ -242,7 +283,7 @@ public IpAllocationType ipAllocationType() { /** * Set the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". - * + * * @param ipAllocationType the ipAllocationType value to set. * @return the L3NetworkInner object itself. */ @@ -256,8 +297,9 @@ public L3NetworkInner withIpAllocationType(IpAllocationType ipAllocationType) { /** * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. - * + * allocation type + * is IPV4 or DualStack. + * * @return the ipv4ConnectedPrefix value. */ public String ipv4ConnectedPrefix() { @@ -266,8 +308,9 @@ public String ipv4ConnectedPrefix() { /** * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. - * + * allocation type + * is IPV4 or DualStack. + * * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. * @return the L3NetworkInner object itself. */ @@ -281,8 +324,9 @@ public L3NetworkInner withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { /** * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. - * + * allocation type + * is IPV6 or DualStack. + * * @return the ipv6ConnectedPrefix value. */ public String ipv6ConnectedPrefix() { @@ -291,8 +335,9 @@ public String ipv6ConnectedPrefix() { /** * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. - * + * allocation type + * is IPV6 or DualStack. + * * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. * @return the L3NetworkInner object itself. */ @@ -306,7 +351,7 @@ public L3NetworkInner withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { /** * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. - * + * * @return the l3IsolationDomainId value. */ public String l3IsolationDomainId() { @@ -315,7 +360,7 @@ public String l3IsolationDomainId() { /** * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. - * + * * @param l3IsolationDomainId the l3IsolationDomainId value to set. * @return the L3NetworkInner object itself. */ @@ -329,7 +374,7 @@ public L3NetworkInner withL3IsolationDomainId(String l3IsolationDomainId) { /** * Get the provisioningState property: The provisioning state of the L3 network. - * + * * @return the provisioningState value. */ public L3NetworkProvisioningState provisioningState() { @@ -340,7 +385,7 @@ public L3NetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -349,7 +394,7 @@ public List virtualMachinesAssociatedIds() { /** * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. - * + * * @return the vlan value. */ public long vlan() { @@ -358,7 +403,7 @@ public long vlan() { /** * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. - * + * * @param vlan the vlan value to set. * @return the L3NetworkInner object itself. */ @@ -372,23 +417,79 @@ public L3NetworkInner withVlan(long vlan) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model L3NetworkInner")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property extendedLocation in model L3NetworkInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model L3NetworkInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model L3NetworkInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(L3NetworkInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L3NetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L3NetworkInner 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 L3NetworkInner. + */ + public static L3NetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L3NetworkInner deserializedL3NetworkInner = new L3NetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedL3NetworkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedL3NetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedL3NetworkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedL3NetworkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedL3NetworkInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedL3NetworkInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedL3NetworkInner.innerProperties = L3NetworkProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedL3NetworkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedL3NetworkInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java index 11c93d1238f06..775f4d2784383 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java @@ -6,123 +6,116 @@ 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.networkcloud.models.HybridAksIpamEnabled; import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.IpAllocationType; import com.azure.resourcemanager.networkcloud.models.L3NetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.L3NetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** L3NetworkProperties represents properties of the L3 network. */ +/** + * L3NetworkProperties represents properties of the L3 network. + */ @Fluent -public final class L3NetworkProperties { +public final class L3NetworkProperties implements JsonSerializable { /* * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. */ - @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List associatedResourceIds; /* * The resource ID of the Network Cloud cluster this L3 network is associated with. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The more detailed status of the L3 network. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private L3NetworkDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are * associated with this L3 network. */ - @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List hybridAksClustersAssociatedIds; /* * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. - * The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into - * the Hybrid AKS Cluster. + * The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the + * Hybrid AKS Cluster. */ - @JsonProperty(value = "hybridAksIpamEnabled") private HybridAksIpamEnabled hybridAksIpamEnabled; /* * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. * The network plugin type for Hybrid AKS. */ - @JsonProperty(value = "hybridAksPluginType") private HybridAksPluginType hybridAksPluginType; /* * The default interface name for this L3 network in the virtual machine. This name can be overridden by the name * supplied in the network attachment configuration of that virtual machine. */ - @JsonProperty(value = "interfaceName") private String interfaceName; /* * The type of the IP address allocation, defaulted to "DualStack". */ - @JsonProperty(value = "ipAllocationType") private IpAllocationType ipAllocationType; /* * The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type * is IPV4 or DualStack. */ - @JsonProperty(value = "ipv4ConnectedPrefix") private String ipv4ConnectedPrefix; /* * The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type * is IPV6 or DualStack. */ - @JsonProperty(value = "ipv6ConnectedPrefix") private String ipv6ConnectedPrefix; /* * The resource ID of the Network Fabric l3IsolationDomain. */ - @JsonProperty(value = "l3IsolationDomainId", required = true) private String l3IsolationDomainId; /* * The provisioning state of the L3 network. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private L3NetworkProvisioningState provisioningState; /* * Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any * Hybrid AKS virtual machines, that are currently using this L3 network. */ - @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List virtualMachinesAssociatedIds; /* * The VLAN from the l3IsolationDomain that is used for this network. */ - @JsonProperty(value = "vlan", required = true) private long vlan; - /** Creates an instance of L3NetworkProperties class. */ + /** + * Creates an instance of L3NetworkProperties class. + */ public L3NetworkProperties() { } /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -131,7 +124,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -140,7 +133,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the L3 network. - * + * * @return the detailedStatus value. */ public L3NetworkDetailedStatus detailedStatus() { @@ -149,7 +142,7 @@ public L3NetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -159,7 +152,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this L3 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -170,7 +163,7 @@ public List hybridAksClustersAssociatedIds() { * Get the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network * attachment definition injected into the Hybrid AKS Cluster. - * + * * @return the hybridAksIpamEnabled value. */ public HybridAksIpamEnabled hybridAksIpamEnabled() { @@ -181,7 +174,7 @@ public HybridAksIpamEnabled hybridAksIpamEnabled() { * Set the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network * attachment definition injected into the Hybrid AKS Cluster. - * + * * @param hybridAksIpamEnabled the hybridAksIpamEnabled value to set. * @return the L3NetworkProperties object itself. */ @@ -193,7 +186,7 @@ public L3NetworkProperties withHybridAksIpamEnabled(HybridAksIpamEnabled hybridA /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -203,7 +196,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the L3NetworkProperties object itself. */ @@ -215,7 +208,7 @@ public L3NetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAks /** * Get the interfaceName property: The default interface name for this L3 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -225,7 +218,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this L3 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the L3NetworkProperties object itself. */ @@ -236,7 +229,7 @@ public L3NetworkProperties withInterfaceName(String interfaceName) { /** * Get the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". - * + * * @return the ipAllocationType value. */ public IpAllocationType ipAllocationType() { @@ -245,7 +238,7 @@ public IpAllocationType ipAllocationType() { /** * Set the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". - * + * * @param ipAllocationType the ipAllocationType value to set. * @return the L3NetworkProperties object itself. */ @@ -256,8 +249,9 @@ public L3NetworkProperties withIpAllocationType(IpAllocationType ipAllocationTyp /** * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. - * + * allocation type + * is IPV4 or DualStack. + * * @return the ipv4ConnectedPrefix value. */ public String ipv4ConnectedPrefix() { @@ -266,8 +260,9 @@ public String ipv4ConnectedPrefix() { /** * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. - * + * allocation type + * is IPV4 or DualStack. + * * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. * @return the L3NetworkProperties object itself. */ @@ -278,8 +273,9 @@ public L3NetworkProperties withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { /** * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. - * + * allocation type + * is IPV6 or DualStack. + * * @return the ipv6ConnectedPrefix value. */ public String ipv6ConnectedPrefix() { @@ -288,8 +284,9 @@ public String ipv6ConnectedPrefix() { /** * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. - * + * allocation type + * is IPV6 or DualStack. + * * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. * @return the L3NetworkProperties object itself. */ @@ -300,7 +297,7 @@ public L3NetworkProperties withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { /** * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. - * + * * @return the l3IsolationDomainId value. */ public String l3IsolationDomainId() { @@ -309,7 +306,7 @@ public String l3IsolationDomainId() { /** * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. - * + * * @param l3IsolationDomainId the l3IsolationDomainId value to set. * @return the L3NetworkProperties object itself. */ @@ -320,7 +317,7 @@ public L3NetworkProperties withL3IsolationDomainId(String l3IsolationDomainId) { /** * Get the provisioningState property: The provisioning state of the L3 network. - * + * * @return the provisioningState value. */ public L3NetworkProvisioningState provisioningState() { @@ -331,7 +328,7 @@ public L3NetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -340,7 +337,7 @@ public List virtualMachinesAssociatedIds() { /** * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. - * + * * @return the vlan value. */ public long vlan() { @@ -349,7 +346,7 @@ public long vlan() { /** * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. - * + * * @param vlan the vlan value to set. * @return the L3NetworkProperties object itself. */ @@ -360,15 +357,98 @@ public L3NetworkProperties withVlan(long vlan) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (l3IsolationDomainId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property l3IsolationDomainId in model L3NetworkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property l3IsolationDomainId in model L3NetworkProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(L3NetworkProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("l3IsolationDomainId", this.l3IsolationDomainId); + jsonWriter.writeLongField("vlan", this.vlan); + jsonWriter.writeStringField("hybridAksIpamEnabled", + this.hybridAksIpamEnabled == null ? null : this.hybridAksIpamEnabled.toString()); + jsonWriter.writeStringField("hybridAksPluginType", + this.hybridAksPluginType == null ? null : this.hybridAksPluginType.toString()); + jsonWriter.writeStringField("interfaceName", this.interfaceName); + jsonWriter.writeStringField("ipAllocationType", + this.ipAllocationType == null ? null : this.ipAllocationType.toString()); + jsonWriter.writeStringField("ipv4ConnectedPrefix", this.ipv4ConnectedPrefix); + jsonWriter.writeStringField("ipv6ConnectedPrefix", this.ipv6ConnectedPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L3NetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L3NetworkProperties 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 L3NetworkProperties. + */ + public static L3NetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L3NetworkProperties deserializedL3NetworkProperties = new L3NetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("l3IsolationDomainId".equals(fieldName)) { + deserializedL3NetworkProperties.l3IsolationDomainId = reader.getString(); + } else if ("vlan".equals(fieldName)) { + deserializedL3NetworkProperties.vlan = reader.getLong(); + } else if ("associatedResourceIds".equals(fieldName)) { + List associatedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL3NetworkProperties.associatedResourceIds = associatedResourceIds; + } else if ("clusterId".equals(fieldName)) { + deserializedL3NetworkProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedL3NetworkProperties.detailedStatus + = L3NetworkDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedL3NetworkProperties.detailedStatusMessage = reader.getString(); + } else if ("hybridAksClustersAssociatedIds".equals(fieldName)) { + List hybridAksClustersAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL3NetworkProperties.hybridAksClustersAssociatedIds = hybridAksClustersAssociatedIds; + } else if ("hybridAksIpamEnabled".equals(fieldName)) { + deserializedL3NetworkProperties.hybridAksIpamEnabled + = HybridAksIpamEnabled.fromString(reader.getString()); + } else if ("hybridAksPluginType".equals(fieldName)) { + deserializedL3NetworkProperties.hybridAksPluginType + = HybridAksPluginType.fromString(reader.getString()); + } else if ("interfaceName".equals(fieldName)) { + deserializedL3NetworkProperties.interfaceName = reader.getString(); + } else if ("ipAllocationType".equals(fieldName)) { + deserializedL3NetworkProperties.ipAllocationType = IpAllocationType.fromString(reader.getString()); + } else if ("ipv4ConnectedPrefix".equals(fieldName)) { + deserializedL3NetworkProperties.ipv4ConnectedPrefix = reader.getString(); + } else if ("ipv6ConnectedPrefix".equals(fieldName)) { + deserializedL3NetworkProperties.ipv6ConnectedPrefix = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedL3NetworkProperties.provisioningState + = L3NetworkProvisioningState.fromString(reader.getString()); + } else if ("virtualMachinesAssociatedIds".equals(fieldName)) { + List virtualMachinesAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedL3NetworkProperties.virtualMachinesAssociatedIds = virtualMachinesAssociatedIds; + } else { + reader.skipChildren(); + } + } + + return deserializedL3NetworkProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java index 247a6080220f1..1437155f0d722 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java @@ -5,88 +5,85 @@ package com.azure.resourcemanager.networkcloud.fluent.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.networkcloud.models.BootstrapProtocol; import com.azure.resourcemanager.networkcloud.models.MachineDisk; import com.azure.resourcemanager.networkcloud.models.NetworkInterface; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** MachineSkuProperties represents the properties of the machine SKU. */ +/** + * MachineSkuProperties represents the properties of the machine SKU. + */ @Immutable -public final class MachineSkuProperties { +public final class MachineSkuProperties implements JsonSerializable { /* * The type of bootstrap protocol used. */ - @JsonProperty(value = "bootstrapProtocol", access = JsonProperty.Access.WRITE_ONLY) private BootstrapProtocol bootstrapProtocol; /* * The count of CPU cores for this machine. */ - @JsonProperty(value = "cpuCores", access = JsonProperty.Access.WRITE_ONLY) private Long cpuCores; /* * The count of CPU sockets for this machine. */ - @JsonProperty(value = "cpuSockets", access = JsonProperty.Access.WRITE_ONLY) private Long cpuSockets; /* * The list of disks. */ - @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY) private List disks; /* * The generation of the architecture. */ - @JsonProperty(value = "generation", access = JsonProperty.Access.WRITE_ONLY) private String generation; /* * The hardware version of the machine. */ - @JsonProperty(value = "hardwareVersion", access = JsonProperty.Access.WRITE_ONLY) private String hardwareVersion; /* - * The maximum amount of memory in GB. + * The maximum amount of memory. Measured in gibibytes. */ - @JsonProperty(value = "memoryCapacityGB", access = JsonProperty.Access.WRITE_ONLY) private Long memoryCapacityGB; /* * The model of the machine. */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) private String model; /* * The list of network interfaces. */ - @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) private List networkInterfaces; /* * The count of SMT and physical core threads for this machine. */ - @JsonProperty(value = "totalThreads", access = JsonProperty.Access.WRITE_ONLY) private Long totalThreads; /* * The make of the machine. */ - @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) private String vendor; - /** Creates an instance of MachineSkuProperties class. */ + /** + * Creates an instance of MachineSkuProperties class. + */ public MachineSkuProperties() { } /** * Get the bootstrapProtocol property: The type of bootstrap protocol used. - * + * * @return the bootstrapProtocol value. */ public BootstrapProtocol bootstrapProtocol() { @@ -95,7 +92,7 @@ public BootstrapProtocol bootstrapProtocol() { /** * Get the cpuCores property: The count of CPU cores for this machine. - * + * * @return the cpuCores value. */ public Long cpuCores() { @@ -104,7 +101,7 @@ public Long cpuCores() { /** * Get the cpuSockets property: The count of CPU sockets for this machine. - * + * * @return the cpuSockets value. */ public Long cpuSockets() { @@ -113,7 +110,7 @@ public Long cpuSockets() { /** * Get the disks property: The list of disks. - * + * * @return the disks value. */ public List disks() { @@ -122,7 +119,7 @@ public List disks() { /** * Get the generation property: The generation of the architecture. - * + * * @return the generation value. */ public String generation() { @@ -131,7 +128,7 @@ public String generation() { /** * Get the hardwareVersion property: The hardware version of the machine. - * + * * @return the hardwareVersion value. */ public String hardwareVersion() { @@ -139,8 +136,8 @@ public String hardwareVersion() { } /** - * Get the memoryCapacityGB property: The maximum amount of memory in GB. - * + * Get the memoryCapacityGB property: The maximum amount of memory. Measured in gibibytes. + * * @return the memoryCapacityGB value. */ public Long memoryCapacityGB() { @@ -149,7 +146,7 @@ public Long memoryCapacityGB() { /** * Get the model property: The model of the machine. - * + * * @return the model value. */ public String model() { @@ -158,7 +155,7 @@ public String model() { /** * Get the networkInterfaces property: The list of network interfaces. - * + * * @return the networkInterfaces value. */ public List networkInterfaces() { @@ -167,7 +164,7 @@ public List networkInterfaces() { /** * Get the totalThreads property: The count of SMT and physical core threads for this machine. - * + * * @return the totalThreads value. */ public Long totalThreads() { @@ -176,7 +173,7 @@ public Long totalThreads() { /** * Get the vendor property: The make of the machine. - * + * * @return the vendor value. */ public String vendor() { @@ -185,7 +182,7 @@ public String vendor() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -196,4 +193,63 @@ public void validate() { networkInterfaces().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineSkuProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineSkuProperties 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 MachineSkuProperties. + */ + public static MachineSkuProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineSkuProperties deserializedMachineSkuProperties = new MachineSkuProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bootstrapProtocol".equals(fieldName)) { + deserializedMachineSkuProperties.bootstrapProtocol + = BootstrapProtocol.fromString(reader.getString()); + } else if ("cpuCores".equals(fieldName)) { + deserializedMachineSkuProperties.cpuCores = reader.getNullable(JsonReader::getLong); + } else if ("cpuSockets".equals(fieldName)) { + deserializedMachineSkuProperties.cpuSockets = reader.getNullable(JsonReader::getLong); + } else if ("disks".equals(fieldName)) { + List disks = reader.readArray(reader1 -> MachineDisk.fromJson(reader1)); + deserializedMachineSkuProperties.disks = disks; + } else if ("generation".equals(fieldName)) { + deserializedMachineSkuProperties.generation = reader.getString(); + } else if ("hardwareVersion".equals(fieldName)) { + deserializedMachineSkuProperties.hardwareVersion = reader.getString(); + } else if ("memoryCapacityGB".equals(fieldName)) { + deserializedMachineSkuProperties.memoryCapacityGB = reader.getNullable(JsonReader::getLong); + } else if ("model".equals(fieldName)) { + deserializedMachineSkuProperties.model = reader.getString(); + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterface.fromJson(reader1)); + deserializedMachineSkuProperties.networkInterfaces = networkInterfaces; + } else if ("totalThreads".equals(fieldName)) { + deserializedMachineSkuProperties.totalThreads = reader.getNullable(JsonReader::getLong); + } else if ("vendor".equals(fieldName)) { + deserializedMachineSkuProperties.vendor = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineSkuProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java index ab86f70e73e57..a9ce199734abc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java @@ -5,59 +5,60 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.ActionType; import com.azure.resourcemanager.networkcloud.models.OperationDisplay; import com.azure.resourcemanager.networkcloud.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * 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; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -67,7 +68,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -76,7 +77,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -85,7 +86,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -97,7 +98,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -107,7 +108,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -116,7 +117,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -124,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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultInner.java index 9398e2d1b0d08..0873f0fd03dad 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultInner.java @@ -6,105 +6,107 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; 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.time.OffsetDateTime; import java.util.List; -/** The current status of an async operation. */ +/** + * The current status of an async operation. + */ @Fluent -public final class OperationStatusResultInner { +public final class OperationStatusResultInner implements JsonSerializable { /* - * Fully qualified ID for the async operation. + * The end time of the operation. */ - @JsonProperty(value = "id") - private String id; + private OffsetDateTime endTime; /* - * Fully qualified ID of the resource against which the original async operation was started. + * If present, details of the operation error. */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; + private ManagementError error; + + /* + * Fully qualified ID for the async operation. + */ + private String id; /* * Name of the async operation. */ - @JsonProperty(value = "name") private String name; /* - * Operation status. + * The operations list. */ - @JsonProperty(value = "status", required = true) - private String status; + private List operations; /* * Percent of the operation that is complete. */ - @JsonProperty(value = "percentComplete") private Float percentComplete; /* - * The start time of the operation. + * The additional properties of the operation status result. */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; + private OperationStatusResultProperties innerProperties; /* - * The end time of the operation. + * Fully qualified ID of the resource against which the original async operation was started. */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; + private String resourceId; /* - * The operations list. + * The start time of the operation. */ - @JsonProperty(value = "operations") - private List operations; + private OffsetDateTime startTime; /* - * If present, details of the operation error. + * Operation status. */ - @JsonProperty(value = "error") - private ManagementError error; + private String status; - /** Creates an instance of OperationStatusResultInner class. */ + /** + * Creates an instance of OperationStatusResultInner class. + */ public OperationStatusResultInner() { } /** - * Get the id property: Fully qualified ID for the async operation. - * - * @return the id value. + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. */ - public String id() { - return this.id; + public OffsetDateTime endTime() { + return this.endTime; } /** - * Set the id property: Fully qualified ID for the async operation. - * - * @param id the id value to set. - * @return the OperationStatusResultInner object itself. + * Get the error property: If present, details of the operation error. + * + * @return the error value. */ - public OperationStatusResultInner withId(String id) { - this.id = id; - return this; + public ManagementError error() { + return this.error; } /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. */ - public String resourceId() { - return this.resourceId; + public String id() { + return this.id; } /** * Get the name property: Name of the async operation. - * + * * @return the name value. */ public String name() { @@ -112,39 +114,17 @@ public String name() { } /** - * Set the name property: Name of the async operation. - * - * @param name the name value to set. - * @return the OperationStatusResultInner object itself. - */ - public OperationStatusResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Operation status. - * - * @param status the status value to set. - * @return the OperationStatusResultInner object itself. + * Get the operations property: The operations list. + * + * @return the operations value. */ - public OperationStatusResultInner withStatus(String status) { - this.status = status; - return this; + public List operations() { + return this.operations; } /** * Get the percentComplete property: Percent of the operation that is complete. - * + * * @return the percentComplete value. */ public Float percentComplete() { @@ -152,110 +132,170 @@ public Float percentComplete() { } /** - * Set the percentComplete property: Percent of the operation that is complete. - * - * @param percentComplete the percentComplete value to set. - * @return the OperationStatusResultInner object itself. + * Get the innerProperties property: The additional properties of the operation status result. + * + * @return the innerProperties value. */ - public OperationStatusResultInner withPercentComplete(Float percentComplete) { - this.percentComplete = percentComplete; - return this; + private OperationStatusResultProperties innerProperties() { + return this.innerProperties; } /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. */ - public OffsetDateTime startTime() { - return this.startTime; + public String resourceId() { + return this.resourceId; } /** - * Set the startTime property: The start time of the operation. - * - * @param startTime the startTime value to set. - * @return the OperationStatusResultInner object itself. + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. */ - public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; + public OffsetDateTime startTime() { + return this.startTime; } /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. + * Get the status property: Operation status. + * + * @return the status value. */ - public OffsetDateTime endTime() { - return this.endTime; + public String status() { + return this.status; } /** - * Set the endTime property: The end time of the operation. - * - * @param endTime the endTime value to set. + * Set the status property: Operation status. + * + * @param status the status value to set. * @return the OperationStatusResultInner object itself. */ - public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; + public OperationStatusResultInner withStatus(String status) { + this.status = status; return this; } /** - * Get the operations property: The operations list. - * - * @return the operations value. + * Get the exitCode property: For actions that run commands or scripts, the exit code of the script execution. + * + * @return the exitCode value. */ - public List operations() { - return this.operations; + public String exitCode() { + return this.innerProperties() == null ? null : this.innerProperties().exitCode(); } /** - * Set the operations property: The operations list. - * - * @param operations the operations value to set. - * @return the OperationStatusResultInner object itself. + * Get the outputHead property: For actions that run commands or scripts, the leading bytes of the output of the + * script execution. + * + * @return the outputHead value. */ - public OperationStatusResultInner withOperations(List operations) { - this.operations = operations; - return this; + public String outputHead() { + return this.innerProperties() == null ? null : this.innerProperties().outputHead(); } /** - * Get the error property: If present, details of the operation error. - * - * @return the error value. + * Get the resultRef property: For actions that run commands or scripts, a reference to the location of the result. + * + * @return the resultRef value. */ - public ManagementError error() { - return this.error; + public String resultRef() { + return this.innerProperties() == null ? null : this.innerProperties().resultRef(); } /** - * Set the error property: If present, details of the operation error. - * - * @param error the error value to set. - * @return the OperationStatusResultInner object itself. + * Get the resultUrl property: For actions that run commands or scripts, the URL where the full output of the script + * output can be retrieved. + * + * @return the resultUrl value. */ - public OperationStatusResultInner withError(ManagementError error) { - this.error = error; - return this; + public String resultUrl() { + return this.innerProperties() == null ? null : this.innerProperties().resultUrl(); } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (status() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property status in model OperationStatusResultInner")); - } if (operations() != null) { operations().forEach(e -> e.validate()); } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } } private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner 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 OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getFloat); + } else if ("properties".equals(fieldName)) { + deserializedOperationStatusResultInner.innerProperties + = OperationStatusResultProperties.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultProperties.java new file mode 100644 index 0000000000000..d470274c29348 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationStatusResultProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.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 java.io.IOException; + +/** + * OperationStatusResultProperties represents additional properties of the operation status result. + */ +@Immutable +public final class OperationStatusResultProperties implements JsonSerializable { + /* + * For actions that run commands or scripts, the exit code of the script execution. + */ + private String exitCode; + + /* + * For actions that run commands or scripts, the leading bytes of the output of the script execution. + */ + private String outputHead; + + /* + * For actions that run commands or scripts, a reference to the location of the result. + */ + private String resultRef; + + /* + * For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. + */ + private String resultUrl; + + /** + * Creates an instance of OperationStatusResultProperties class. + */ + public OperationStatusResultProperties() { + } + + /** + * Get the exitCode property: For actions that run commands or scripts, the exit code of the script execution. + * + * @return the exitCode value. + */ + public String exitCode() { + return this.exitCode; + } + + /** + * Get the outputHead property: For actions that run commands or scripts, the leading bytes of the output of the + * script execution. + * + * @return the outputHead value. + */ + public String outputHead() { + return this.outputHead; + } + + /** + * Get the resultRef property: For actions that run commands or scripts, a reference to the location of the result. + * + * @return the resultRef value. + */ + public String resultRef() { + return this.resultRef; + } + + /** + * Get the resultUrl property: For actions that run commands or scripts, the URL where the full output of the script + * output can be retrieved. + * + * @return the resultUrl value. + */ + public String resultUrl() { + return this.resultUrl; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultProperties 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 OperationStatusResultProperties. + */ + public static OperationStatusResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultProperties deserializedOperationStatusResultProperties + = new OperationStatusResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exitCode".equals(fieldName)) { + deserializedOperationStatusResultProperties.exitCode = reader.getString(); + } else if ("outputHead".equals(fieldName)) { + deserializedOperationStatusResultProperties.outputHead = reader.getString(); + } else if ("resultRef".equals(fieldName)) { + deserializedOperationStatusResultProperties.resultRef = reader.getString(); + } else if ("resultUrl".equals(fieldName)) { + deserializedOperationStatusResultProperties.resultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultProperties; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java index 2affb576db036..8c6f240ff2fc4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java @@ -8,47 +8,59 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.RackDetailedStatus; import com.azure.resourcemanager.networkcloud.models.RackProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. */ +/** + * Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ @Fluent public final class RackInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * RackProperties represents the properties of the rack. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private RackProperties innerProperties = new RackProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of RackInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RackInner class. + */ public RackInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -56,11 +68,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the RackInner object itself. */ @@ -70,10 +79,8 @@ public RackInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: RackProperties represents the properties of the rack. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private RackProperties innerProperties() { @@ -82,21 +89,55 @@ private RackProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public RackInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public RackInner withTags(Map tags) { super.withTags(tags); @@ -106,7 +147,7 @@ public RackInner withTags(Map tags) { /** * Get the availabilityZone property: The value that will be used for machines in this rack to represent the * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -116,7 +157,7 @@ public String availabilityZone() { /** * Set the availabilityZone property: The value that will be used for machines in this rack to represent the * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. - * + * * @param availabilityZone the availabilityZone value to set. * @return the RackInner object itself. */ @@ -131,7 +172,7 @@ public RackInner withAvailabilityZone(String availabilityZone) { /** * Get the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the * rack is created by the cluster. - * + * * @return the clusterId value. */ public String clusterId() { @@ -140,7 +181,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the rack. - * + * * @return the detailedStatus value. */ public RackDetailedStatus detailedStatus() { @@ -149,7 +190,7 @@ public RackDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -158,7 +199,7 @@ public String detailedStatusMessage() { /** * Get the provisioningState property: The provisioning state of the rack resource. - * + * * @return the provisioningState value. */ public RackProvisioningState provisioningState() { @@ -168,7 +209,7 @@ public RackProvisioningState provisioningState() { /** * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @return the rackLocation value. */ public String rackLocation() { @@ -178,7 +219,7 @@ public String rackLocation() { /** * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @param rackLocation the rackLocation value to set. * @return the RackInner object itself. */ @@ -193,7 +234,7 @@ public RackInner withRackLocation(String rackLocation) { /** * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @return the rackSerialNumber value. */ public String rackSerialNumber() { @@ -203,7 +244,7 @@ public String rackSerialNumber() { /** * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @param rackSerialNumber the rackSerialNumber value to set. * @return the RackInner object itself. */ @@ -217,7 +258,7 @@ public RackInner withRackSerialNumber(String rackSerialNumber) { /** * Get the rackSkuId property: The SKU for the rack. - * + * * @return the rackSkuId value. */ public String rackSkuId() { @@ -226,7 +267,7 @@ public String rackSkuId() { /** * Set the rackSkuId property: The SKU for the rack. - * + * * @param rackSkuId the rackSkuId value to set. * @return the RackInner object itself. */ @@ -240,23 +281,78 @@ public RackInner withRackSkuId(String rackSkuId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model RackInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property extendedLocation in model RackInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model RackInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model RackInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(RackInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackInner 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 RackInner. + */ + public static RackInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackInner deserializedRackInner = new RackInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRackInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRackInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRackInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRackInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRackInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedRackInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedRackInner.innerProperties = RackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRackInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRackInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java index a1ed5e17fdecf..996a7fa494dee 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java @@ -6,72 +6,72 @@ 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.networkcloud.models.RackDetailedStatus; import com.azure.resourcemanager.networkcloud.models.RackProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** RackProperties represents the properties of the rack. */ +/** + * RackProperties represents the properties of the rack. + */ @Fluent -public final class RackProperties { +public final class RackProperties implements JsonSerializable { /* * The value that will be used for machines in this rack to represent the availability zones that can be referenced * by Hybrid AKS Clusters for node arrangement. */ - @JsonProperty(value = "availabilityZone", required = true) private String availabilityZone; /* * The resource ID of the cluster the rack is created for. This value is set when the rack is created by the * cluster. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The more detailed status of the rack. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private RackDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The provisioning state of the rack resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private RackProvisioningState provisioningState; /* * The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) */ - @JsonProperty(value = "rackLocation", required = true) private String rackLocation; /* * The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other * than a serial number may be provided if desired. */ - @JsonProperty(value = "rackSerialNumber", required = true) private String rackSerialNumber; /* * The SKU for the rack. */ - @JsonProperty(value = "rackSkuId", required = true) private String rackSkuId; - /** Creates an instance of RackProperties class. */ + /** + * Creates an instance of RackProperties class. + */ public RackProperties() { } /** * Get the availabilityZone property: The value that will be used for machines in this rack to represent the * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -81,7 +81,7 @@ public String availabilityZone() { /** * Set the availabilityZone property: The value that will be used for machines in this rack to represent the * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. - * + * * @param availabilityZone the availabilityZone value to set. * @return the RackProperties object itself. */ @@ -93,7 +93,7 @@ public RackProperties withAvailabilityZone(String availabilityZone) { /** * Get the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the * rack is created by the cluster. - * + * * @return the clusterId value. */ public String clusterId() { @@ -102,7 +102,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the rack. - * + * * @return the detailedStatus value. */ public RackDetailedStatus detailedStatus() { @@ -111,7 +111,7 @@ public RackDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -120,7 +120,7 @@ public String detailedStatusMessage() { /** * Get the provisioningState property: The provisioning state of the rack resource. - * + * * @return the provisioningState value. */ public RackProvisioningState provisioningState() { @@ -130,7 +130,7 @@ public RackProvisioningState provisioningState() { /** * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @return the rackLocation value. */ public String rackLocation() { @@ -140,7 +140,7 @@ public String rackLocation() { /** * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @param rackLocation the rackLocation value to set. * @return the RackProperties object itself. */ @@ -152,7 +152,7 @@ public RackProperties withRackLocation(String rackLocation) { /** * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @return the rackSerialNumber value. */ public String rackSerialNumber() { @@ -162,7 +162,7 @@ public String rackSerialNumber() { /** * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @param rackSerialNumber the rackSerialNumber value to set. * @return the RackProperties object itself. */ @@ -173,7 +173,7 @@ public RackProperties withRackSerialNumber(String rackSerialNumber) { /** * Get the rackSkuId property: The SKU for the rack. - * + * * @return the rackSkuId value. */ public String rackSkuId() { @@ -182,7 +182,7 @@ public String rackSkuId() { /** * Set the rackSkuId property: The SKU for the rack. - * + * * @param rackSkuId the rackSkuId value to set. * @return the RackProperties object itself. */ @@ -193,27 +193,83 @@ public RackProperties withRackSkuId(String rackSkuId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (availabilityZone() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property availabilityZone in model RackProperties")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property availabilityZone in model RackProperties")); } if (rackLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackLocation in model RackProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rackLocation in model RackProperties")); } if (rackSerialNumber() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackSerialNumber in model RackProperties")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property rackSerialNumber in model RackProperties")); } if (rackSkuId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackSkuId in model RackProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rackSkuId in model RackProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(RackProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("rackLocation", this.rackLocation); + jsonWriter.writeStringField("rackSerialNumber", this.rackSerialNumber); + jsonWriter.writeStringField("rackSkuId", this.rackSkuId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackProperties 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 RackProperties. + */ + public static RackProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackProperties deserializedRackProperties = new RackProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedRackProperties.availabilityZone = reader.getString(); + } else if ("rackLocation".equals(fieldName)) { + deserializedRackProperties.rackLocation = reader.getString(); + } else if ("rackSerialNumber".equals(fieldName)) { + deserializedRackProperties.rackSerialNumber = reader.getString(); + } else if ("rackSkuId".equals(fieldName)) { + deserializedRackProperties.rackSkuId = reader.getString(); + } else if ("clusterId".equals(fieldName)) { + deserializedRackProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedRackProperties.detailedStatus = RackDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedRackProperties.detailedStatusMessage = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRackProperties.provisioningState = RackProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRackProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java index dce45b8b3e5fc..a2cdec31022a2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java @@ -8,41 +8,55 @@ 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.networkcloud.models.MachineSkuSlot; import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState; import com.azure.resourcemanager.networkcloud.models.RackSkuType; import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** RackSku represents the SKU information of the rack. */ +/** + * RackSku represents the SKU information of the rack. + */ @Immutable public final class RackSkuInner extends ProxyResource { /* - * RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both - * aggregator and compute racks. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private RackSkuProperties innerProperties = new RackSkuProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of RackSkuInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RackSkuInner class. + */ public RackSkuInner() { } /** - * Get the innerProperties property: RackSkuProperties represents the properties of compute-related hardware for a - * rack. This supports both aggregator and compute racks. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private RackSkuProperties innerProperties() { @@ -51,17 +65,47 @@ private RackSkuProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated * machines in this rack model. - * + * * @return the computeMachines value. */ public List computeMachines() { @@ -71,7 +115,7 @@ public List computeMachines() { /** * Get the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane * dedicated machines in this rack model. - * + * * @return the controllerMachines value. */ public List controllerMachines() { @@ -80,7 +124,7 @@ public List controllerMachines() { /** * Get the description property: The free-form text describing the rack. - * + * * @return the description value. */ public String description() { @@ -90,7 +134,7 @@ public String description() { /** * Get the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this * is a compute rack or a rack for a single rack cluster(rackType="Single"). - * + * * @return the maxClusterSlots value. */ public Long maxClusterSlots() { @@ -99,7 +143,7 @@ public Long maxClusterSlots() { /** * Get the provisioningState property: The provisioning state of the rack SKU resource. - * + * * @return the provisioningState value. */ public RackSkuProvisioningState provisioningState() { @@ -108,7 +152,7 @@ public RackSkuProvisioningState provisioningState() { /** * Get the rackType property: The type of the rack. - * + * * @return the rackType value. */ public RackSkuType rackType() { @@ -118,7 +162,7 @@ public RackSkuType rackType() { /** * Get the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage * appliance(s) in this rack model. - * + * * @return the storageAppliances value. */ public List storageAppliances() { @@ -127,7 +171,7 @@ public List storageAppliances() { /** * Get the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. - * + * * @return the supportedRackSkuIds value. */ public List supportedRackSkuIds() { @@ -136,17 +180,62 @@ public List supportedRackSkuIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model RackSkuInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model RackSkuInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(RackSkuInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackSkuInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackSkuInner 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 RackSkuInner. + */ + public static RackSkuInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackSkuInner deserializedRackSkuInner = new RackSkuInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRackSkuInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRackSkuInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRackSkuInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRackSkuInner.innerProperties = RackSkuProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRackSkuInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRackSkuInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java index 8b8b61e44f38e..63c6a332bf817 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java @@ -5,11 +5,15 @@ package com.azure.resourcemanager.networkcloud.fluent.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.networkcloud.models.MachineSkuSlot; import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState; import com.azure.resourcemanager.networkcloud.models.RackSkuType; import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -17,64 +21,58 @@ * compute racks. */ @Immutable -public final class RackSkuProperties { +public final class RackSkuProperties implements JsonSerializable { /* * The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. */ - @JsonProperty(value = "computeMachines", access = JsonProperty.Access.WRITE_ONLY) private List computeMachines; /* * The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. */ - @JsonProperty(value = "controllerMachines", access = JsonProperty.Access.WRITE_ONLY) private List controllerMachines; /* * The free-form text describing the rack. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* * The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a * single rack cluster(rackType="Single"). */ - @JsonProperty(value = "maxClusterSlots", access = JsonProperty.Access.WRITE_ONLY) private Long maxClusterSlots; /* * The provisioning state of the rack SKU resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private RackSkuProvisioningState provisioningState; /* * The type of the rack. */ - @JsonProperty(value = "rackType", access = JsonProperty.Access.WRITE_ONLY) private RackSkuType rackType; /* * The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. */ - @JsonProperty(value = "storageAppliances", access = JsonProperty.Access.WRITE_ONLY) private List storageAppliances; /* * The list of supported SKUs if the rack is an aggregator. */ - @JsonProperty(value = "supportedRackSkuIds", access = JsonProperty.Access.WRITE_ONLY) private List supportedRackSkuIds; - /** Creates an instance of RackSkuProperties class. */ + /** + * Creates an instance of RackSkuProperties class. + */ public RackSkuProperties() { } /** * Get the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated * machines in this rack model. - * + * * @return the computeMachines value. */ public List computeMachines() { @@ -84,7 +82,7 @@ public List computeMachines() { /** * Get the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane * dedicated machines in this rack model. - * + * * @return the controllerMachines value. */ public List controllerMachines() { @@ -93,7 +91,7 @@ public List controllerMachines() { /** * Get the description property: The free-form text describing the rack. - * + * * @return the description value. */ public String description() { @@ -103,7 +101,7 @@ public String description() { /** * Get the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this * is a compute rack or a rack for a single rack cluster(rackType="Single"). - * + * * @return the maxClusterSlots value. */ public Long maxClusterSlots() { @@ -112,7 +110,7 @@ public Long maxClusterSlots() { /** * Get the provisioningState property: The provisioning state of the rack SKU resource. - * + * * @return the provisioningState value. */ public RackSkuProvisioningState provisioningState() { @@ -121,7 +119,7 @@ public RackSkuProvisioningState provisioningState() { /** * Get the rackType property: The type of the rack. - * + * * @return the rackType value. */ public RackSkuType rackType() { @@ -131,7 +129,7 @@ public RackSkuType rackType() { /** * Get the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage * appliance(s) in this rack model. - * + * * @return the storageAppliances value. */ public List storageAppliances() { @@ -140,7 +138,7 @@ public List storageAppliances() { /** * Get the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. - * + * * @return the supportedRackSkuIds value. */ public List supportedRackSkuIds() { @@ -149,7 +147,7 @@ public List supportedRackSkuIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -163,4 +161,61 @@ public void validate() { storageAppliances().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackSkuProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackSkuProperties 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 RackSkuProperties. + */ + public static RackSkuProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackSkuProperties deserializedRackSkuProperties = new RackSkuProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeMachines".equals(fieldName)) { + List computeMachines + = reader.readArray(reader1 -> MachineSkuSlot.fromJson(reader1)); + deserializedRackSkuProperties.computeMachines = computeMachines; + } else if ("controllerMachines".equals(fieldName)) { + List controllerMachines + = reader.readArray(reader1 -> MachineSkuSlot.fromJson(reader1)); + deserializedRackSkuProperties.controllerMachines = controllerMachines; + } else if ("description".equals(fieldName)) { + deserializedRackSkuProperties.description = reader.getString(); + } else if ("maxClusterSlots".equals(fieldName)) { + deserializedRackSkuProperties.maxClusterSlots = reader.getNullable(JsonReader::getLong); + } else if ("provisioningState".equals(fieldName)) { + deserializedRackSkuProperties.provisioningState + = RackSkuProvisioningState.fromString(reader.getString()); + } else if ("rackType".equals(fieldName)) { + deserializedRackSkuProperties.rackType = RackSkuType.fromString(reader.getString()); + } else if ("storageAppliances".equals(fieldName)) { + List storageAppliances + = reader.readArray(reader1 -> StorageApplianceSkuSlot.fromJson(reader1)); + deserializedRackSkuProperties.storageAppliances = storageAppliances; + } else if ("supportedRackSkuIds".equals(fieldName)) { + List supportedRackSkuIds = reader.readArray(reader1 -> reader1.getString()); + deserializedRackSkuProperties.supportedRackSkuIds = supportedRackSkuIds; + } else { + reader.skipChildren(); + } + } + + return deserializedRackSkuProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java index 33830146494d3..a23623f1a0016 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.networkcloud.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; -/** RacksPatchProperties represents the properties of the rack during patching. */ +/** + * RacksPatchProperties represents the properties of the rack during patching. + */ @Fluent -public final class RacksPatchProperties { +public final class RacksPatchProperties implements JsonSerializable { /* * The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) */ - @JsonProperty(value = "rackLocation") private String rackLocation; /* * The globally unique identifier for the rack. */ - @JsonProperty(value = "rackSerialNumber") private String rackSerialNumber; - /** Creates an instance of RacksPatchProperties class. */ + /** + * Creates an instance of RacksPatchProperties class. + */ public RacksPatchProperties() { } /** * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @return the rackLocation value. */ public String rackLocation() { @@ -39,7 +45,7 @@ public String rackLocation() { /** * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @param rackLocation the rackLocation value to set. * @return the RacksPatchProperties object itself. */ @@ -50,7 +56,7 @@ public RacksPatchProperties withRackLocation(String rackLocation) { /** * Get the rackSerialNumber property: The globally unique identifier for the rack. - * + * * @return the rackSerialNumber value. */ public String rackSerialNumber() { @@ -59,7 +65,7 @@ public String rackSerialNumber() { /** * Set the rackSerialNumber property: The globally unique identifier for the rack. - * + * * @param rackSerialNumber the rackSerialNumber value to set. * @return the RacksPatchProperties object itself. */ @@ -70,9 +76,48 @@ public RacksPatchProperties withRackSerialNumber(String rackSerialNumber) { /** * 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("rackLocation", this.rackLocation); + jsonWriter.writeStringField("rackSerialNumber", this.rackSerialNumber); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RacksPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RacksPatchProperties 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 RacksPatchProperties. + */ + public static RacksPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RacksPatchProperties deserializedRacksPatchProperties = new RacksPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rackLocation".equals(fieldName)) { + deserializedRacksPatchProperties.rackLocation = reader.getString(); + } else if ("rackSerialNumber".equals(fieldName)) { + deserializedRacksPatchProperties.rackSerialNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRacksPatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java index 612b1ea18951c..014c7c9c52054 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java @@ -8,50 +8,64 @@ import com.azure.core.management.Resource; 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.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.util.List; import java.util.Map; -/** StorageAppliance represents on-premises Network Cloud storage appliance. */ +/** + * StorageAppliance represents on-premises Network Cloud storage appliance. + */ @Fluent public final class StorageApplianceInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * StorageApplianceProperties represents the properties of the storage appliance. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private StorageApplianceProperties innerProperties = new StorageApplianceProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of StorageApplianceInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of StorageApplianceInner class. + */ public StorageApplianceInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -59,11 +73,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the StorageApplianceInner object itself. */ @@ -73,10 +84,8 @@ public StorageApplianceInner withExtendedLocation(ExtendedLocation extendedLocat } /** - * Get the innerProperties property: StorageApplianceProperties represents the properties of the storage appliance. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private StorageApplianceProperties innerProperties() { @@ -85,21 +94,55 @@ private StorageApplianceProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public StorageApplianceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public StorageApplianceInner withTags(Map tags) { super.withTags(tags); @@ -107,11 +150,9 @@ public StorageApplianceInner withTags(Map tags) { } /** - * Get the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Get the administratorCredentials property: The credentials of the administrative interface on this storage + * appliance. + * * @return the administratorCredentials value. */ public AdministrativeCredentials administratorCredentials() { @@ -119,11 +160,9 @@ public AdministrativeCredentials administratorCredentials() { } /** - * Set the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Set the administratorCredentials property: The credentials of the administrative interface on this storage + * appliance. + * * @param administratorCredentials the administratorCredentials value to set. * @return the StorageApplianceInner object itself. */ @@ -136,8 +175,8 @@ public StorageApplianceInner withAdministratorCredentials(AdministrativeCredenti } /** - * Get the capacity property: The total capacity of the storage appliance. - * + * Get the capacity property: The total capacity of the storage appliance. Measured in GiB. + * * @return the capacity value. */ public Long capacity() { @@ -146,7 +185,7 @@ public Long capacity() { /** * Get the capacityUsed property: The amount of storage consumed. - * + * * @return the capacityUsed value. */ public Long capacityUsed() { @@ -154,8 +193,9 @@ public Long capacityUsed() { } /** - * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. - * + * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. Measured in + * GiB. + * * @return the clusterId value. */ public String clusterId() { @@ -164,7 +204,7 @@ public String clusterId() { /** * Get the detailedStatus property: The detailed status of the storage appliance. - * + * * @return the detailedStatus value. */ public StorageApplianceDetailedStatus detailedStatus() { @@ -173,7 +213,7 @@ public StorageApplianceDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -182,16 +222,34 @@ public String detailedStatusMessage() { /** * Get the managementIpv4Address property: The endpoint for the management interface of the storage appliance. - * + * * @return the managementIpv4Address value. */ public String managementIpv4Address() { return this.innerProperties() == null ? null : this.innerProperties().managementIpv4Address(); } + /** + * Get the manufacturer property: The manufacturer of the storage appliance. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.innerProperties() == null ? null : this.innerProperties().manufacturer(); + } + + /** + * Get the model property: The model of the storage appliance. + * + * @return the model value. + */ + public String model() { + return this.innerProperties() == null ? null : this.innerProperties().model(); + } + /** * Get the provisioningState property: The provisioning state of the storage appliance. - * + * * @return the provisioningState value. */ public StorageApplianceProvisioningState provisioningState() { @@ -200,7 +258,7 @@ public StorageApplianceProvisioningState provisioningState() { /** * Get the rackId property: The resource ID of the rack where this storage appliance resides. - * + * * @return the rackId value. */ public String rackId() { @@ -209,7 +267,7 @@ public String rackId() { /** * Set the rackId property: The resource ID of the rack where this storage appliance resides. - * + * * @param rackId the rackId value to set. * @return the StorageApplianceInner object itself. */ @@ -223,7 +281,7 @@ public StorageApplianceInner withRackId(String rackId) { /** * Get the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -232,7 +290,7 @@ public long rackSlot() { /** * Set the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. - * + * * @param rackSlot the rackSlot value to set. * @return the StorageApplianceInner object itself. */ @@ -247,7 +305,7 @@ public StorageApplianceInner withRackSlot(long rackSlot) { /** * Get the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote * vendor management. - * + * * @return the remoteVendorManagementFeature value. */ public RemoteVendorManagementFeature remoteVendorManagementFeature() { @@ -257,16 +315,25 @@ public RemoteVendorManagementFeature remoteVendorManagementFeature() { /** * Get the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is * enabled or disabled, or unsupported if it is an unsupported feature. - * + * * @return the remoteVendorManagementStatus value. */ public RemoteVendorManagementStatus remoteVendorManagementStatus() { return this.innerProperties() == null ? null : this.innerProperties().remoteVendorManagementStatus(); } + /** + * Get the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + public List secretRotationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().secretRotationStatus(); + } + /** * Get the serialNumber property: The serial number for the storage appliance. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -275,7 +342,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number for the storage appliance. - * + * * @param serialNumber the serialNumber value to set. * @return the StorageApplianceInner object itself. */ @@ -289,7 +356,7 @@ public StorageApplianceInner withSerialNumber(String serialNumber) { /** * Get the storageApplianceSkuId property: The SKU for the storage appliance. - * + * * @return the storageApplianceSkuId value. */ public String storageApplianceSkuId() { @@ -298,7 +365,7 @@ public String storageApplianceSkuId() { /** * Set the storageApplianceSkuId property: The SKU for the storage appliance. - * + * * @param storageApplianceSkuId the storageApplianceSkuId value to set. * @return the StorageApplianceInner object itself. */ @@ -310,25 +377,91 @@ public StorageApplianceInner withStorageApplianceSkuId(String storageApplianceSk return this; } + /** + * Get the version property: The version of the storage appliance. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model StorageApplianceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model StorageApplianceInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model StorageApplianceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model StorageApplianceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceInner 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 StorageApplianceInner. + */ + public static StorageApplianceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceInner deserializedStorageApplianceInner = new StorageApplianceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageApplianceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageApplianceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageApplianceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedStorageApplianceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageApplianceInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageApplianceInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageApplianceInner.innerProperties = StorageApplianceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStorageApplianceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java index 27056f1b73482..e06efccf17bee 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.networkcloud.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; -/** StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. */ +/** + * StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. + */ @Fluent -public final class StorageAppliancePatchProperties { +public final class StorageAppliancePatchProperties implements JsonSerializable { /* * The serial number for the storage appliance. */ - @JsonProperty(value = "serialNumber") private String serialNumber; - /** Creates an instance of StorageAppliancePatchProperties class. */ + /** + * Creates an instance of StorageAppliancePatchProperties class. + */ public StorageAppliancePatchProperties() { } /** * Get the serialNumber property: The serial number for the storage appliance. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -31,7 +38,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number for the storage appliance. - * + * * @param serialNumber the serialNumber value to set. * @return the StorageAppliancePatchProperties object itself. */ @@ -42,9 +49,46 @@ public StorageAppliancePatchProperties withSerialNumber(String serialNumber) { /** * 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("serialNumber", this.serialNumber); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAppliancePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAppliancePatchProperties 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 StorageAppliancePatchProperties. + */ + public static StorageAppliancePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAppliancePatchProperties deserializedStorageAppliancePatchProperties + = new StorageAppliancePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serialNumber".equals(fieldName)) { + deserializedStorageAppliancePatchProperties.serialNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAppliancePatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java index 8e4c6989a83b5..58b6eb3969ffc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java @@ -6,114 +6,125 @@ 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.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.util.List; -/** StorageApplianceProperties represents the properties of the storage appliance. */ +/** + * StorageApplianceProperties represents the properties of the storage appliance. + */ @Fluent -public final class StorageApplianceProperties { +public final class StorageApplianceProperties implements JsonSerializable { /* - * AdministrativeCredentials represents the admin credentials for the device requiring password-based - * authentication. - * * The credentials of the administrative interface on this storage appliance. */ - @JsonProperty(value = "administratorCredentials", required = true) private AdministrativeCredentials administratorCredentials; /* - * The total capacity of the storage appliance. + * The total capacity of the storage appliance. Measured in GiB. */ - @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) private Long capacity; /* * The amount of storage consumed. */ - @JsonProperty(value = "capacityUsed", access = JsonProperty.Access.WRITE_ONLY) private Long capacityUsed; /* - * The resource ID of the cluster this storage appliance is associated with. + * The resource ID of the cluster this storage appliance is associated with. Measured in GiB. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The detailed status of the storage appliance. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private StorageApplianceDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The endpoint for the management interface of the storage appliance. */ - @JsonProperty(value = "managementIpv4Address", access = JsonProperty.Access.WRITE_ONLY) private String managementIpv4Address; + /* + * The manufacturer of the storage appliance. + */ + private String manufacturer; + + /* + * The model of the storage appliance. + */ + private String model; + /* * The provisioning state of the storage appliance. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private StorageApplianceProvisioningState provisioningState; /* * The resource ID of the rack where this storage appliance resides. */ - @JsonProperty(value = "rackId", required = true) private String rackId; /* * The slot the storage appliance is in the rack based on the BOM configuration. */ - @JsonProperty(value = "rackSlot", required = true) private long rackSlot; /* * The indicator of whether the storage appliance supports remote vendor management. */ - @JsonProperty(value = "remoteVendorManagementFeature", access = JsonProperty.Access.WRITE_ONLY) private RemoteVendorManagementFeature remoteVendorManagementFeature; /* * The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an * unsupported feature. */ - @JsonProperty(value = "remoteVendorManagementStatus", access = JsonProperty.Access.WRITE_ONLY) private RemoteVendorManagementStatus remoteVendorManagementStatus; + /* + * The list of statuses that represent secret rotation activity. + */ + private List secretRotationStatus; + /* * The serial number for the storage appliance. */ - @JsonProperty(value = "serialNumber", required = true) private String serialNumber; /* * The SKU for the storage appliance. */ - @JsonProperty(value = "storageApplianceSkuId", required = true) private String storageApplianceSkuId; - /** Creates an instance of StorageApplianceProperties class. */ + /* + * The version of the storage appliance. + */ + private String version; + + /** + * Creates an instance of StorageApplianceProperties class. + */ public StorageApplianceProperties() { } /** - * Get the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Get the administratorCredentials property: The credentials of the administrative interface on this storage + * appliance. + * * @return the administratorCredentials value. */ public AdministrativeCredentials administratorCredentials() { @@ -121,11 +132,9 @@ public AdministrativeCredentials administratorCredentials() { } /** - * Set the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Set the administratorCredentials property: The credentials of the administrative interface on this storage + * appliance. + * * @param administratorCredentials the administratorCredentials value to set. * @return the StorageApplianceProperties object itself. */ @@ -135,8 +144,8 @@ public StorageApplianceProperties withAdministratorCredentials(AdministrativeCre } /** - * Get the capacity property: The total capacity of the storage appliance. - * + * Get the capacity property: The total capacity of the storage appliance. Measured in GiB. + * * @return the capacity value. */ public Long capacity() { @@ -145,7 +154,7 @@ public Long capacity() { /** * Get the capacityUsed property: The amount of storage consumed. - * + * * @return the capacityUsed value. */ public Long capacityUsed() { @@ -153,8 +162,9 @@ public Long capacityUsed() { } /** - * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. - * + * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. Measured in + * GiB. + * * @return the clusterId value. */ public String clusterId() { @@ -163,7 +173,7 @@ public String clusterId() { /** * Get the detailedStatus property: The detailed status of the storage appliance. - * + * * @return the detailedStatus value. */ public StorageApplianceDetailedStatus detailedStatus() { @@ -172,7 +182,7 @@ public StorageApplianceDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -181,16 +191,34 @@ public String detailedStatusMessage() { /** * Get the managementIpv4Address property: The endpoint for the management interface of the storage appliance. - * + * * @return the managementIpv4Address value. */ public String managementIpv4Address() { return this.managementIpv4Address; } + /** + * Get the manufacturer property: The manufacturer of the storage appliance. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.manufacturer; + } + + /** + * Get the model property: The model of the storage appliance. + * + * @return the model value. + */ + public String model() { + return this.model; + } + /** * Get the provisioningState property: The provisioning state of the storage appliance. - * + * * @return the provisioningState value. */ public StorageApplianceProvisioningState provisioningState() { @@ -199,7 +227,7 @@ public StorageApplianceProvisioningState provisioningState() { /** * Get the rackId property: The resource ID of the rack where this storage appliance resides. - * + * * @return the rackId value. */ public String rackId() { @@ -208,7 +236,7 @@ public String rackId() { /** * Set the rackId property: The resource ID of the rack where this storage appliance resides. - * + * * @param rackId the rackId value to set. * @return the StorageApplianceProperties object itself. */ @@ -219,7 +247,7 @@ public StorageApplianceProperties withRackId(String rackId) { /** * Get the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -228,7 +256,7 @@ public long rackSlot() { /** * Set the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. - * + * * @param rackSlot the rackSlot value to set. * @return the StorageApplianceProperties object itself. */ @@ -240,7 +268,7 @@ public StorageApplianceProperties withRackSlot(long rackSlot) { /** * Get the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote * vendor management. - * + * * @return the remoteVendorManagementFeature value. */ public RemoteVendorManagementFeature remoteVendorManagementFeature() { @@ -250,16 +278,25 @@ public RemoteVendorManagementFeature remoteVendorManagementFeature() { /** * Get the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is * enabled or disabled, or unsupported if it is an unsupported feature. - * + * * @return the remoteVendorManagementStatus value. */ public RemoteVendorManagementStatus remoteVendorManagementStatus() { return this.remoteVendorManagementStatus; } + /** + * Get the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + public List secretRotationStatus() { + return this.secretRotationStatus; + } + /** * Get the serialNumber property: The serial number for the storage appliance. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -268,7 +305,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number for the storage appliance. - * + * * @param serialNumber the serialNumber value to set. * @return the StorageApplianceProperties object itself. */ @@ -279,7 +316,7 @@ public StorageApplianceProperties withSerialNumber(String serialNumber) { /** * Get the storageApplianceSkuId property: The SKU for the storage appliance. - * + * * @return the storageApplianceSkuId value. */ public String storageApplianceSkuId() { @@ -288,7 +325,7 @@ public String storageApplianceSkuId() { /** * Set the storageApplianceSkuId property: The SKU for the storage appliance. - * + * * @param storageApplianceSkuId the storageApplianceSkuId value to set. * @return the StorageApplianceProperties object itself. */ @@ -297,31 +334,129 @@ public StorageApplianceProperties withStorageApplianceSkuId(String storageApplia return this; } + /** + * Get the version property: The version of the storage appliance. + * + * @return the version value. + */ + public String version() { + return this.version; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (administratorCredentials() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property administratorCredentials in model StorageApplianceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property administratorCredentials in model StorageApplianceProperties")); } else { administratorCredentials().validate(); } if (rackId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackId in model StorageApplianceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rackId in model StorageApplianceProperties")); + } + if (secretRotationStatus() != null) { + secretRotationStatus().forEach(e -> e.validate()); } if (serialNumber() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serialNumber in model StorageApplianceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serialNumber in model StorageApplianceProperties")); } if (storageApplianceSkuId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property storageApplianceSkuId in model StorageApplianceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageApplianceSkuId in model StorageApplianceProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("administratorCredentials", this.administratorCredentials); + jsonWriter.writeStringField("rackId", this.rackId); + jsonWriter.writeLongField("rackSlot", this.rackSlot); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("storageApplianceSkuId", this.storageApplianceSkuId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceProperties 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 StorageApplianceProperties. + */ + public static StorageApplianceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceProperties deserializedStorageApplianceProperties = new StorageApplianceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorCredentials".equals(fieldName)) { + deserializedStorageApplianceProperties.administratorCredentials + = AdministrativeCredentials.fromJson(reader); + } else if ("rackId".equals(fieldName)) { + deserializedStorageApplianceProperties.rackId = reader.getString(); + } else if ("rackSlot".equals(fieldName)) { + deserializedStorageApplianceProperties.rackSlot = reader.getLong(); + } else if ("serialNumber".equals(fieldName)) { + deserializedStorageApplianceProperties.serialNumber = reader.getString(); + } else if ("storageApplianceSkuId".equals(fieldName)) { + deserializedStorageApplianceProperties.storageApplianceSkuId = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedStorageApplianceProperties.capacity = reader.getNullable(JsonReader::getLong); + } else if ("capacityUsed".equals(fieldName)) { + deserializedStorageApplianceProperties.capacityUsed = reader.getNullable(JsonReader::getLong); + } else if ("clusterId".equals(fieldName)) { + deserializedStorageApplianceProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedStorageApplianceProperties.detailedStatus + = StorageApplianceDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedStorageApplianceProperties.detailedStatusMessage = reader.getString(); + } else if ("managementIpv4Address".equals(fieldName)) { + deserializedStorageApplianceProperties.managementIpv4Address = reader.getString(); + } else if ("manufacturer".equals(fieldName)) { + deserializedStorageApplianceProperties.manufacturer = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedStorageApplianceProperties.model = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageApplianceProperties.provisioningState + = StorageApplianceProvisioningState.fromString(reader.getString()); + } else if ("remoteVendorManagementFeature".equals(fieldName)) { + deserializedStorageApplianceProperties.remoteVendorManagementFeature + = RemoteVendorManagementFeature.fromString(reader.getString()); + } else if ("remoteVendorManagementStatus".equals(fieldName)) { + deserializedStorageApplianceProperties.remoteVendorManagementStatus + = RemoteVendorManagementStatus.fromString(reader.getString()); + } else if ("secretRotationStatus".equals(fieldName)) { + List secretRotationStatus + = reader.readArray(reader1 -> SecretRotationStatus.fromJson(reader1)); + deserializedStorageApplianceProperties.secretRotationStatus = secretRotationStatus; + } else if ("version".equals(fieldName)) { + deserializedStorageApplianceProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java index cbaefbff094cd..bf1c5610d7f03 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.networkcloud.fluent.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; -/** StorageApplianceSkuProperties represents the properties of the storage appliance SKU. */ +/** + * StorageApplianceSkuProperties represents the properties of the storage appliance SKU. + */ @Immutable -public final class StorageApplianceSkuProperties { +public final class StorageApplianceSkuProperties implements JsonSerializable { /* - * The maximum capacity of the storage appliance. + * The maximum capacity of the storage appliance. Measured in gibibytes. */ - @JsonProperty(value = "capacityGB", access = JsonProperty.Access.WRITE_ONLY) private Long capacityGB; /* * The model of the storage appliance. */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) private String model; - /** Creates an instance of StorageApplianceSkuProperties class. */ + /** + * Creates an instance of StorageApplianceSkuProperties class. + */ public StorageApplianceSkuProperties() { } /** - * Get the capacityGB property: The maximum capacity of the storage appliance. - * + * Get the capacityGB property: The maximum capacity of the storage appliance. Measured in gibibytes. + * * @return the capacityGB value. */ public Long capacityGB() { @@ -37,7 +43,7 @@ public Long capacityGB() { /** * Get the model property: The model of the storage appliance. - * + * * @return the model value. */ public String model() { @@ -46,9 +52,47 @@ public String model() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceSkuProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceSkuProperties 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 StorageApplianceSkuProperties. + */ + public static StorageApplianceSkuProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceSkuProperties deserializedStorageApplianceSkuProperties + = new StorageApplianceSkuProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityGB".equals(fieldName)) { + deserializedStorageApplianceSkuProperties.capacityGB = reader.getNullable(JsonReader::getLong); + } else if ("model".equals(fieldName)) { + deserializedStorageApplianceSkuProperties.model = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceSkuProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java index cbf36af356770..0225409e96acb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java @@ -8,11 +8,14 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -23,37 +26,44 @@ @Fluent public final class TrunkedNetworkInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * TrunkedNetworkProperties represents properties of the trunked network. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private TrunkedNetworkProperties innerProperties = new TrunkedNetworkProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of TrunkedNetworkInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TrunkedNetworkInner class. + */ public TrunkedNetworkInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,11 +71,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the TrunkedNetworkInner object itself. */ @@ -75,10 +82,8 @@ public TrunkedNetworkInner withExtendedLocation(ExtendedLocation extendedLocatio } /** - * Get the innerProperties property: TrunkedNetworkProperties represents properties of the trunked network. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private TrunkedNetworkProperties innerProperties() { @@ -87,21 +92,55 @@ private TrunkedNetworkProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public TrunkedNetworkInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TrunkedNetworkInner withTags(Map tags) { super.withTags(tags); @@ -111,7 +150,7 @@ public TrunkedNetworkInner withTags(Map tags) { /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -120,7 +159,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -129,7 +168,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the trunked network. - * + * * @return the detailedStatus value. */ public TrunkedNetworkDetailedStatus detailedStatus() { @@ -138,7 +177,7 @@ public TrunkedNetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -148,7 +187,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this trunked network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -158,7 +197,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -168,7 +207,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the TrunkedNetworkInner object itself. */ @@ -183,7 +222,7 @@ public TrunkedNetworkInner withHybridAksPluginType(HybridAksPluginType hybridAks /** * Get the interfaceName property: The default interface name for this trunked network in the virtual machine. This * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -193,7 +232,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this trunked network in the virtual machine. This * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the TrunkedNetworkInner object itself. */ @@ -208,7 +247,7 @@ public TrunkedNetworkInner withInterfaceName(String interfaceName) { /** * Get the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. - * + * * @return the isolationDomainIds value. */ public List isolationDomainIds() { @@ -218,7 +257,7 @@ public List isolationDomainIds() { /** * Set the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. - * + * * @param isolationDomainIds the isolationDomainIds value to set. * @return the TrunkedNetworkInner object itself. */ @@ -232,7 +271,7 @@ public TrunkedNetworkInner withIsolationDomainIds(List isolationDomainId /** * Get the provisioningState property: The provisioning state of the trunked network. - * + * * @return the provisioningState value. */ public TrunkedNetworkProvisioningState provisioningState() { @@ -243,7 +282,7 @@ public TrunkedNetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -252,7 +291,7 @@ public List virtualMachinesAssociatedIds() { /** * Get the vlans property: The list of vlans that are selected from the isolation domains for trunking. - * + * * @return the vlans value. */ public List vlans() { @@ -261,7 +300,7 @@ public List vlans() { /** * Set the vlans property: The list of vlans that are selected from the isolation domains for trunking. - * + * * @param vlans the vlans value to set. * @return the TrunkedNetworkInner object itself. */ @@ -275,23 +314,80 @@ public TrunkedNetworkInner withVlans(List vlans) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model TrunkedNetworkInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model TrunkedNetworkInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model TrunkedNetworkInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model TrunkedNetworkInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworkInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrunkedNetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrunkedNetworkInner 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 TrunkedNetworkInner. + */ + public static TrunkedNetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrunkedNetworkInner deserializedTrunkedNetworkInner = new TrunkedNetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTrunkedNetworkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTrunkedNetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTrunkedNetworkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedTrunkedNetworkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTrunkedNetworkInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedTrunkedNetworkInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedTrunkedNetworkInner.innerProperties = TrunkedNetworkProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTrunkedNetworkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrunkedNetworkInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java index d2bb349712bbe..78ea6eb1fc043 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java @@ -6,94 +6,91 @@ 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.networkcloud.models.HybridAksPluginType; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** TrunkedNetworkProperties represents properties of the trunked network. */ +/** + * TrunkedNetworkProperties represents properties of the trunked network. + */ @Fluent -public final class TrunkedNetworkProperties { +public final class TrunkedNetworkProperties implements JsonSerializable { /* * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. */ - @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY) private List associatedResourceIds; /* * The resource ID of the Network Cloud cluster this trunked network is associated with. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; /* * The more detailed status of the trunked network. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private TrunkedNetworkDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are * associated with this trunked network. */ - @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List hybridAksClustersAssociatedIds; /* * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. * The network plugin type for Hybrid AKS. */ - @JsonProperty(value = "hybridAksPluginType") private HybridAksPluginType hybridAksPluginType; /* * The default interface name for this trunked network in the virtual machine. This name can be overridden by the * name supplied in the network attachment configuration of that virtual machine. */ - @JsonProperty(value = "interfaceName") private String interfaceName; /* * The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of * l2IsolationDomain and l3IsolationDomain resources. */ - @JsonProperty(value = "isolationDomainIds", required = true) private List isolationDomainIds; /* * The provisioning state of the trunked network. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private TrunkedNetworkProvisioningState provisioningState; /* * Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any * Hybrid AKS virtual machines, that are currently using this trunked network. */ - @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) private List virtualMachinesAssociatedIds; /* * The list of vlans that are selected from the isolation domains for trunking. */ - @JsonProperty(value = "vlans", required = true) private List vlans; - /** Creates an instance of TrunkedNetworkProperties class. */ + /** + * Creates an instance of TrunkedNetworkProperties class. + */ public TrunkedNetworkProperties() { } /** * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ public List associatedResourceIds() { @@ -102,7 +99,7 @@ public List associatedResourceIds() { /** * Get the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated with. - * + * * @return the clusterId value. */ public String clusterId() { @@ -111,7 +108,7 @@ public String clusterId() { /** * Get the detailedStatus property: The more detailed status of the trunked network. - * + * * @return the detailedStatus value. */ public TrunkedNetworkDetailedStatus detailedStatus() { @@ -120,7 +117,7 @@ public TrunkedNetworkDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -130,7 +127,7 @@ public String detailedStatusMessage() { /** * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this trunked network. - * + * * @return the hybridAksClustersAssociatedIds value. */ public List hybridAksClustersAssociatedIds() { @@ -140,7 +137,7 @@ public List hybridAksClustersAssociatedIds() { /** * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ public HybridAksPluginType hybridAksPluginType() { @@ -150,7 +147,7 @@ public HybridAksPluginType hybridAksPluginType() { /** * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @param hybridAksPluginType the hybridAksPluginType value to set. * @return the TrunkedNetworkProperties object itself. */ @@ -162,7 +159,7 @@ public TrunkedNetworkProperties withHybridAksPluginType(HybridAksPluginType hybr /** * Get the interfaceName property: The default interface name for this trunked network in the virtual machine. This * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ public String interfaceName() { @@ -172,7 +169,7 @@ public String interfaceName() { /** * Set the interfaceName property: The default interface name for this trunked network in the virtual machine. This * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @param interfaceName the interfaceName value to set. * @return the TrunkedNetworkProperties object itself. */ @@ -184,7 +181,7 @@ public TrunkedNetworkProperties withInterfaceName(String interfaceName) { /** * Get the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. - * + * * @return the isolationDomainIds value. */ public List isolationDomainIds() { @@ -194,7 +191,7 @@ public List isolationDomainIds() { /** * Set the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. - * + * * @param isolationDomainIds the isolationDomainIds value to set. * @return the TrunkedNetworkProperties object itself. */ @@ -205,7 +202,7 @@ public TrunkedNetworkProperties withIsolationDomainIds(List isolationDom /** * Get the provisioningState property: The provisioning state of the trunked network. - * + * * @return the provisioningState value. */ public TrunkedNetworkProvisioningState provisioningState() { @@ -216,7 +213,7 @@ public TrunkedNetworkProvisioningState provisioningState() { * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked * network. - * + * * @return the virtualMachinesAssociatedIds value. */ public List virtualMachinesAssociatedIds() { @@ -225,7 +222,7 @@ public List virtualMachinesAssociatedIds() { /** * Get the vlans property: The list of vlans that are selected from the isolation domains for trunking. - * + * * @return the vlans value. */ public List vlans() { @@ -234,7 +231,7 @@ public List vlans() { /** * Set the vlans property: The list of vlans that are selected from the isolation domains for trunking. - * + * * @param vlans the vlans value to set. * @return the TrunkedNetworkProperties object itself. */ @@ -245,19 +242,91 @@ public TrunkedNetworkProperties withVlans(List vlans) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (isolationDomainIds() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property isolationDomainIds in model TrunkedNetworkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property isolationDomainIds in model TrunkedNetworkProperties")); } if (vlans() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vlans in model TrunkedNetworkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vlans in model TrunkedNetworkProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworkProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("isolationDomainIds", this.isolationDomainIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("vlans", this.vlans, (writer, element) -> writer.writeLong(element)); + jsonWriter.writeStringField("hybridAksPluginType", + this.hybridAksPluginType == null ? null : this.hybridAksPluginType.toString()); + jsonWriter.writeStringField("interfaceName", this.interfaceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrunkedNetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrunkedNetworkProperties 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 TrunkedNetworkProperties. + */ + public static TrunkedNetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrunkedNetworkProperties deserializedTrunkedNetworkProperties = new TrunkedNetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationDomainIds".equals(fieldName)) { + List isolationDomainIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTrunkedNetworkProperties.isolationDomainIds = isolationDomainIds; + } else if ("vlans".equals(fieldName)) { + List vlans = reader.readArray(reader1 -> reader1.getLong()); + deserializedTrunkedNetworkProperties.vlans = vlans; + } else if ("associatedResourceIds".equals(fieldName)) { + List associatedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTrunkedNetworkProperties.associatedResourceIds = associatedResourceIds; + } else if ("clusterId".equals(fieldName)) { + deserializedTrunkedNetworkProperties.clusterId = reader.getString(); + } else if ("detailedStatus".equals(fieldName)) { + deserializedTrunkedNetworkProperties.detailedStatus + = TrunkedNetworkDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedTrunkedNetworkProperties.detailedStatusMessage = reader.getString(); + } else if ("hybridAksClustersAssociatedIds".equals(fieldName)) { + List hybridAksClustersAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTrunkedNetworkProperties.hybridAksClustersAssociatedIds + = hybridAksClustersAssociatedIds; + } else if ("hybridAksPluginType".equals(fieldName)) { + deserializedTrunkedNetworkProperties.hybridAksPluginType + = HybridAksPluginType.fromString(reader.getString()); + } else if ("interfaceName".equals(fieldName)) { + deserializedTrunkedNetworkProperties.interfaceName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedTrunkedNetworkProperties.provisioningState + = TrunkedNetworkProvisioningState.fromString(reader.getString()); + } else if ("virtualMachinesAssociatedIds".equals(fieldName)) { + List virtualMachinesAssociatedIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTrunkedNetworkProperties.virtualMachinesAssociatedIds = virtualMachinesAssociatedIds; + } else { + reader.skipChildren(); + } + } + + return deserializedTrunkedNetworkProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java index 0d927f2f26517..99a70523bda43 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; @@ -21,45 +24,54 @@ import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerState; import com.azure.resourcemanager.networkcloud.models.VirtualMachineProvisioningState; import com.azure.resourcemanager.networkcloud.models.VirtualMachineVirtioInterfaceType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** VirtualMachine represents the on-premises Network Cloud virtual machine. */ +/** + * VirtualMachine represents the on-premises Network Cloud virtual machine. + */ @Fluent public final class VirtualMachineInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * VirtualMachineProperties represents the properties of the virtual machine. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of VirtualMachineInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of VirtualMachineInner class. + */ public VirtualMachineInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -67,11 +79,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the VirtualMachineInner object itself. */ @@ -81,10 +90,8 @@ public VirtualMachineInner withExtendedLocation(ExtendedLocation extendedLocatio } /** - * Get the innerProperties property: VirtualMachineProperties represents the properties of the virtual machine. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private VirtualMachineProperties innerProperties() { @@ -93,21 +100,55 @@ private VirtualMachineProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public VirtualMachineInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VirtualMachineInner withTags(Map tags) { super.withTags(tags); @@ -117,7 +158,7 @@ public VirtualMachineInner withTags(Map tags) { /** * Get the adminUsername property: The name of the administrator to which the ssh public keys will be added into the * authorized keys. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -127,7 +168,7 @@ public String adminUsername() { /** * Set the adminUsername property: The name of the administrator to which the ssh public keys will be added into the * authorized keys. - * + * * @param adminUsername the adminUsername value to set. * @return the VirtualMachineInner object itself. */ @@ -141,7 +182,7 @@ public VirtualMachineInner withAdminUsername(String adminUsername) { /** * Get the availabilityZone property: The cluster availability zone containing this virtual machine. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -149,8 +190,8 @@ public String availabilityZone() { } /** - * Get the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed to. - * + * Get the bareMetalMachineId property: The resource ID of the bare metal machine that hosts the virtual machine. + * * @return the bareMetalMachineId value. */ public String bareMetalMachineId() { @@ -159,7 +200,7 @@ public String bareMetalMachineId() { /** * Get the bootMethod property: Selects the boot method for the virtual machine. - * + * * @return the bootMethod value. */ public VirtualMachineBootMethod bootMethod() { @@ -168,7 +209,7 @@ public VirtualMachineBootMethod bootMethod() { /** * Set the bootMethod property: Selects the boot method for the virtual machine. - * + * * @param bootMethod the bootMethod value to set. * @return the VirtualMachineInner object itself. */ @@ -181,10 +222,9 @@ public VirtualMachineInner withBootMethod(VirtualMachineBootMethod bootMethod) { } /** - * Get the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine. - * + * Get the cloudServicesNetworkAttachment property: The cloud service network that provides platform-level services + * for the virtual machine. + * * @return the cloudServicesNetworkAttachment value. */ public NetworkAttachment cloudServicesNetworkAttachment() { @@ -192,10 +232,9 @@ public NetworkAttachment cloudServicesNetworkAttachment() { } /** - * Set the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine. - * + * Set the cloudServicesNetworkAttachment property: The cloud service network that provides platform-level services + * for the virtual machine. + * * @param cloudServicesNetworkAttachment the cloudServicesNetworkAttachment value to set. * @return the VirtualMachineInner object itself. */ @@ -209,16 +248,39 @@ public VirtualMachineInner withCloudServicesNetworkAttachment(NetworkAttachment /** * Get the clusterId property: The resource ID of the cluster the virtual machine is created for. - * + * * @return the clusterId value. */ public String clusterId() { return this.innerProperties() == null ? null : this.innerProperties().clusterId(); } + /** + * Get the consoleExtendedLocation property: The extended location to use for creation of a VM console resource. + * + * @return the consoleExtendedLocation value. + */ + public ExtendedLocation consoleExtendedLocation() { + return this.innerProperties() == null ? null : this.innerProperties().consoleExtendedLocation(); + } + + /** + * Set the consoleExtendedLocation property: The extended location to use for creation of a VM console resource. + * + * @param consoleExtendedLocation the consoleExtendedLocation value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withConsoleExtendedLocation(ExtendedLocation consoleExtendedLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withConsoleExtendedLocation(consoleExtendedLocation); + return this; + } + /** * Get the cpuCores property: The number of CPU cores in the virtual machine. - * + * * @return the cpuCores value. */ public long cpuCores() { @@ -227,7 +289,7 @@ public long cpuCores() { /** * Set the cpuCores property: The number of CPU cores in the virtual machine. - * + * * @param cpuCores the cpuCores value to set. * @return the VirtualMachineInner object itself. */ @@ -241,7 +303,7 @@ public VirtualMachineInner withCpuCores(long cpuCores) { /** * Get the detailedStatus property: The more detailed status of the virtual machine. - * + * * @return the detailedStatus value. */ public VirtualMachineDetailedStatus detailedStatus() { @@ -250,7 +312,7 @@ public VirtualMachineDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -260,7 +322,7 @@ public String detailedStatusMessage() { /** * Get the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. - * + * * @return the isolateEmulatorThread value. */ public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { @@ -270,7 +332,7 @@ public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { /** * Set the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. - * + * * @param isolateEmulatorThread the isolateEmulatorThread value to set. * @return the VirtualMachineInner object itself. */ @@ -283,8 +345,8 @@ public VirtualMachineInner withIsolateEmulatorThread(VirtualMachineIsolateEmulat } /** - * Get the memorySizeGB property: The memory size of the virtual machine in GB. - * + * Get the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in gibibytes. + * * @return the memorySizeGB value. */ public long memorySizeGB() { @@ -292,8 +354,8 @@ public long memorySizeGB() { } /** - * Set the memorySizeGB property: The memory size of the virtual machine in GB. - * + * Set the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in gibibytes. + * * @param memorySizeGB the memorySizeGB value to set. * @return the VirtualMachineInner object itself. */ @@ -307,7 +369,7 @@ public VirtualMachineInner withMemorySizeGB(long memorySizeGB) { /** * Get the networkAttachments property: The list of network attachments to the virtual machine. - * + * * @return the networkAttachments value. */ public List networkAttachments() { @@ -316,7 +378,7 @@ public List networkAttachments() { /** * Set the networkAttachments property: The list of network attachments to the virtual machine. - * + * * @param networkAttachments the networkAttachments value to set. * @return the VirtualMachineInner object itself. */ @@ -330,7 +392,7 @@ public VirtualMachineInner withNetworkAttachments(List networ /** * Get the networkData property: The Base64 encoded cloud-init network data. - * + * * @return the networkData value. */ public String networkData() { @@ -339,7 +401,7 @@ public String networkData() { /** * Set the networkData property: The Base64 encoded cloud-init network data. - * + * * @param networkData the networkData value to set. * @return the VirtualMachineInner object itself. */ @@ -353,7 +415,7 @@ public VirtualMachineInner withNetworkData(String networkData) { /** * Get the placementHints property: The scheduling hints for the virtual machine. - * + * * @return the placementHints value. */ public List placementHints() { @@ -362,7 +424,7 @@ public List placementHints() { /** * Set the placementHints property: The scheduling hints for the virtual machine. - * + * * @param placementHints the placementHints value to set. * @return the VirtualMachineInner object itself. */ @@ -376,7 +438,7 @@ public VirtualMachineInner withPlacementHints(List /** * Get the powerState property: The power state of the virtual machine. - * + * * @return the powerState value. */ public VirtualMachinePowerState powerState() { @@ -385,7 +447,7 @@ public VirtualMachinePowerState powerState() { /** * Get the provisioningState property: The provisioning state of the virtual machine. - * + * * @return the provisioningState value. */ public VirtualMachineProvisioningState provisioningState() { @@ -395,7 +457,7 @@ public VirtualMachineProvisioningState provisioningState() { /** * Get the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using * the cloud-init ssh_authorized_keys mechanism for the adminUsername. - * + * * @return the sshPublicKeys value. */ public List sshPublicKeys() { @@ -405,7 +467,7 @@ public List sshPublicKeys() { /** * Set the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using * the cloud-init ssh_authorized_keys mechanism for the adminUsername. - * + * * @param sshPublicKeys the sshPublicKeys value to set. * @return the VirtualMachineInner object itself. */ @@ -418,10 +480,9 @@ public VirtualMachineInner withSshPublicKeys(List sshPublicKeys) { } /** - * Get the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. - * + * Get the storageProfile property: The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. + * * @return the storageProfile value. */ public StorageProfile storageProfile() { @@ -429,10 +490,9 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. - * + * Set the storageProfile property: The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. + * * @param storageProfile the storageProfile value to set. * @return the VirtualMachineInner object itself. */ @@ -446,7 +506,7 @@ public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { /** * Get the userData property: The Base64 encoded cloud-init user data. - * + * * @return the userData value. */ public String userData() { @@ -455,7 +515,7 @@ public String userData() { /** * Set the userData property: The Base64 encoded cloud-init user data. - * + * * @param userData the userData value to set. * @return the VirtualMachineInner object itself. */ @@ -470,7 +530,7 @@ public VirtualMachineInner withUserData(String userData) { /** * Get the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio * interface. - * + * * @return the virtioInterface value. */ public VirtualMachineVirtioInterfaceType virtioInterface() { @@ -480,7 +540,7 @@ public VirtualMachineVirtioInterfaceType virtioInterface() { /** * Set the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio * interface. - * + * * @param virtioInterface the virtioInterface value to set. * @return the VirtualMachineInner object itself. */ @@ -494,7 +554,7 @@ public VirtualMachineInner withVirtioInterface(VirtualMachineVirtioInterfaceType /** * Get the vmDeviceModel property: The type of the device model to use. - * + * * @return the vmDeviceModel value. */ public VirtualMachineDeviceModelType vmDeviceModel() { @@ -503,7 +563,7 @@ public VirtualMachineDeviceModelType vmDeviceModel() { /** * Set the vmDeviceModel property: The type of the device model to use. - * + * * @param vmDeviceModel the vmDeviceModel value to set. * @return the VirtualMachineInner object itself. */ @@ -518,7 +578,7 @@ public VirtualMachineInner withVmDeviceModel(VirtualMachineDeviceModelType vmDev /** * Get the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full * url and tag notation used to pull the image. - * + * * @return the vmImage value. */ public String vmImage() { @@ -528,7 +588,7 @@ public String vmImage() { /** * Set the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full * url and tag notation used to pull the image. - * + * * @param vmImage the vmImage value to set. * @return the VirtualMachineInner object itself. */ @@ -541,11 +601,9 @@ public VirtualMachineInner withVmImage(String vmImage) { } /** - * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Get the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @return the vmImageRepositoryCredentials value. */ public ImageRepositoryCredentials vmImageRepositoryCredentials() { @@ -553,11 +611,9 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { } /** - * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Set the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. * @return the VirtualMachineInner object itself. */ @@ -572,7 +628,7 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { /** * Get the volumes property: The resource IDs of volumes that are attached to the virtual machine. - * + * * @return the volumes value. */ public List volumes() { @@ -581,23 +637,80 @@ public List volumes() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property extendedLocation in model VirtualMachineInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extendedLocation in model VirtualMachineInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model VirtualMachineInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model VirtualMachineInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInner 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 VirtualMachineInner. + */ + public static VirtualMachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInner deserializedVirtualMachineInner = new VirtualMachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVirtualMachineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualMachineInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualMachineInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualMachineInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVirtualMachineInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachineInner.innerProperties = VirtualMachineProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVirtualMachineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java index a739ee5cffde6..ad532bba522a3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java @@ -5,30 +5,33 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.ImageRepositoryCredentials; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. */ +/** + * VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + */ @Fluent -public final class VirtualMachinePatchProperties { +public final class VirtualMachinePatchProperties implements JsonSerializable { /* - * ImageRepositoryCredentials represents the credentials used to login to the image repository. - * * The credentials used to login to the image repository that has access to the specified image. */ - @JsonProperty(value = "vmImageRepositoryCredentials") private ImageRepositoryCredentials vmImageRepositoryCredentials; - /** Creates an instance of VirtualMachinePatchProperties class. */ + /** + * Creates an instance of VirtualMachinePatchProperties class. + */ public VirtualMachinePatchProperties() { } /** - * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Get the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @return the vmImageRepositoryCredentials value. */ public ImageRepositoryCredentials vmImageRepositoryCredentials() { @@ -36,11 +39,9 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { } /** - * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Set the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. * @return the VirtualMachinePatchProperties object itself. */ @@ -52,7 +53,7 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -60,4 +61,42 @@ public void validate() { vmImageRepositoryCredentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vmImageRepositoryCredentials", this.vmImageRepositoryCredentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePatchProperties 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 VirtualMachinePatchProperties. + */ + public static VirtualMachinePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePatchProperties deserializedVirtualMachinePatchProperties + = new VirtualMachinePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmImageRepositoryCredentials".equals(fieldName)) { + deserializedVirtualMachinePatchProperties.vmImageRepositoryCredentials + = ImageRepositoryCredentials.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePatchProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java index 53ceb05966bab..8fff29b36367e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java @@ -6,6 +6,11 @@ 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; import com.azure.resourcemanager.networkcloud.models.SshPublicKey; @@ -18,173 +23,152 @@ import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerState; import com.azure.resourcemanager.networkcloud.models.VirtualMachineProvisioningState; import com.azure.resourcemanager.networkcloud.models.VirtualMachineVirtioInterfaceType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** VirtualMachineProperties represents the properties of the virtual machine. */ +/** + * VirtualMachineProperties represents the properties of the virtual machine. + */ @Fluent -public final class VirtualMachineProperties { +public final class VirtualMachineProperties implements JsonSerializable { /* * The name of the administrator to which the ssh public keys will be added into the authorized keys. */ - @JsonProperty(value = "adminUsername", required = true) private String adminUsername; /* * The cluster availability zone containing this virtual machine. */ - @JsonProperty(value = "availabilityZone", access = JsonProperty.Access.WRITE_ONLY) private String availabilityZone; /* - * The resource ID of the bare metal machine the virtual machine has landed to. + * The resource ID of the bare metal machine that hosts the virtual machine. */ - @JsonProperty(value = "bareMetalMachineId", access = JsonProperty.Access.WRITE_ONLY) private String bareMetalMachineId; /* * Selects the boot method for the virtual machine. */ - @JsonProperty(value = "bootMethod") private VirtualMachineBootMethod bootMethod; /* - * NetworkAttachment represents the single network attachment. - * * The cloud service network that provides platform-level services for the virtual machine. */ - @JsonProperty(value = "cloudServicesNetworkAttachment", required = true) private NetworkAttachment cloudServicesNetworkAttachment; /* * The resource ID of the cluster the virtual machine is created for. */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) private String clusterId; + /* + * The extended location to use for creation of a VM console resource. + */ + private ExtendedLocation consoleExtendedLocation; + /* * The number of CPU cores in the virtual machine. */ - @JsonProperty(value = "cpuCores", required = true) private long cpuCores; /* * The more detailed status of the virtual machine. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private VirtualMachineDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores * is isolated to run the emulator thread for this virtual machine. */ - @JsonProperty(value = "isolateEmulatorThread") private VirtualMachineIsolateEmulatorThread isolateEmulatorThread; /* - * The memory size of the virtual machine in GB. + * The memory size of the virtual machine. Allocations are measured in gibibytes. */ - @JsonProperty(value = "memorySizeGB", required = true) private long memorySizeGB; /* * The list of network attachments to the virtual machine. */ - @JsonProperty(value = "networkAttachments") private List networkAttachments; /* * The Base64 encoded cloud-init network data. */ - @JsonProperty(value = "networkData") private String networkData; /* * The scheduling hints for the virtual machine. */ - @JsonProperty(value = "placementHints") private List placementHints; /* * The power state of the virtual machine. */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) private VirtualMachinePowerState powerState; /* * The provisioning state of the virtual machine. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private VirtualMachineProvisioningState provisioningState; /* * The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init * ssh_authorized_keys mechanism for the adminUsername. */ - @JsonProperty(value = "sshPublicKeys") private List sshPublicKeys; /* - * StorageProfile represents information about a disk. - * * The storage profile that specifies size and other parameters about the disks related to the virtual machine. */ - @JsonProperty(value = "storageProfile", required = true) private StorageProfile storageProfile; /* * The Base64 encoded cloud-init user data. */ - @JsonProperty(value = "userData") private String userData; /* * Field Deprecated, use virtualizationModel instead. The type of the virtio interface. */ - @JsonProperty(value = "virtioInterface") private VirtualMachineVirtioInterfaceType virtioInterface; /* * The type of the device model to use. */ - @JsonProperty(value = "vmDeviceModel") private VirtualMachineDeviceModelType vmDeviceModel; /* * The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used * to pull the image. */ - @JsonProperty(value = "vmImage", required = true) private String vmImage; /* - * ImageRepositoryCredentials represents the credentials used to login to the image repository. - * * The credentials used to login to the image repository that has access to the specified image. */ - @JsonProperty(value = "vmImageRepositoryCredentials") private ImageRepositoryCredentials vmImageRepositoryCredentials; /* * The resource IDs of volumes that are attached to the virtual machine. */ - @JsonProperty(value = "volumes", access = JsonProperty.Access.WRITE_ONLY) private List volumes; - /** Creates an instance of VirtualMachineProperties class. */ + /** + * Creates an instance of VirtualMachineProperties class. + */ public VirtualMachineProperties() { } /** * Get the adminUsername property: The name of the administrator to which the ssh public keys will be added into the * authorized keys. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -194,7 +178,7 @@ public String adminUsername() { /** * Set the adminUsername property: The name of the administrator to which the ssh public keys will be added into the * authorized keys. - * + * * @param adminUsername the adminUsername value to set. * @return the VirtualMachineProperties object itself. */ @@ -205,7 +189,7 @@ public VirtualMachineProperties withAdminUsername(String adminUsername) { /** * Get the availabilityZone property: The cluster availability zone containing this virtual machine. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -213,8 +197,8 @@ public String availabilityZone() { } /** - * Get the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed to. - * + * Get the bareMetalMachineId property: The resource ID of the bare metal machine that hosts the virtual machine. + * * @return the bareMetalMachineId value. */ public String bareMetalMachineId() { @@ -223,7 +207,7 @@ public String bareMetalMachineId() { /** * Get the bootMethod property: Selects the boot method for the virtual machine. - * + * * @return the bootMethod value. */ public VirtualMachineBootMethod bootMethod() { @@ -232,7 +216,7 @@ public VirtualMachineBootMethod bootMethod() { /** * Set the bootMethod property: Selects the boot method for the virtual machine. - * + * * @param bootMethod the bootMethod value to set. * @return the VirtualMachineProperties object itself. */ @@ -242,10 +226,9 @@ public VirtualMachineProperties withBootMethod(VirtualMachineBootMethod bootMeth } /** - * Get the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine. - * + * Get the cloudServicesNetworkAttachment property: The cloud service network that provides platform-level services + * for the virtual machine. + * * @return the cloudServicesNetworkAttachment value. */ public NetworkAttachment cloudServicesNetworkAttachment() { @@ -253,10 +236,9 @@ public NetworkAttachment cloudServicesNetworkAttachment() { } /** - * Set the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine. - * + * Set the cloudServicesNetworkAttachment property: The cloud service network that provides platform-level services + * for the virtual machine. + * * @param cloudServicesNetworkAttachment the cloudServicesNetworkAttachment value to set. * @return the VirtualMachineProperties object itself. */ @@ -268,16 +250,36 @@ public NetworkAttachment cloudServicesNetworkAttachment() { /** * Get the clusterId property: The resource ID of the cluster the virtual machine is created for. - * + * * @return the clusterId value. */ public String clusterId() { return this.clusterId; } + /** + * Get the consoleExtendedLocation property: The extended location to use for creation of a VM console resource. + * + * @return the consoleExtendedLocation value. + */ + public ExtendedLocation consoleExtendedLocation() { + return this.consoleExtendedLocation; + } + + /** + * Set the consoleExtendedLocation property: The extended location to use for creation of a VM console resource. + * + * @param consoleExtendedLocation the consoleExtendedLocation value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withConsoleExtendedLocation(ExtendedLocation consoleExtendedLocation) { + this.consoleExtendedLocation = consoleExtendedLocation; + return this; + } + /** * Get the cpuCores property: The number of CPU cores in the virtual machine. - * + * * @return the cpuCores value. */ public long cpuCores() { @@ -286,7 +288,7 @@ public long cpuCores() { /** * Set the cpuCores property: The number of CPU cores in the virtual machine. - * + * * @param cpuCores the cpuCores value to set. * @return the VirtualMachineProperties object itself. */ @@ -297,7 +299,7 @@ public VirtualMachineProperties withCpuCores(long cpuCores) { /** * Get the detailedStatus property: The more detailed status of the virtual machine. - * + * * @return the detailedStatus value. */ public VirtualMachineDetailedStatus detailedStatus() { @@ -306,7 +308,7 @@ public VirtualMachineDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -316,7 +318,7 @@ public String detailedStatusMessage() { /** * Get the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. - * + * * @return the isolateEmulatorThread value. */ public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { @@ -326,7 +328,7 @@ public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { /** * Set the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. - * + * * @param isolateEmulatorThread the isolateEmulatorThread value to set. * @return the VirtualMachineProperties object itself. */ @@ -337,8 +339,8 @@ public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { } /** - * Get the memorySizeGB property: The memory size of the virtual machine in GB. - * + * Get the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in gibibytes. + * * @return the memorySizeGB value. */ public long memorySizeGB() { @@ -346,8 +348,8 @@ public long memorySizeGB() { } /** - * Set the memorySizeGB property: The memory size of the virtual machine in GB. - * + * Set the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in gibibytes. + * * @param memorySizeGB the memorySizeGB value to set. * @return the VirtualMachineProperties object itself. */ @@ -358,7 +360,7 @@ public VirtualMachineProperties withMemorySizeGB(long memorySizeGB) { /** * Get the networkAttachments property: The list of network attachments to the virtual machine. - * + * * @return the networkAttachments value. */ public List networkAttachments() { @@ -367,7 +369,7 @@ public List networkAttachments() { /** * Set the networkAttachments property: The list of network attachments to the virtual machine. - * + * * @param networkAttachments the networkAttachments value to set. * @return the VirtualMachineProperties object itself. */ @@ -378,7 +380,7 @@ public VirtualMachineProperties withNetworkAttachments(List n /** * Get the networkData property: The Base64 encoded cloud-init network data. - * + * * @return the networkData value. */ public String networkData() { @@ -387,7 +389,7 @@ public String networkData() { /** * Set the networkData property: The Base64 encoded cloud-init network data. - * + * * @param networkData the networkData value to set. * @return the VirtualMachineProperties object itself. */ @@ -398,7 +400,7 @@ public VirtualMachineProperties withNetworkData(String networkData) { /** * Get the placementHints property: The scheduling hints for the virtual machine. - * + * * @return the placementHints value. */ public List placementHints() { @@ -407,7 +409,7 @@ public List placementHints() { /** * Set the placementHints property: The scheduling hints for the virtual machine. - * + * * @param placementHints the placementHints value to set. * @return the VirtualMachineProperties object itself. */ @@ -418,7 +420,7 @@ public VirtualMachineProperties withPlacementHints(List sshPublicKeys() { @@ -447,7 +449,7 @@ public List sshPublicKeys() { /** * Set the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using * the cloud-init ssh_authorized_keys mechanism for the adminUsername. - * + * * @param sshPublicKeys the sshPublicKeys value to set. * @return the VirtualMachineProperties object itself. */ @@ -457,10 +459,9 @@ public VirtualMachineProperties withSshPublicKeys(List sshPublicKe } /** - * Get the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. - * + * Get the storageProfile property: The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. + * * @return the storageProfile value. */ public StorageProfile storageProfile() { @@ -468,10 +469,9 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. - * + * Set the storageProfile property: The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. + * * @param storageProfile the storageProfile value to set. * @return the VirtualMachineProperties object itself. */ @@ -482,7 +482,7 @@ public VirtualMachineProperties withStorageProfile(StorageProfile storageProfile /** * Get the userData property: The Base64 encoded cloud-init user data. - * + * * @return the userData value. */ public String userData() { @@ -491,7 +491,7 @@ public String userData() { /** * Set the userData property: The Base64 encoded cloud-init user data. - * + * * @param userData the userData value to set. * @return the VirtualMachineProperties object itself. */ @@ -503,7 +503,7 @@ public VirtualMachineProperties withUserData(String userData) { /** * Get the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio * interface. - * + * * @return the virtioInterface value. */ public VirtualMachineVirtioInterfaceType virtioInterface() { @@ -513,7 +513,7 @@ public VirtualMachineVirtioInterfaceType virtioInterface() { /** * Set the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio * interface. - * + * * @param virtioInterface the virtioInterface value to set. * @return the VirtualMachineProperties object itself. */ @@ -524,7 +524,7 @@ public VirtualMachineProperties withVirtioInterface(VirtualMachineVirtioInterfac /** * Get the vmDeviceModel property: The type of the device model to use. - * + * * @return the vmDeviceModel value. */ public VirtualMachineDeviceModelType vmDeviceModel() { @@ -533,7 +533,7 @@ public VirtualMachineDeviceModelType vmDeviceModel() { /** * Set the vmDeviceModel property: The type of the device model to use. - * + * * @param vmDeviceModel the vmDeviceModel value to set. * @return the VirtualMachineProperties object itself. */ @@ -545,7 +545,7 @@ public VirtualMachineProperties withVmDeviceModel(VirtualMachineDeviceModelType /** * Get the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full * url and tag notation used to pull the image. - * + * * @return the vmImage value. */ public String vmImage() { @@ -555,7 +555,7 @@ public String vmImage() { /** * Set the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full * url and tag notation used to pull the image. - * + * * @param vmImage the vmImage value to set. * @return the VirtualMachineProperties object itself. */ @@ -565,11 +565,9 @@ public VirtualMachineProperties withVmImage(String vmImage) { } /** - * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Get the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @return the vmImageRepositoryCredentials value. */ public ImageRepositoryCredentials vmImageRepositoryCredentials() { @@ -577,11 +575,9 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { } /** - * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Set the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. * @return the VirtualMachineProperties object itself. */ @@ -593,7 +589,7 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { /** * Get the volumes property: The resource IDs of volumes that are attached to the virtual machine. - * + * * @return the volumes value. */ public List volumes() { @@ -602,20 +598,25 @@ public List volumes() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (adminUsername() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property adminUsername in model VirtualMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property adminUsername in model VirtualMachineProperties")); } if (cloudServicesNetworkAttachment() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property cloudServicesNetworkAttachment in model VirtualMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cloudServicesNetworkAttachment in model VirtualMachineProperties")); } else { cloudServicesNetworkAttachment().validate(); } + if (consoleExtendedLocation() != null) { + consoleExtendedLocation().validate(); + } if (networkAttachments() != null) { networkAttachments().forEach(e -> e.validate()); } @@ -626,14 +627,16 @@ public void validate() { sshPublicKeys().forEach(e -> e.validate()); } if (storageProfile() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property storageProfile in model VirtualMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageProfile in model VirtualMachineProperties")); } else { storageProfile().validate(); } if (vmImage() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vmImage in model VirtualMachineProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmImage in model VirtualMachineProperties")); } if (vmImageRepositoryCredentials() != null) { vmImageRepositoryCredentials().validate(); @@ -641,4 +644,124 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeJsonField("cloudServicesNetworkAttachment", this.cloudServicesNetworkAttachment); + jsonWriter.writeLongField("cpuCores", this.cpuCores); + jsonWriter.writeLongField("memorySizeGB", this.memorySizeGB); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeStringField("vmImage", this.vmImage); + jsonWriter.writeStringField("bootMethod", this.bootMethod == null ? null : this.bootMethod.toString()); + jsonWriter.writeJsonField("consoleExtendedLocation", this.consoleExtendedLocation); + jsonWriter.writeStringField("isolateEmulatorThread", + this.isolateEmulatorThread == null ? null : this.isolateEmulatorThread.toString()); + jsonWriter.writeArrayField("networkAttachments", this.networkAttachments, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("networkData", this.networkData); + jsonWriter.writeArrayField("placementHints", this.placementHints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sshPublicKeys", this.sshPublicKeys, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("virtioInterface", + this.virtioInterface == null ? null : this.virtioInterface.toString()); + jsonWriter.writeStringField("vmDeviceModel", this.vmDeviceModel == null ? null : this.vmDeviceModel.toString()); + jsonWriter.writeJsonField("vmImageRepositoryCredentials", this.vmImageRepositoryCredentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineProperties 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 VirtualMachineProperties. + */ + public static VirtualMachineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineProperties deserializedVirtualMachineProperties = new VirtualMachineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUsername".equals(fieldName)) { + deserializedVirtualMachineProperties.adminUsername = reader.getString(); + } else if ("cloudServicesNetworkAttachment".equals(fieldName)) { + deserializedVirtualMachineProperties.cloudServicesNetworkAttachment + = NetworkAttachment.fromJson(reader); + } else if ("cpuCores".equals(fieldName)) { + deserializedVirtualMachineProperties.cpuCores = reader.getLong(); + } else if ("memorySizeGB".equals(fieldName)) { + deserializedVirtualMachineProperties.memorySizeGB = reader.getLong(); + } else if ("storageProfile".equals(fieldName)) { + deserializedVirtualMachineProperties.storageProfile = StorageProfile.fromJson(reader); + } else if ("vmImage".equals(fieldName)) { + deserializedVirtualMachineProperties.vmImage = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedVirtualMachineProperties.availabilityZone = reader.getString(); + } else if ("bareMetalMachineId".equals(fieldName)) { + deserializedVirtualMachineProperties.bareMetalMachineId = reader.getString(); + } else if ("bootMethod".equals(fieldName)) { + deserializedVirtualMachineProperties.bootMethod + = VirtualMachineBootMethod.fromString(reader.getString()); + } else if ("clusterId".equals(fieldName)) { + deserializedVirtualMachineProperties.clusterId = reader.getString(); + } else if ("consoleExtendedLocation".equals(fieldName)) { + deserializedVirtualMachineProperties.consoleExtendedLocation = ExtendedLocation.fromJson(reader); + } else if ("detailedStatus".equals(fieldName)) { + deserializedVirtualMachineProperties.detailedStatus + = VirtualMachineDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedVirtualMachineProperties.detailedStatusMessage = reader.getString(); + } else if ("isolateEmulatorThread".equals(fieldName)) { + deserializedVirtualMachineProperties.isolateEmulatorThread + = VirtualMachineIsolateEmulatorThread.fromString(reader.getString()); + } else if ("networkAttachments".equals(fieldName)) { + List networkAttachments + = reader.readArray(reader1 -> NetworkAttachment.fromJson(reader1)); + deserializedVirtualMachineProperties.networkAttachments = networkAttachments; + } else if ("networkData".equals(fieldName)) { + deserializedVirtualMachineProperties.networkData = reader.getString(); + } else if ("placementHints".equals(fieldName)) { + List placementHints + = reader.readArray(reader1 -> VirtualMachinePlacementHint.fromJson(reader1)); + deserializedVirtualMachineProperties.placementHints = placementHints; + } else if ("powerState".equals(fieldName)) { + deserializedVirtualMachineProperties.powerState + = VirtualMachinePowerState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualMachineProperties.provisioningState + = VirtualMachineProvisioningState.fromString(reader.getString()); + } else if ("sshPublicKeys".equals(fieldName)) { + List sshPublicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedVirtualMachineProperties.sshPublicKeys = sshPublicKeys; + } else if ("userData".equals(fieldName)) { + deserializedVirtualMachineProperties.userData = reader.getString(); + } else if ("virtioInterface".equals(fieldName)) { + deserializedVirtualMachineProperties.virtioInterface + = VirtualMachineVirtioInterfaceType.fromString(reader.getString()); + } else if ("vmDeviceModel".equals(fieldName)) { + deserializedVirtualMachineProperties.vmDeviceModel + = VirtualMachineDeviceModelType.fromString(reader.getString()); + } else if ("vmImageRepositoryCredentials".equals(fieldName)) { + deserializedVirtualMachineProperties.vmImageRepositoryCredentials + = ImageRepositoryCredentials.fromJson(reader); + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualMachineProperties.volumes = volumes; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java index 3f814c7b50fc1..302537bcb849b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java @@ -8,48 +8,60 @@ import com.azure.core.management.Resource; 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.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.VolumeDetailedStatus; import com.azure.resourcemanager.networkcloud.models.VolumeProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Volume represents storage made available for use by resources running on the cluster. */ +/** + * Volume represents storage made available for use by resources running on the cluster. + */ @Fluent public final class VolumeInner extends Resource { /* - * ExtendedLocation represents the Azure custom location where the resource will be created. - * * The extended location of the cluster associated with the resource. */ - @JsonProperty(value = "extendedLocation", required = true) private ExtendedLocation extendedLocation; /* - * VolumeProperties represents properties of the volume resource. - * * The list of the resource properties. */ - @JsonProperty(value = "properties", required = true) private VolumeProperties innerProperties = new VolumeProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of VolumeInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of VolumeInner class. + */ public VolumeInner() { } /** - * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Get the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -57,11 +69,8 @@ public ExtendedLocation extendedLocation() { } /** - * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Set the extendedLocation property: The extended location of the cluster associated with the resource. + * * @param extendedLocation the extendedLocation value to set. * @return the VolumeInner object itself. */ @@ -71,10 +80,8 @@ public VolumeInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the innerProperties property: VolumeProperties represents properties of the volume resource. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private VolumeProperties innerProperties() { @@ -83,21 +90,55 @@ private VolumeProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public VolumeInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VolumeInner withTags(Map tags) { super.withTags(tags); @@ -107,7 +148,7 @@ public VolumeInner withTags(Map tags) { /** * Get the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines and * Hybrid AKS clusters. - * + * * @return the attachedTo value. */ public List attachedTo() { @@ -116,7 +157,7 @@ public List attachedTo() { /** * Get the detailedStatus property: The more detailed status of the volume. - * + * * @return the detailedStatus value. */ public VolumeDetailedStatus detailedStatus() { @@ -125,7 +166,7 @@ public VolumeDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -134,7 +175,7 @@ public String detailedStatusMessage() { /** * Get the provisioningState property: The provisioning state of the volume. - * + * * @return the provisioningState value. */ public VolumeProvisioningState provisioningState() { @@ -143,7 +184,7 @@ public VolumeProvisioningState provisioningState() { /** * Get the serialNumber property: The unique identifier of the volume. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -152,7 +193,7 @@ public String serialNumber() { /** * Get the sizeMiB property: The size of the allocation for this volume in Mebibytes. - * + * * @return the sizeMiB value. */ public long sizeMiB() { @@ -161,7 +202,7 @@ public long sizeMiB() { /** * Set the sizeMiB property: The size of the allocation for this volume in Mebibytes. - * + * * @param sizeMiB the sizeMiB value to set. * @return the VolumeInner object itself. */ @@ -175,23 +216,78 @@ public VolumeInner withSizeMiB(long sizeMiB) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (extendedLocation() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model VolumeInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property extendedLocation in model VolumeInner")); } else { extendedLocation().validate(); } if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model VolumeInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model VolumeInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VolumeInner.class); + + /** + * {@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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeInner 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 VolumeInner. + */ + public static VolumeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeInner deserializedVolumeInner = new VolumeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVolumeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVolumeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVolumeInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVolumeInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVolumeInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVolumeInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedVolumeInner.innerProperties = VolumeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVolumeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeInner; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java index ecce0afe0170c..0c15c5cadb98e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java @@ -5,58 +5,60 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.models.VolumeDetailedStatus; import com.azure.resourcemanager.networkcloud.models.VolumeProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** VolumeProperties represents properties of the volume resource. */ +/** + * VolumeProperties represents properties of the volume resource. + */ @Fluent -public final class VolumeProperties { +public final class VolumeProperties implements JsonSerializable { /* * The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. */ - @JsonProperty(value = "attachedTo", access = JsonProperty.Access.WRITE_ONLY) private List attachedTo; /* * The more detailed status of the volume. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private VolumeDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The provisioning state of the volume. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private VolumeProvisioningState provisioningState; /* * The unique identifier of the volume. */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) private String serialNumber; /* * The size of the allocation for this volume in Mebibytes. */ - @JsonProperty(value = "sizeMiB", required = true) private long sizeMiB; - /** Creates an instance of VolumeProperties class. */ + /** + * Creates an instance of VolumeProperties class. + */ public VolumeProperties() { } /** * Get the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines and * Hybrid AKS clusters. - * + * * @return the attachedTo value. */ public List attachedTo() { @@ -65,7 +67,7 @@ public List attachedTo() { /** * Get the detailedStatus property: The more detailed status of the volume. - * + * * @return the detailedStatus value. */ public VolumeDetailedStatus detailedStatus() { @@ -74,7 +76,7 @@ public VolumeDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -83,7 +85,7 @@ public String detailedStatusMessage() { /** * Get the provisioningState property: The provisioning state of the volume. - * + * * @return the provisioningState value. */ public VolumeProvisioningState provisioningState() { @@ -92,7 +94,7 @@ public VolumeProvisioningState provisioningState() { /** * Get the serialNumber property: The unique identifier of the volume. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -101,7 +103,7 @@ public String serialNumber() { /** * Get the sizeMiB property: The size of the allocation for this volume in Mebibytes. - * + * * @return the sizeMiB value. */ public long sizeMiB() { @@ -110,7 +112,7 @@ public long sizeMiB() { /** * Set the sizeMiB property: The size of the allocation for this volume in Mebibytes. - * + * * @param sizeMiB the sizeMiB value to set. * @return the VolumeProperties object itself. */ @@ -121,9 +123,58 @@ public VolumeProperties withSizeMiB(long sizeMiB) { /** * 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.writeLongField("sizeMiB", this.sizeMiB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeProperties 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 VolumeProperties. + */ + public static VolumeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeProperties deserializedVolumeProperties = new VolumeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sizeMiB".equals(fieldName)) { + deserializedVolumeProperties.sizeMiB = reader.getLong(); + } else if ("attachedTo".equals(fieldName)) { + List attachedTo = reader.readArray(reader1 -> reader1.getString()); + deserializedVolumeProperties.attachedTo = attachedTo; + } else if ("detailedStatus".equals(fieldName)) { + deserializedVolumeProperties.detailedStatus = VolumeDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedVolumeProperties.detailedStatusMessage = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVolumeProperties.provisioningState + = VolumeProvisioningState.fromString(reader.getString()); + } else if ("serialNumber".equals(fieldName)) { + deserializedVolumeProperties.serialNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeProperties; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java index 0a30acf3f8ac1..15e1bcf886fec 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for NetworkCloud. The Network Cloud APIs provide management of the - * on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and - * more. + * Package containing the inner data models for NetworkCloud. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ package com.azure.resourcemanager.networkcloud.fluent.models; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java index f30dbf227aee0..977a52d96d742 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java @@ -3,7 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for NetworkCloud. The Network Cloud APIs provide management of the on-premises - * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + * Package containing the service clients for NetworkCloud. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ package com.azure.resourcemanager.networkcloud.fluent; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolImpl.java index 99b2165c68c69..3205925b6dac0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolImpl.java @@ -19,6 +19,7 @@ import com.azure.resourcemanager.networkcloud.models.AttachedNetworkConfiguration; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.KubernetesLabel; +import com.azure.resourcemanager.networkcloud.models.NodePoolAdministratorConfigurationPatch; import java.util.Collections; import java.util.List; import java.util.Map; @@ -210,9 +211,9 @@ public AgentPool apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.kubernetesClusterName = Utils.getValueFromIdByName(innerObject.id(), "kubernetesClusters"); - this.agentPoolName = Utils.getValueFromIdByName(innerObject.id(), "agentPools"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "kubernetesClusters"); + this.agentPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "agentPools"); } public AgentPool refresh() { @@ -311,6 +312,12 @@ public AgentPoolImpl withUpgradeSettings(AgentPoolUpgradeSettings upgradeSetting } } + public AgentPoolImpl + withAdministratorConfiguration(NodePoolAdministratorConfigurationPatch administratorConfiguration) { + this.updateAgentPoolUpdateParameters.withAdministratorConfiguration(administratorConfiguration); + return this; + } + public AgentPoolImpl withCount(Long count) { this.updateAgentPoolUpdateParameters.withCount(count); return this; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsClientImpl.java index bcbbd57bb2ca0..0e792438d52a7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.AgentPoolsClient; import com.azure.resourcemanager.networkcloud.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.AgentPoolList; import com.azure.resourcemanager.networkcloud.models.AgentPoolPatchParameters; 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 AgentPoolsClient. */ +/** + * An instance of this class provides access to all the operations defined in AgentPoolsClient. + */ public final class AgentPoolsClientImpl implements AgentPoolsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AgentPoolsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of AgentPoolsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AgentPoolsClientImpl(NetworkCloudImpl client) { @@ -131,16 +138,16 @@ Mono> listByKubernetesClusterNext( /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByKubernetesClusterSinglePageAsync(String resourceGroupName, @@ -173,9 +180,9 @@ private Mono> listByKubernetesClusterSinglePageAsy /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -183,7 +190,7 @@ private Mono> listByKubernetesClusterSinglePageAsy * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of agent pools for the provided Kubernetes cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByKubernetesClusterSinglePageAsync(String resourceGroupName, @@ -215,9 +222,9 @@ private Mono> listByKubernetesClusterSinglePageAsy /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -234,9 +241,9 @@ private PagedFlux listByKubernetesClusterAsync(String resourceGr /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -255,16 +262,16 @@ private PagedFlux listByKubernetesClusterAsync(String resourceGr /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByKubernetesCluster(String resourceGroupName, @@ -274,17 +281,17 @@ public PagedIterable listByKubernetesCluster(String resourceGrou /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName, @@ -294,9 +301,9 @@ public PagedIterable listByKubernetesCluster(String resourceGrou /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -304,7 +311,7 @@ public PagedIterable listByKubernetesCluster(String resourceGrou * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided Kubernetes cluster agent pool along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String kubernetesClusterName, @@ -336,9 +343,9 @@ private Mono> getWithResponseAsync(String resourceGroup /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -347,7 +354,7 @@ private Mono> getWithResponseAsync(String resourceGroup * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided Kubernetes cluster agent pool along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String kubernetesClusterName, @@ -379,9 +386,9 @@ private Mono> getWithResponseAsync(String resourceGroup /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -399,9 +406,9 @@ private Mono getAsync(String resourceGroupName, String kubernete /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -419,9 +426,9 @@ public Response getWithResponse(String resourceGroupName, String /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -437,9 +444,9 @@ public AgentPoolInner get(String resourceGroupName, String kubernetesClusterName /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -448,7 +455,7 @@ public AgentPoolInner get(String resourceGroupName, String kubernetesClusterName * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return agentPool represents the agent pool of Kubernetes cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -488,9 +495,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -500,7 +507,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return agentPool represents the agent pool of Kubernetes cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -539,9 +546,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -562,9 +569,9 @@ private PollerFlux, AgentPoolInner> beginCreateOrUpda /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -587,9 +594,9 @@ private PollerFlux, AgentPoolInner> beginCreateOrUpda /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -609,9 +616,9 @@ public SyncPoller, AgentPoolInner> beginCreateOrUpdat /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -633,9 +640,9 @@ public SyncPoller, AgentPoolInner> beginCreateOrUpdat /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -655,9 +662,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -677,9 +684,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -698,9 +705,9 @@ public AgentPoolInner createOrUpdate(String resourceGroupName, String kubernetes /** * Create or update the Kubernetes cluster agent pool. - * - *

Create a new Kubernetes cluster agent pool or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster agent pool or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -720,16 +727,17 @@ public AgentPoolInner createOrUpdate(String resourceGroupName, String kubernetes /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -761,9 +769,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -771,7 +779,8 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -803,31 +812,32 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, - String agentPoolName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName, agentPoolName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -835,42 +845,42 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, - String agentPoolName, Context context) { + private PollerFlux, OperationStatusResultInner> beginDeleteAsync( + String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName, agentPoolName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - String agentPoolName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName).getSyncPoller(); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -878,38 +888,39 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - String agentPoolName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context) { return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName, context).getSyncPoller(); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, + String agentPoolName) { return beginDeleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -917,37 +928,39 @@ private Mono deleteAsync(String resourceGroupName, String kubernetesCluste * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, String agentPoolName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, + String agentPoolName, Context context) { return beginDeleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { - deleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, + String agentPoolName) { + return deleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName).block(); } /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -955,18 +968,20 @@ public void delete(String resourceGroupName, String kubernetesClusterName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context) { - deleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, + String agentPoolName, Context context) { + return deleteAsync(resourceGroupName, kubernetesClusterName, agentPoolName, context).block(); } /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -975,7 +990,7 @@ public void delete(String resourceGroupName, String kubernetesClusterName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return agentPool represents the agent pool of Kubernetes cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1012,10 +1027,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1025,7 +1040,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return agentPool represents the agent pool of Kubernetes cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1061,10 +1076,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1085,10 +1100,10 @@ private PollerFlux, AgentPoolInner> beginUpdateAsync( /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1109,10 +1124,10 @@ private PollerFlux, AgentPoolInner> beginUpdateAsync( /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1136,10 +1151,10 @@ private PollerFlux, AgentPoolInner> beginUpdateAsync( /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1158,10 +1173,10 @@ public SyncPoller, AgentPoolInner> beginUpdate(String /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1184,10 +1199,10 @@ public SyncPoller, AgentPoolInner> beginUpdate(String /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1207,10 +1222,10 @@ private Mono updateAsync(String resourceGroupName, String kubern /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1230,10 +1245,10 @@ private Mono updateAsync(String resourceGroupName, String kubern /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1253,10 +1268,10 @@ private Mono updateAsync(String resourceGroupName, String kubern /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1273,10 +1288,10 @@ public AgentPoolInner update(String resourceGroupName, String kubernetesClusterN /** * Patch the Kubernetes cluster agent pool. - * - *

Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the + * + * Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the * Kubernetes cluster agent pool. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -1296,14 +1311,13 @@ public AgentPoolInner update(String resourceGroupName, String kubernetesClusterN /** * 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. * @return agentPoolList represents a list of Kubernetes cluster agent pools along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByKubernetesClusterNextSinglePageAsync(String nextLink) { @@ -1325,15 +1339,14 @@ private Mono> listByKubernetesClusterNextSinglePag /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return agentPoolList represents a list of Kubernetes cluster agent pools along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByKubernetesClusterNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsImpl.java index df2cbd5798df2..71a33dd2dab10 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/AgentPoolsImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.AgentPoolsClient; import com.azure.resourcemanager.networkcloud.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.AgentPool; import com.azure.resourcemanager.networkcloud.models.AgentPools; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class AgentPoolsImpl implements AgentPools { private static final ClientLogger LOGGER = new ClientLogger(AgentPoolsImpl.class); @@ -30,14 +32,14 @@ public AgentPoolsImpl(AgentPoolsClient innerClient, public PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName) { PagedIterable inner = this.serviceClient().listByKubernetesCluster(resourceGroupName, kubernetesClusterName); - return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); } public PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName, Context context) { PagedIterable inner = this.serviceClient().listByKubernetesCluster(resourceGroupName, kubernetesClusterName, context); - return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String kubernetesClusterName, @@ -61,26 +63,39 @@ public AgentPool get(String resourceGroupName, String kubernetesClusterName, Str } } - public void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { - this.serviceClient().delete(resourceGroupName, kubernetesClusterName, agentPoolName); + public OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, kubernetesClusterName, agentPoolName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context) { - this.serviceClient().delete(resourceGroupName, kubernetesClusterName, agentPoolName, context); + public OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, kubernetesClusterName, agentPoolName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public AgentPool getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); if (agentPoolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); @@ -89,17 +104,17 @@ public AgentPool getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); if (agentPoolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); @@ -107,42 +122,42 @@ public Response getByIdWithResponse(String id, Context context) { return this.getWithResponse(resourceGroupName, kubernetesClusterName, agentPoolName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); if (agentPoolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); } - this.delete(resourceGroupName, kubernetesClusterName, agentPoolName, Context.NONE); + return this.delete(resourceGroupName, kubernetesClusterName, agentPoolName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + String agentPoolName = ResourceManagerUtils.getValueFromIdByName(id, "agentPools"); if (agentPoolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); } - this.delete(resourceGroupName, kubernetesClusterName, agentPoolName, context); + return this.delete(resourceGroupName, kubernetesClusterName, agentPoolName, context); } private AgentPoolsClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java index 3d030e25e5ece..6ff15adcc82a1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java @@ -26,6 +26,8 @@ import com.azure.resourcemanager.networkcloud.models.HardwareInventory; import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; import java.util.Collections; import java.util.List; import java.util.Map; @@ -135,6 +137,10 @@ public String kubernetesVersion() { return this.innerModel().kubernetesVersion(); } + public String machineClusterVersion() { + return this.innerModel().machineClusterVersion(); + } + public String machineDetails() { return this.innerModel().machineDetails(); } @@ -143,6 +149,15 @@ public String machineName() { return this.innerModel().machineName(); } + public List machineRoles() { + List inner = this.innerModel().machineRoles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String machineSkuId() { return this.innerModel().machineSkuId(); } @@ -179,6 +194,19 @@ public BareMetalMachineReadyState readyState() { return this.innerModel().readyState(); } + public RuntimeProtectionStatus runtimeProtectionStatus() { + return this.innerModel().runtimeProtectionStatus(); + } + + public List secretRotationStatus() { + List inner = this.innerModel().secretRotationStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String serialNumber() { return this.innerModel().serialNumber(); } @@ -270,8 +298,8 @@ public BareMetalMachine apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.bareMetalMachineName = Utils.getValueFromIdByName(innerObject.id(), "bareMetalMachines"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.bareMetalMachineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bareMetalMachines"); } public BareMetalMachine refresh() { @@ -469,6 +497,11 @@ public BareMetalMachineImpl withTags(Map tags) { } } + public BareMetalMachineImpl withMachineClusterVersion(String machineClusterVersion) { + this.innerModel().withMachineClusterVersion(machineClusterVersion); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java index f00b808ae4ecd..ca8ace2241a58 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java @@ -199,9 +199,10 @@ public BareMetalMachineKeySet apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - this.bareMetalMachineKeySetName = Utils.getValueFromIdByName(innerObject.id(), "bareMetalMachineKeySets"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.bareMetalMachineKeySetName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bareMetalMachineKeySets"); } public BareMetalMachineKeySet refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java index 7a9056c4574c7..361b48f8192c9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachineKeySetsClient; import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetList; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPatchParameters; 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 BareMetalMachineKeySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in BareMetalMachineKeySetsClient. + */ public final class BareMetalMachineKeySetsClientImpl implements BareMetalMachineKeySetsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BareMetalMachineKeySetsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of BareMetalMachineKeySetsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BareMetalMachineKeySetsClientImpl(NetworkCloudImpl client) { @@ -128,16 +135,16 @@ Mono> listByClusterNext( /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of bare metal machine key sets for the provided cluster along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -168,9 +175,9 @@ private Mono> listByClusterSinglePage /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -178,7 +185,7 @@ private Mono> listByClusterSinglePage * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machine key sets for the provided cluster along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -209,16 +216,16 @@ private Mono> listByClusterSinglePage /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedFlux}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { @@ -228,17 +235,17 @@ private PagedFlux listByClusterAsync(String resourc /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedFlux}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, @@ -249,16 +256,16 @@ private PagedFlux listByClusterAsync(String resourc /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { @@ -267,17 +274,17 @@ public PagedIterable listByCluster(String resourceG /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, @@ -287,9 +294,9 @@ public PagedIterable listByCluster(String resourceG /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -297,7 +304,7 @@ public PagedIterable listByCluster(String resourceG * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bare metal machine key set of the provided cluster along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -331,9 +338,9 @@ private Mono> getWithResponseAsync(String /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -342,7 +349,7 @@ private Mono> getWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bare metal machine key set of the provided cluster along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -374,9 +381,9 @@ private Mono> getWithResponseAsync(String /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -394,9 +401,9 @@ private Mono getAsync(String resourceGroupName, Str /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -414,9 +421,9 @@ public Response getWithResponse(String resourceGrou /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -433,9 +440,9 @@ public BareMetalMachineKeySetInner get(String resourceGroupName, String clusterN /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -444,7 +451,7 @@ public BareMetalMachineKeySetInner get(String resourceGroupName, String clusterN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -485,9 +492,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -497,7 +504,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -537,9 +544,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -562,9 +569,9 @@ private PollerFlux, BareMetalMachineKeyS /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -589,9 +596,9 @@ private PollerFlux, BareMetalMachineKeyS /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -613,9 +620,9 @@ public SyncPoller, BareMetalMachineKeySe /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -638,9 +645,9 @@ public SyncPoller, BareMetalMachineKeySe /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -648,8 +655,8 @@ public SyncPoller, BareMetalMachineKeySe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link - * Mono}. + * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, @@ -660,9 +667,9 @@ private Mono createOrUpdateAsync(String resourceGro /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -671,8 +678,8 @@ private Mono createOrUpdateAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link - * Mono}. + * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, @@ -684,9 +691,9 @@ private Mono createOrUpdateAsync(String resourceGro /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -705,9 +712,9 @@ public BareMetalMachineKeySetInner createOrUpdate(String resourceGroupName, Stri /** * Create or update the bare metal machine key set of the cluster. - * - *

Create a new bare metal machine key set or update the existing one for the provided cluster. - * + * + * Create a new bare metal machine key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -728,16 +735,17 @@ public BareMetalMachineKeySetInner createOrUpdate(String resourceGroupName, Stri /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -771,9 +779,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -781,7 +789,8 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -813,31 +822,32 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -845,42 +855,42 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName, Context context) { + private PollerFlux, OperationStatusResultInner> beginDeleteAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { return this.beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).getSyncPoller(); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -888,39 +898,40 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bareMetalMachineKeySetName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { return this.beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context) .getSyncPoller(); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String bareMetalMachineKeySetName) { return beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -928,37 +939,39 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String bareMetalMachineKeySetName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { - deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, + String bareMetalMachineKeySetName) { + return deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).block(); } /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -966,19 +979,20 @@ public void delete(String resourceGroupName, String clusterName, String bareMeta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, - Context context) { - deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, + String bareMetalMachineKeySetName, Context context) { + return deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context).block(); } /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -987,7 +1001,7 @@ public void delete(String resourceGroupName, String clusterName, String bareMeta * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1025,10 +1039,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1038,7 +1052,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1075,10 +1089,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1101,10 +1115,10 @@ private PollerFlux, BareMetalMachineKeyS /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1126,10 +1140,10 @@ private PollerFlux, BareMetalMachineKeyS /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1154,10 +1168,10 @@ private PollerFlux, BareMetalMachineKeyS /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1178,10 +1192,10 @@ private PollerFlux, BareMetalMachineKeyS /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1204,10 +1218,10 @@ public SyncPoller, BareMetalMachineKeySe /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1215,8 +1229,8 @@ public SyncPoller, BareMetalMachineKeySe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link - * Mono}. + * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1228,18 +1242,18 @@ private Mono updateAsync(String resourceGroupName, /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link - * Mono}. + * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1251,10 +1265,10 @@ private Mono updateAsync(String resourceGroupName, /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1263,8 +1277,8 @@ private Mono updateAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link - * Mono}. + * @return bareMetalMachineKeySet represents the bare metal machine key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1276,10 +1290,10 @@ private Mono updateAsync(String resourceGroupName, /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1298,10 +1312,10 @@ public BareMetalMachineKeySetInner update(String resourceGroupName, String clust /** * Patch bare metal machine key set of the cluster. - * - *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with - * it. Properties and tag updates can be done independently. - * + * + * Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -1322,14 +1336,13 @@ public BareMetalMachineKeySetInner update(String resourceGroupName, String clust /** * 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. - * @return bareMetalMachineKeySetList represents a list of bare metal machine key sets along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return bareMetalMachineKeySetList represents a list of bare metal machine key sets along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink) { @@ -1350,15 +1363,14 @@ private Mono> listByClusterNextSingle /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bareMetalMachineKeySetList represents a list of bare metal machine key sets along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return bareMetalMachineKeySetList represents a list of bare metal machine key sets along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java index ff438a4e86327..be90edbc54070 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachineKeySetsClient; import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySet; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySets; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class BareMetalMachineKeySetsImpl implements BareMetalMachineKeySets { private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetsImpl.class); @@ -30,14 +32,14 @@ public BareMetalMachineKeySetsImpl(BareMetalMachineKeySetsClient innerClient, public PagedIterable listByCluster(String resourceGroupName, String clusterName) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); } public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String clusterName, @@ -62,27 +64,40 @@ public BareMetalMachineKeySet get(String resourceGroupName, String clusterName, } } - public void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { - this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName); + public OperationStatusResult delete(String resourceGroupName, String clusterName, + String bareMetalMachineKeySetName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, + public OperationStatusResult delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public BareMetalMachineKeySet getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + String bareMetalMachineKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachineKeySets"); if (bareMetalMachineKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", id))); @@ -92,17 +107,17 @@ public BareMetalMachineKeySet getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + String bareMetalMachineKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachineKeySets"); if (bareMetalMachineKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", id))); @@ -110,42 +125,42 @@ public Response getByIdWithResponse(String id, Context c return this.getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + String bareMetalMachineKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachineKeySets"); if (bareMetalMachineKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", id))); } - this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE); + return this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + String bareMetalMachineKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachineKeySets"); if (bareMetalMachineKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", id))); } - this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + return this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); } private BareMetalMachineKeySetsClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java index 9f7d41442a77f..51979b476f6f9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java @@ -48,17 +48,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BareMetalMachinesClient. */ +/** + * An instance of this class provides access to all the operations defined in BareMetalMachinesClient. + */ public final class BareMetalMachinesClientImpl implements BareMetalMachinesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BareMetalMachinesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of BareMetalMachinesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BareMetalMachinesClientImpl(NetworkCloudImpl client) { @@ -135,7 +141,7 @@ Mono>> update(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> cordon(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -146,7 +152,7 @@ Mono>> cordon(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> powerOff(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -157,7 +163,7 @@ Mono>> powerOff(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> reimage(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -167,7 +173,7 @@ Mono>> reimage(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> replace(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -178,7 +184,7 @@ Mono>> replace(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restart(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -188,7 +194,7 @@ Mono>> restart(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> runCommand(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -199,7 +205,7 @@ Mono>> runCommand(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> runDataExtracts(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -210,7 +216,7 @@ Mono>> runDataExtracts(@HostParam("$host") String endp @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> runReadCommands(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -221,7 +227,7 @@ Mono>> runReadCommands(@HostParam("$host") String endp @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> start(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -231,7 +237,7 @@ Mono>> start(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> uncordon(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -258,13 +264,13 @@ Mono> listByResourceGroupNext( /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machines in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -287,15 +293,15 @@ private Mono> listSinglePageAsync() { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machines in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -318,9 +324,9 @@ private Mono> listSinglePageAsync(Context c /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machines in the provided subscription as paginated response with {@link PagedFlux}. @@ -333,9 +339,9 @@ private PagedFlux listAsync() { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -350,13 +356,13 @@ private PagedFlux listAsync(Context context) { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -365,15 +371,15 @@ public PagedIterable list() { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -382,15 +388,15 @@ public PagedIterable list(Context context) { /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machines in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -417,16 +423,16 @@ private Mono> listByResourceGroupSinglePage /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of bare metal machines in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -454,15 +460,15 @@ private Mono> listByResourceGroupSinglePage /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -472,16 +478,16 @@ private PagedFlux listByResourceGroupAsync(String resourc /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -491,15 +497,15 @@ private PagedFlux listByResourceGroupAsync(String resourc /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -508,16 +514,16 @@ public PagedIterable listByResourceGroup(String resourceG /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -526,16 +532,16 @@ public PagedIterable listByResourceGroup(String resourceG /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided bare metal machine along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -565,9 +571,9 @@ private Mono> getByResourceGroupWithResponseAsyn /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -575,7 +581,7 @@ private Mono> getByResourceGroupWithResponseAsyn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided bare metal machine along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -604,9 +610,9 @@ private Mono> getByResourceGroupWithResponseAsyn /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -622,9 +628,9 @@ private Mono getByResourceGroupAsync(String resourceGroup /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -641,9 +647,9 @@ public Response getByResourceGroupWithResponse(String res /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -658,10 +664,10 @@ public BareMetalMachineInner getByResourceGroup(String resourceGroupName, String /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -669,7 +675,7 @@ public BareMetalMachineInner getByResourceGroup(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -706,10 +712,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -718,7 +724,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -754,10 +760,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -778,10 +784,10 @@ private PollerFlux, BareMetalMachineInner> beg /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -804,10 +810,10 @@ private PollerFlux, BareMetalMachineInner> beg /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -825,10 +831,10 @@ public SyncPoller, BareMetalMachineInner> begi /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -849,10 +855,10 @@ public SyncPoller, BareMetalMachineInner> begi /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -870,10 +876,10 @@ private Mono createOrUpdateAsync(String resourceGroupName /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -893,10 +899,10 @@ private Mono createOrUpdateAsync(String resourceGroupName /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -913,10 +919,10 @@ public BareMetalMachineInner createOrUpdate(String resourceGroupName, String bar /** * Create or update the bare metal machine. - * - *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new bare metal machine or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineParameters The request body. @@ -935,16 +941,17 @@ public BareMetalMachineInner createOrUpdate(String resourceGroupName, String bar /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -974,17 +981,18 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -1013,166 +1021,172 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String bareMetalMachineName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String bareMetalMachineName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, bareMetalMachineName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String bareMetalMachineName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String bareMetalMachineName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, bareMetalMachineName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String bareMetalMachineName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String bareMetalMachineName) { return this.beginDeleteAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String bareMetalMachineName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String bareMetalMachineName, Context context) { return this.beginDeleteAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String bareMetalMachineName) { + private Mono deleteAsync(String resourceGroupName, String bareMetalMachineName) { return beginDeleteAsync(resourceGroupName, bareMetalMachineName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String bareMetalMachineName, Context context) { + private Mono deleteAsync(String resourceGroupName, String bareMetalMachineName, + Context context) { return beginDeleteAsync(resourceGroupName, bareMetalMachineName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String bareMetalMachineName) { - deleteAsync(resourceGroupName, bareMetalMachineName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String bareMetalMachineName) { + return deleteAsync(resourceGroupName, bareMetalMachineName).block(); } /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String bareMetalMachineName, Context context) { - deleteAsync(resourceGroupName, bareMetalMachineName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String bareMetalMachineName, Context context) { + return deleteAsync(resourceGroupName, bareMetalMachineName, context).block(); } /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1180,7 +1194,7 @@ public void delete(String resourceGroupName, String bareMetalMachineName, Contex * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1214,10 +1228,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1226,7 +1240,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1259,10 +1273,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1284,10 +1298,10 @@ private PollerFlux, BareMetalMachineInner> beg /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1308,10 +1322,10 @@ private PollerFlux, BareMetalMachineInner> beg /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1334,10 +1348,10 @@ private PollerFlux, BareMetalMachineInner> beg /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1355,10 +1369,10 @@ public SyncPoller, BareMetalMachineInner> begi /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1378,10 +1392,10 @@ public SyncPoller, BareMetalMachineInner> begi /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1399,10 +1413,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1419,10 +1433,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1442,10 +1456,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1461,10 +1475,10 @@ public BareMetalMachineInner update(String resourceGroupName, String bareMetalMa /** * Patch the bare metal machine. - * - *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * + * Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineUpdateParameters The request body. @@ -1482,17 +1496,17 @@ public BareMetalMachineInner update(String resourceGroupName, String bareMetalMa /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> cordonWithResponseAsync(String resourceGroupName, @@ -1526,9 +1540,9 @@ private Mono>> cordonWithResponseAsync(String resource /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1536,8 +1550,8 @@ private Mono>> cordonWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> cordonWithResponseAsync(String resourceGroupName, @@ -1570,9 +1584,9 @@ private Mono>> cordonWithResponseAsync(String resource /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1594,9 +1608,9 @@ private PollerFlux, OperationStatusResult /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1617,9 +1631,9 @@ private PollerFlux, OperationStatusResult /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1642,9 +1656,9 @@ private PollerFlux, OperationStatusResult /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1662,9 +1676,9 @@ private PollerFlux, OperationStatusResult /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1684,9 +1698,9 @@ public SyncPoller, OperationStatusResultI /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1704,9 +1718,9 @@ private Mono cordonAsync(String resourceGroupName, S /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1723,9 +1737,9 @@ private Mono cordonAsync(String resourceGroupName, S /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1745,9 +1759,9 @@ private Mono cordonAsync(String resourceGroupName, S /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1763,9 +1777,9 @@ public OperationStatusResultInner cordon(String resourceGroupName, String bareMe /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -1783,17 +1797,17 @@ public OperationStatusResultInner cordon(String resourceGroupName, String bareMe /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> powerOffWithResponseAsync(String resourceGroupName, @@ -1827,9 +1841,9 @@ private Mono>> powerOffWithResponseAsync(String resour /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -1837,8 +1851,8 @@ private Mono>> powerOffWithResponseAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> powerOffWithResponseAsync(String resourceGroupName, @@ -1871,9 +1885,9 @@ private Mono>> powerOffWithResponseAsync(String resour /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -1895,9 +1909,9 @@ private PollerFlux, OperationStatusResult /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1918,9 +1932,9 @@ private PollerFlux, OperationStatusResult /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -1943,9 +1957,9 @@ private PollerFlux, OperationStatusResult /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1963,9 +1977,9 @@ private PollerFlux, OperationStatusResult /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -1986,9 +2000,9 @@ public SyncPoller, OperationStatusResultI /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -2006,9 +2020,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2025,9 +2039,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -2047,9 +2061,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2065,9 +2079,9 @@ public OperationStatusResultInner powerOff(String resourceGroupName, String bare /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -2086,16 +2100,16 @@ public OperationStatusResultInner powerOff(String resourceGroupName, String bare /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> reimageWithResponseAsync(String resourceGroupName, @@ -2125,17 +2139,17 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> reimageWithResponseAsync(String resourceGroupName, @@ -2164,9 +2178,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2185,9 +2199,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2208,9 +2222,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2226,9 +2240,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2245,9 +2259,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2263,9 +2277,9 @@ private Mono reimageAsync(String resourceGroupName, /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2283,9 +2297,9 @@ private Mono reimageAsync(String resourceGroupName, /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2300,9 +2314,9 @@ public OperationStatusResultInner reimage(String resourceGroupName, String bareM /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2318,17 +2332,17 @@ public OperationStatusResultInner reimage(String resourceGroupName, String bareM /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> replaceWithResponseAsync(String resourceGroupName, @@ -2362,9 +2376,9 @@ private Mono>> replaceWithResponseAsync(String resourc /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2372,8 +2386,8 @@ private Mono>> replaceWithResponseAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> replaceWithResponseAsync(String resourceGroupName, @@ -2406,9 +2420,9 @@ private Mono>> replaceWithResponseAsync(String resourc /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2430,9 +2444,9 @@ private PollerFlux, OperationStatusResult /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2453,9 +2467,9 @@ private PollerFlux, OperationStatusResult /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2478,9 +2492,9 @@ private PollerFlux, OperationStatusResult /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2498,9 +2512,9 @@ private PollerFlux, OperationStatusResult /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2521,9 +2535,9 @@ public SyncPoller, OperationStatusResultI /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2541,9 +2555,9 @@ private Mono replaceAsync(String resourceGroupName, /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2560,9 +2574,9 @@ private Mono replaceAsync(String resourceGroupName, /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2582,9 +2596,9 @@ private Mono replaceAsync(String resourceGroupName, /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2600,9 +2614,9 @@ public OperationStatusResultInner replace(String resourceGroupName, String bareM /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -2621,16 +2635,16 @@ public OperationStatusResultInner replace(String resourceGroupName, String bareM /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, @@ -2660,17 +2674,17 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, @@ -2699,9 +2713,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2720,9 +2734,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2743,9 +2757,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2761,9 +2775,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2780,9 +2794,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2798,9 +2812,9 @@ private Mono restartAsync(String resourceGroupName, /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2818,9 +2832,9 @@ private Mono restartAsync(String resourceGroupName, /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2835,9 +2849,9 @@ public OperationStatusResultInner restart(String resourceGroupName, String bareM /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -2853,18 +2867,18 @@ public OperationStatusResultInner restart(String resourceGroupName, String bareM /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runCommandWithResponseAsync(String resourceGroupName, @@ -2901,10 +2915,10 @@ private Mono>> runCommandWithResponseAsync(String reso /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -2912,8 +2926,8 @@ private Mono>> runCommandWithResponseAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runCommandWithResponseAsync(String resourceGroupName, @@ -2950,10 +2964,10 @@ private Mono>> runCommandWithResponseAsync(String reso /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -2975,10 +2989,10 @@ private PollerFlux, OperationStatusResult /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3001,10 +3015,10 @@ private PollerFlux, OperationStatusResult /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3023,10 +3037,10 @@ public SyncPoller, OperationStatusResultI /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3048,10 +3062,10 @@ public SyncPoller, OperationStatusResultI /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3070,10 +3084,10 @@ private Mono runCommandAsync(String resourceGroupNam /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3092,10 +3106,10 @@ private Mono runCommandAsync(String resourceGroupNam /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3112,10 +3126,10 @@ public OperationStatusResultInner runCommand(String resourceGroupName, String ba /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -3134,19 +3148,18 @@ public OperationStatusResultInner runCommand(String resourceGroupName, String ba /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runDataExtractsWithResponseAsync(String resourceGroupName, @@ -3184,11 +3197,10 @@ private Mono>> runDataExtractsWithResponseAsync(String /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3196,8 +3208,8 @@ private Mono>> runDataExtractsWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runDataExtractsWithResponseAsync(String resourceGroupName, @@ -3234,11 +3246,10 @@ private Mono>> runDataExtractsWithResponseAsync(String /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3260,11 +3271,10 @@ private PollerFlux, OperationStatusResult /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3287,11 +3297,10 @@ private PollerFlux, OperationStatusResult /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3312,11 +3321,10 @@ public SyncPoller, OperationStatusResultI /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3338,11 +3346,10 @@ public SyncPoller, OperationStatusResultI /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3360,11 +3367,10 @@ private Mono runDataExtractsAsync(String resourceGro /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3383,11 +3389,10 @@ private Mono runDataExtractsAsync(String resourceGro /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3405,11 +3410,10 @@ public OperationStatusResultInner runDataExtracts(String resourceGroupName, Stri /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -3428,19 +3432,19 @@ public OperationStatusResultInner runDataExtracts(String resourceGroupName, Stri /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runReadCommandsWithResponseAsync(String resourceGroupName, @@ -3478,11 +3482,11 @@ private Mono>> runReadCommandsWithResponseAsync(String /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3490,8 +3494,8 @@ private Mono>> runReadCommandsWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runReadCommandsWithResponseAsync(String resourceGroupName, @@ -3528,11 +3532,11 @@ private Mono>> runReadCommandsWithResponseAsync(String /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3554,11 +3558,11 @@ private PollerFlux, OperationStatusResult /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3581,11 +3585,11 @@ private PollerFlux, OperationStatusResult /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3606,11 +3610,11 @@ public SyncPoller, OperationStatusResultI /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3632,11 +3636,11 @@ public SyncPoller, OperationStatusResultI /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3654,11 +3658,11 @@ private Mono runReadCommandsAsync(String resourceGro /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3677,11 +3681,11 @@ private Mono runReadCommandsAsync(String resourceGro /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3699,11 +3703,11 @@ public OperationStatusResultInner runReadCommands(String resourceGroupName, Stri /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -3722,16 +3726,16 @@ public OperationStatusResultInner runReadCommands(String resourceGroupName, Stri /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, @@ -3761,17 +3765,17 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, @@ -3800,9 +3804,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3821,9 +3825,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -3844,9 +3848,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3862,9 +3866,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -3881,9 +3885,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3899,9 +3903,9 @@ private Mono startAsync(String resourceGroupName, St /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -3919,9 +3923,9 @@ private Mono startAsync(String resourceGroupName, St /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3936,9 +3940,9 @@ public OperationStatusResultInner start(String resourceGroupName, String bareMet /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -3954,16 +3958,16 @@ public OperationStatusResultInner start(String resourceGroupName, String bareMet /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> uncordonWithResponseAsync(String resourceGroupName, @@ -3993,17 +3997,17 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> uncordonWithResponseAsync(String resourceGroupName, @@ -4032,9 +4036,9 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4053,9 +4057,9 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -4076,9 +4080,9 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4094,9 +4098,9 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -4113,9 +4117,9 @@ private Mono>> uncordonWithResponseAsync(String resour /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4131,9 +4135,9 @@ private Mono uncordonAsync(String resourceGroupName, /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -4151,9 +4155,9 @@ private Mono uncordonAsync(String resourceGroupName, /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4168,9 +4172,9 @@ public OperationStatusResultInner uncordon(String resourceGroupName, String bare /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -4186,14 +4190,13 @@ public OperationStatusResultInner uncordon(String resourceGroupName, String bare /** * 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. * @return bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -4215,15 +4218,14 @@ private Mono> listBySubscriptionNextSingleP /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -4244,14 +4246,13 @@ private Mono> listBySubscriptionNextSingleP /** * 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. * @return bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -4273,15 +4274,14 @@ private Mono> listByResourceGroupNextSingle /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java index 04d967a32c406..660d92cc050b0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java @@ -37,23 +37,23 @@ public BareMetalMachinesImpl(BareMetalMachinesClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -77,12 +77,23 @@ public BareMetalMachine getByResourceGroup(String resourceGroupName, String bare } } - public void deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName) { - this.serviceClient().delete(resourceGroupName, bareMetalMachineName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, bareMetalMachineName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String bareMetalMachineName, Context context) { - this.serviceClient().delete(resourceGroupName, bareMetalMachineName, context); + public OperationStatusResult delete(String resourceGroupName, String bareMetalMachineName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, bareMetalMachineName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public OperationStatusResult cordon(String resourceGroupName, String bareMetalMachineName) { @@ -289,12 +300,12 @@ public OperationStatusResult uncordon(String resourceGroupName, String bareMetal } public BareMetalMachine getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + String bareMetalMachineName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachines"); if (bareMetalMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); @@ -303,12 +314,12 @@ public BareMetalMachine getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + String bareMetalMachineName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachines"); if (bareMetalMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); @@ -316,32 +327,32 @@ public Response getByIdWithResponse(String id, Context context return this.getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + String bareMetalMachineName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachines"); if (bareMetalMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); } - this.delete(resourceGroupName, bareMetalMachineName, Context.NONE); + return this.delete(resourceGroupName, bareMetalMachineName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + String bareMetalMachineName = ResourceManagerUtils.getValueFromIdByName(id, "bareMetalMachines"); if (bareMetalMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); } - this.delete(resourceGroupName, bareMetalMachineName, context); + return this.delete(resourceGroupName, bareMetalMachineName, context); } private BareMetalMachinesClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java index 6e6fe97cd8140..cd616c7e8419c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java @@ -182,9 +182,9 @@ public BmcKeySet apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - this.bmcKeySetName = Utils.getValueFromIdByName(innerObject.id(), "bmcKeySets"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.bmcKeySetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bmcKeySets"); } public BmcKeySet refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java index e3cdd04ff2158..62be00ab48763 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.BmcKeySetsClient; import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BmcKeySetList; import com.azure.resourcemanager.networkcloud.models.BmcKeySetPatchParameters; 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 BmcKeySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in BmcKeySetsClient. + */ public final class BmcKeySetsClientImpl implements BmcKeySetsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BmcKeySetsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of BmcKeySetsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BmcKeySetsClientImpl(NetworkCloudImpl client) { @@ -125,16 +132,16 @@ Mono> listByClusterNext(@PathParam(value = "nextLink", e /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of baseboard management controller key sets for the provided cluster along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of baseboard management controller key sets for the provided cluster along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -165,17 +172,17 @@ private Mono> listByClusterSinglePageAsync(String /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of baseboard management controller key sets for the provided cluster along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of baseboard management controller key sets for the provided cluster along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -206,16 +213,16 @@ private Mono> listByClusterSinglePageAsync(String /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { @@ -225,9 +232,9 @@ private PagedFlux listByClusterAsync(String resourceGroupName, S /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -235,7 +242,7 @@ private PagedFlux listByClusterAsync(String resourceGroupName, S * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, @@ -246,16 +253,16 @@ private PagedFlux listByClusterAsync(String resourceGroupName, S /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { @@ -264,9 +271,9 @@ public PagedIterable listByCluster(String resourceGroupName, Str /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -274,7 +281,7 @@ public PagedIterable listByCluster(String resourceGroupName, Str * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { @@ -283,9 +290,9 @@ public PagedIterable listByCluster(String resourceGroupName, Str /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -293,7 +300,7 @@ public PagedIterable listByCluster(String resourceGroupName, Str * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return baseboard management controller key set of the provided cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, @@ -325,9 +332,9 @@ private Mono> getWithResponseAsync(String resourceGroup /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -336,7 +343,7 @@ private Mono> getWithResponseAsync(String resourceGroup * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return baseboard management controller key set of the provided cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, @@ -367,9 +374,9 @@ private Mono> getWithResponseAsync(String resourceGroup /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -386,9 +393,9 @@ private Mono getAsync(String resourceGroupName, String clusterNa /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -406,9 +413,9 @@ public Response getWithResponse(String resourceGroupName, String /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -424,9 +431,9 @@ public BmcKeySetInner get(String resourceGroupName, String clusterName, String b /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -435,7 +442,7 @@ public BmcKeySetInner get(String resourceGroupName, String clusterName, String b * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bmcKeySet represents the baseboard management controller key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -474,9 +481,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -486,7 +493,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bmcKeySet represents the baseboard management controller key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -524,9 +531,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -547,9 +554,9 @@ private PollerFlux, BmcKeySetInner> beginCreateOrUpda /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -572,9 +579,9 @@ private PollerFlux, BmcKeySetInner> beginCreateOrUpda /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -593,9 +600,9 @@ public SyncPoller, BmcKeySetInner> beginCreateOrUpdat /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -616,9 +623,9 @@ public SyncPoller, BmcKeySetInner> beginCreateOrUpdat /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -626,8 +633,8 @@ public SyncPoller, BmcKeySetInner> beginCreateOrUpdat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySet represents the baseboard management controller key set on successful completion of {@link - * Mono}. + * @return bmcKeySet represents the baseboard management controller key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, String bmcKeySetName, @@ -638,9 +645,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -649,8 +656,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySet represents the baseboard management controller key set on successful completion of {@link - * Mono}. + * @return bmcKeySet represents the baseboard management controller key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, String bmcKeySetName, @@ -662,9 +669,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -682,9 +689,9 @@ public BmcKeySetInner createOrUpdate(String resourceGroupName, String clusterNam /** * Create or update the baseboard management controller key set of the cluster. - * - *

Create a new baseboard management controller key set or update the existing one for the provided cluster. - * + * + * Create a new baseboard management controller key set or update the existing one for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -703,16 +710,17 @@ public BmcKeySetInner createOrUpdate(String resourceGroupName, String clusterNam /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -744,9 +752,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -754,7 +762,8 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -785,30 +794,31 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String bmcKeySetName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName, String bmcKeySetName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -816,42 +826,42 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String bmcKeySetName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bmcKeySetName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String bmcKeySetName) { return this.beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName).getSyncPoller(); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -859,38 +869,39 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String bmcKeySetName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { return this.beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).getSyncPoller(); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String bmcKeySetName) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String bmcKeySetName) { return beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -898,37 +909,38 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String bmcKeySetName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String bmcKeySetName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String bmcKeySetName) { - deleteAsync(resourceGroupName, clusterName, bmcKeySetName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bmcKeySetName) { + return deleteAsync(resourceGroupName, clusterName, bmcKeySetName).block(); } /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -936,18 +948,20 @@ public void delete(String resourceGroupName, String clusterName, String bmcKeySe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { - deleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, String bmcKeySetName, + Context context) { + return deleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).block(); } /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -956,7 +970,7 @@ public void delete(String resourceGroupName, String clusterName, String bmcKeySe * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bmcKeySet represents the baseboard management controller key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -992,10 +1006,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1005,7 +1019,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return bmcKeySet represents the baseboard management controller key set along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1039,10 +1053,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1063,10 +1077,10 @@ private PollerFlux, BmcKeySetInner> beginUpdateAsync( /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1087,10 +1101,10 @@ private PollerFlux, BmcKeySetInner> beginUpdateAsync( /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1113,10 +1127,10 @@ private PollerFlux, BmcKeySetInner> beginUpdateAsync( /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1135,10 +1149,10 @@ public SyncPoller, BmcKeySetInner> beginUpdate(String /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1158,10 +1172,10 @@ public SyncPoller, BmcKeySetInner> beginUpdate(String /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1169,8 +1183,8 @@ public SyncPoller, BmcKeySetInner> beginUpdate(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySet represents the baseboard management controller key set on successful completion of {@link - * Mono}. + * @return bmcKeySet represents the baseboard management controller key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, String bmcKeySetName, @@ -1181,18 +1195,18 @@ private Mono updateAsync(String resourceGroupName, String cluste /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySet represents the baseboard management controller key set on successful completion of {@link - * Mono}. + * @return bmcKeySet represents the baseboard management controller key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, String bmcKeySetName) { @@ -1203,10 +1217,10 @@ private Mono updateAsync(String resourceGroupName, String cluste /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1215,8 +1229,8 @@ private Mono updateAsync(String resourceGroupName, String cluste * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySet represents the baseboard management controller key set on successful completion of {@link - * Mono}. + * @return bmcKeySet represents the baseboard management controller key set on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, String bmcKeySetName, @@ -1228,10 +1242,10 @@ private Mono updateAsync(String resourceGroupName, String cluste /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1248,10 +1262,10 @@ public BmcKeySetInner update(String resourceGroupName, String clusterName, Strin /** * Patch baseboard management controller key set of the cluster. - * - *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * + * Patch properties of baseboard management controller key set for the provided cluster, or update the tags * associated with it. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -1270,14 +1284,13 @@ public BmcKeySetInner update(String resourceGroupName, String clusterName, Strin /** * 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. - * @return bmcKeySetList represents a list of baseboard management controller key sets along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return bmcKeySetList represents a list of baseboard management controller key sets along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink) { @@ -1298,15 +1311,14 @@ private Mono> listByClusterNextSinglePageAsync(Str /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return bmcKeySetList represents a list of baseboard management controller key sets along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return bmcKeySetList represents a list of baseboard management controller key sets along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java index 7ced97b385398..33c09361b3ade 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.BmcKeySetsClient; import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.BmcKeySet; import com.azure.resourcemanager.networkcloud.models.BmcKeySets; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class BmcKeySetsImpl implements BmcKeySets { private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetsImpl.class); @@ -29,13 +31,13 @@ public BmcKeySetsImpl(BmcKeySetsClient innerClient, public PagedIterable listByCluster(String resourceGroupName, String clusterName) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); - return Utils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); } public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String clusterName, String bmcKeySetName, @@ -59,26 +61,38 @@ public BmcKeySet get(String resourceGroupName, String clusterName, String bmcKey } } - public void delete(String resourceGroupName, String clusterName, String bmcKeySetName) { - this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName); + public OperationStatusResult delete(String resourceGroupName, String clusterName, String bmcKeySetName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName, context); + public OperationStatusResult delete(String resourceGroupName, String clusterName, String bmcKeySetName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public BmcKeySet getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + String bmcKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bmcKeySets"); if (bmcKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); @@ -87,17 +101,17 @@ public BmcKeySet getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + String bmcKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bmcKeySets"); if (bmcKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); @@ -105,42 +119,42 @@ public Response getByIdWithResponse(String id, Context context) { return this.getWithResponse(resourceGroupName, clusterName, bmcKeySetName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + String bmcKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bmcKeySets"); if (bmcKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); } - this.delete(resourceGroupName, clusterName, bmcKeySetName, Context.NONE); + return this.delete(resourceGroupName, clusterName, bmcKeySetName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + String bmcKeySetName = ResourceManagerUtils.getValueFromIdByName(id, "bmcKeySets"); if (bmcKeySetName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); } - this.delete(resourceGroupName, clusterName, bmcKeySetName, context); + return this.delete(resourceGroupName, clusterName, bmcKeySetName, context); } private BmcKeySetsClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java index 7d1b67af6ec45..f0188075f57cb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java @@ -202,8 +202,9 @@ public CloudServicesNetwork apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.cloudServicesNetworkName = Utils.getValueFromIdByName(innerObject.id(), "cloudServicesNetworks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudServicesNetworkName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudServicesNetworks"); } public CloudServicesNetwork refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java index 9646d5b0546aa..55de49954f6eb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.CloudServicesNetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkList; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; 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 CloudServicesNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in CloudServicesNetworksClient. + */ public final class CloudServicesNetworksClientImpl implements CloudServicesNetworksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CloudServicesNetworksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of CloudServicesNetworksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ CloudServicesNetworksClientImpl(NetworkCloudImpl client) { @@ -144,13 +151,13 @@ Mono> listByResourceGroupNext( /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cloud services networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -173,15 +180,15 @@ private Mono> listSinglePageAsync() { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cloud services networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -204,13 +211,13 @@ private Mono> listSinglePageAsync(Conte /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -220,15 +227,15 @@ private PagedFlux listAsync() { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -238,13 +245,13 @@ private PagedFlux listAsync(Context context) { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -253,15 +260,15 @@ public PagedIterable list() { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -270,15 +277,15 @@ public PagedIterable list(Context context) { /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cloud services networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -306,16 +313,16 @@ public PagedIterable list(Context context) { /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cloud services networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -343,15 +350,15 @@ private Mono> listByResourceGroupSingle /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -361,16 +368,16 @@ private PagedFlux listByResourceGroupAsync(String res /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -380,15 +387,15 @@ private PagedFlux listByResourceGroupAsync(String res /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -397,16 +404,16 @@ public PagedIterable listByResourceGroup(String resou /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -415,16 +422,16 @@ public PagedIterable listByResourceGroup(String resou /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided cloud services network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -454,9 +461,9 @@ private Mono> getByResourceGroupWithResponse /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. @@ -464,7 +471,7 @@ private Mono> getByResourceGroupWithResponse * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided cloud services network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -493,9 +500,9 @@ private Mono> getByResourceGroupWithResponse /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -512,9 +519,9 @@ private Mono getByResourceGroupAsync(String resourceG /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. @@ -531,9 +538,9 @@ public Response getByResourceGroupWithResponse(String /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -548,9 +555,9 @@ public CloudServicesNetworkInner getByResourceGroup(String resourceGroupName, St /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -558,7 +565,7 @@ public CloudServicesNetworkInner getByResourceGroup(String resourceGroupName, St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -595,9 +602,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -606,7 +613,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -642,9 +649,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -652,7 +659,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudServicesNetworkInner> beginCreateOrUpdateAsync( @@ -667,9 +674,9 @@ private PollerFlux, CloudServicesNetworkIn /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -678,7 +685,7 @@ private PollerFlux, CloudServicesNetworkIn * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudServicesNetworkInner> beginCreateOrUpdateAsync( @@ -693,9 +700,9 @@ private PollerFlux, CloudServicesNetworkIn /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -703,7 +710,7 @@ private PollerFlux, CloudServicesNetworkIn * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( @@ -716,9 +723,9 @@ public SyncPoller, CloudServicesNetworkInn /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -727,7 +734,7 @@ public SyncPoller, CloudServicesNetworkInn * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( @@ -741,9 +748,9 @@ public SyncPoller, CloudServicesNetworkInn /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -751,7 +758,7 @@ public SyncPoller, CloudServicesNetworkInn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters on successful completion of {@link Mono}. + * machines or hybrid AKS clusters on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, @@ -763,9 +770,9 @@ private Mono createOrUpdateAsync(String resourceGroup /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -774,7 +781,7 @@ private Mono createOrUpdateAsync(String resourceGroup * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters on successful completion of {@link Mono}. + * machines or hybrid AKS clusters on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, @@ -785,9 +792,9 @@ private Mono createOrUpdateAsync(String resourceGroup /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -795,7 +802,7 @@ private Mono createOrUpdateAsync(String resourceGroup * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) public CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudServicesNetworkName, @@ -805,9 +812,9 @@ public CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String /** * Create or update the cloud services network. - * - *

Create a new cloud services network or update the properties of the existing cloud services network. - * + * + * Create a new cloud services network or update the properties of the existing cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkParameters The request body. @@ -816,7 +823,7 @@ public CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) public CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String cloudServicesNetworkName, @@ -827,15 +834,16 @@ public CloudServicesNetworkInner createOrUpdate(String resourceGroupName, String /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -865,16 +873,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -903,159 +912,165 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String cloudServicesNetworkName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String cloudServicesNetworkName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServicesNetworkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String cloudServicesNetworkName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String cloudServicesNetworkName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServicesNetworkName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServicesNetworkName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String cloudServicesNetworkName) { return this.beginDeleteAsync(resourceGroupName, cloudServicesNetworkName).getSyncPoller(); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServicesNetworkName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String cloudServicesNetworkName, Context context) { return this.beginDeleteAsync(resourceGroupName, cloudServicesNetworkName, context).getSyncPoller(); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String cloudServicesNetworkName) { + private Mono deleteAsync(String resourceGroupName, String cloudServicesNetworkName) { return beginDeleteAsync(resourceGroupName, cloudServicesNetworkName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String cloudServicesNetworkName, Context context) { + private Mono deleteAsync(String resourceGroupName, String cloudServicesNetworkName, + Context context) { return beginDeleteAsync(resourceGroupName, cloudServicesNetworkName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cloudServicesNetworkName) { - deleteAsync(resourceGroupName, cloudServicesNetworkName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String cloudServicesNetworkName) { + return deleteAsync(resourceGroupName, cloudServicesNetworkName).block(); } /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cloudServicesNetworkName, Context context) { - deleteAsync(resourceGroupName, cloudServicesNetworkName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String cloudServicesNetworkName, + Context context) { + return deleteAsync(resourceGroupName, cloudServicesNetworkName, context).block(); } /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1063,7 +1078,7 @@ public void delete(String resourceGroupName, String cloudServicesNetworkName, Co * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1097,10 +1112,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1109,7 +1124,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1142,10 +1157,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1153,7 +1168,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudServicesNetworkInner> beginUpdateAsync( @@ -1168,17 +1183,17 @@ private PollerFlux, CloudServicesNetworkIn /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudServicesNetworkInner> @@ -1193,10 +1208,10 @@ private PollerFlux, CloudServicesNetworkIn /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1205,7 +1220,7 @@ private PollerFlux, CloudServicesNetworkIn * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudServicesNetworkInner> beginUpdateAsync( @@ -1220,17 +1235,17 @@ private PollerFlux, CloudServicesNetworkIn /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudServicesNetworkInner> @@ -1242,10 +1257,10 @@ private PollerFlux, CloudServicesNetworkIn /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1254,7 +1269,7 @@ private PollerFlux, CloudServicesNetworkIn * @throws 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 cloudServicesNetwork represents additional egress information that - * will be used by associated virtual machines or hybrid AKS clusters. + * will be used by associated virtual machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudServicesNetworkInner> beginUpdate( @@ -1268,10 +1283,10 @@ public SyncPoller, CloudServicesNetworkInn /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1279,7 +1294,7 @@ public SyncPoller, CloudServicesNetworkInn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters on successful completion of {@link Mono}. + * machines or hybrid AKS clusters on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String cloudServicesNetworkName, @@ -1291,17 +1306,17 @@ private Mono updateAsync(String resourceGroupName, St /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters on successful completion of {@link Mono}. + * machines or hybrid AKS clusters on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String cloudServicesNetworkName) { @@ -1313,10 +1328,10 @@ private Mono updateAsync(String resourceGroupName, St /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1325,7 +1340,7 @@ private Mono updateAsync(String resourceGroupName, St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters on successful completion of {@link Mono}. + * machines or hybrid AKS clusters on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String cloudServicesNetworkName, @@ -1336,17 +1351,17 @@ private Mono updateAsync(String resourceGroupName, St /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) public CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName) { @@ -1356,10 +1371,10 @@ public CloudServicesNetworkInner update(String resourceGroupName, String cloudSe /** * Patch the cloud services network. - * - *

Update properties of the provided cloud services network, or update the tags associated with it. Properties - * and tag updates can be done independently. - * + * + * Update properties of the provided cloud services network, or update the tags associated with it. Properties and + * tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param cloudServicesNetworkUpdateParameters The request body. @@ -1368,7 +1383,7 @@ public CloudServicesNetworkInner update(String resourceGroupName, String cloudSe * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetwork represents additional egress information that will be used by associated virtual - * machines or hybrid AKS clusters. + * machines or hybrid AKS clusters. */ @ServiceMethod(returns = ReturnType.SINGLE) public CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName, @@ -1379,14 +1394,13 @@ public CloudServicesNetworkInner update(String resourceGroupName, String cloudSe /** * 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. * @return cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1408,15 +1422,14 @@ private Mono> listBySubscriptionNextSin /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1437,14 +1450,13 @@ private Mono> listBySubscriptionNextSin /** * 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. * @return cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1466,15 +1478,14 @@ private Mono> listByResourceGroupNextSi /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java index a1d94155d6c35..8e680aa3fb920 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.CloudServicesNetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworks; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class CloudServicesNetworksImpl implements CloudServicesNetworks { private static final ClientLogger LOGGER = new ClientLogger(CloudServicesNetworksImpl.class); @@ -29,23 +31,23 @@ public CloudServicesNetworksImpl(CloudServicesNetworksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -70,21 +72,32 @@ public CloudServicesNetwork getByResourceGroup(String resourceGroupName, String } } - public void deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName) { - this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String cloudServicesNetworkName, Context context) { - this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName, context); + public OperationStatusResult delete(String resourceGroupName, String cloudServicesNetworkName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public CloudServicesNetwork getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + String cloudServicesNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "cloudServicesNetworks"); if (cloudServicesNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", id))); @@ -94,12 +107,12 @@ public CloudServicesNetwork getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + String cloudServicesNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "cloudServicesNetworks"); if (cloudServicesNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", id))); @@ -107,32 +120,32 @@ public Response getByIdWithResponse(String id, Context con return this.getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + String cloudServicesNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "cloudServicesNetworks"); if (cloudServicesNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", id))); } - this.delete(resourceGroupName, cloudServicesNetworkName, Context.NONE); + return this.delete(resourceGroupName, cloudServicesNetworkName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + String cloudServicesNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "cloudServicesNetworks"); if (cloudServicesNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", id))); } - this.delete(resourceGroupName, cloudServicesNetworkName, context); + return this.delete(resourceGroupName, cloudServicesNetworkName, context); } private CloudServicesNetworksClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java index 8e7314722832e..c96ba5a6d75eb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java @@ -8,23 +8,34 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import com.azure.resourcemanager.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.Cluster; import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterSecretArchive; import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettings; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsPatch; import java.util.Collections; import java.util.List; import java.util.Map; @@ -63,6 +74,10 @@ public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -71,6 +86,10 @@ public RackDefinition aggregatorOrSingleRackDefinition() { return this.innerModel().aggregatorOrSingleRackDefinition(); } + public AnalyticsOutputSettings analyticsOutputSettings() { + return this.innerModel().analyticsOutputSettings(); + } + public String analyticsWorkspaceId() { return this.innerModel().analyticsWorkspaceId(); } @@ -120,6 +139,10 @@ public String clusterVersion() { return this.innerModel().clusterVersion(); } + public CommandOutputSettings commandOutputSettings() { + return this.innerModel().commandOutputSettings(); + } + public ValidationThreshold computeDeploymentThreshold() { return this.innerModel().computeDeploymentThreshold(); } @@ -161,10 +184,30 @@ public ClusterProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public RuntimeProtectionConfiguration runtimeProtectionConfiguration() { + return this.innerModel().runtimeProtectionConfiguration(); + } + + public ClusterSecretArchive secretArchive() { + return this.innerModel().secretArchive(); + } + + public SecretArchiveSettings secretArchiveSettings() { + return this.innerModel().secretArchiveSettings(); + } + public String supportExpiryDate() { return this.innerModel().supportExpiryDate(); } + public ClusterUpdateStrategy updateStrategy() { + return this.innerModel().updateStrategy(); + } + + public VulnerabilityScanningSettings vulnerabilityScanningSettings() { + return this.innerModel().vulnerabilityScanningSettings(); + } + public List workloadResourceIds() { List inner = this.innerModel().workloadResourceIds(); if (inner != null) { @@ -247,8 +290,8 @@ public Cluster apply(Context context) { ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); } public Cluster refresh() { @@ -267,6 +310,18 @@ public Cluster refresh(Context context) { return this; } + public OperationStatusResult + continueUpdateVersion(ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + return serviceManager.clusters() + .continueUpdateVersion(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters); + } + + public OperationStatusResult continueUpdateVersion( + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + return serviceManager.clusters() + .continueUpdateVersion(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, context); + } + public OperationStatusResult deploy() { return serviceManager.clusters().deploy(resourceGroupName, clusterName); } @@ -275,6 +330,16 @@ public OperationStatusResult deploy(ClusterDeployParameters clusterDeployParamet return serviceManager.clusters().deploy(resourceGroupName, clusterName, clusterDeployParameters, context); } + public OperationStatusResult scanRuntime() { + return serviceManager.clusters().scanRuntime(resourceGroupName, clusterName); + } + + public OperationStatusResult scanRuntime(ClusterScanRuntimeParameters clusterScanRuntimeParameters, + Context context) { + return serviceManager.clusters() + .scanRuntime(resourceGroupName, clusterName, clusterScanRuntimeParameters, context); + } + public OperationStatusResult updateVersion(ClusterUpdateVersionParameters clusterUpdateVersionParameters) { return serviceManager.clusters().updateVersion(resourceGroupName, clusterName, clusterUpdateVersionParameters); } @@ -335,6 +400,26 @@ public ClusterImpl withTags(Map tags) { } } + public ClusterImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateClusterUpdateParameters.withIdentity(identity); + return this; + } + } + + public ClusterImpl withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings) { + if (isInCreateMode()) { + this.innerModel().withAnalyticsOutputSettings(analyticsOutputSettings); + return this; + } else { + this.updateClusterUpdateParameters.withAnalyticsOutputSettings(analyticsOutputSettings); + return this; + } + } + public ClusterImpl withAnalyticsWorkspaceId(String analyticsWorkspaceId) { this.innerModel().withAnalyticsWorkspaceId(analyticsWorkspaceId); return this; @@ -360,6 +445,16 @@ public ClusterImpl withClusterServicePrincipal(ServicePrincipalInformation clust } } + public ClusterImpl withCommandOutputSettings(CommandOutputSettings commandOutputSettings) { + if (isInCreateMode()) { + this.innerModel().withCommandOutputSettings(commandOutputSettings); + return this; + } else { + this.updateClusterUpdateParameters.withCommandOutputSettings(commandOutputSettings); + return this; + } + } + public ClusterImpl withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { if (isInCreateMode()) { this.innerModel().withComputeDeploymentThreshold(computeDeploymentThreshold); @@ -386,6 +481,58 @@ public ClusterImpl withComputeRackDefinitions(List computeRackDe return this; } + public ClusterImpl + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration) { + if (isInCreateMode()) { + this.innerModel().withRuntimeProtectionConfiguration(runtimeProtectionConfiguration); + return this; + } else { + this.updateClusterUpdateParameters.withRuntimeProtectionConfiguration(runtimeProtectionConfiguration); + return this; + } + } + + public ClusterImpl withSecretArchive(ClusterSecretArchive secretArchive) { + if (isInCreateMode()) { + this.innerModel().withSecretArchive(secretArchive); + return this; + } else { + this.updateClusterUpdateParameters.withSecretArchive(secretArchive); + return this; + } + } + + public ClusterImpl withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings) { + if (isInCreateMode()) { + this.innerModel().withSecretArchiveSettings(secretArchiveSettings); + return this; + } else { + this.updateClusterUpdateParameters.withSecretArchiveSettings(secretArchiveSettings); + return this; + } + } + + public ClusterImpl withUpdateStrategy(ClusterUpdateStrategy updateStrategy) { + if (isInCreateMode()) { + this.innerModel().withUpdateStrategy(updateStrategy); + return this; + } else { + this.updateClusterUpdateParameters.withUpdateStrategy(updateStrategy); + return this; + } + } + + public ClusterImpl withVulnerabilityScanningSettings(VulnerabilityScanningSettings vulnerabilityScanningSettings) { + this.innerModel().withVulnerabilityScanningSettings(vulnerabilityScanningSettings); + return this; + } + + public ClusterImpl + withVulnerabilityScanningSettings(VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings) { + this.updateClusterUpdateParameters.withVulnerabilityScanningSettings(vulnerabilityScanningSettings); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java index 788bc29a33a76..35e8c93348e4b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; import java.util.Collections; import java.util.List; import java.util.Map; @@ -49,6 +50,10 @@ public Map tags() { } } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -180,8 +185,8 @@ public ClusterManager apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterManagerName = Utils.getValueFromIdByName(innerObject.id(), "clusterManagers"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusterManagers"); } public ClusterManager refresh() { @@ -225,6 +230,16 @@ public ClusterManagerImpl withTags(Map tags) { } } + public ClusterManagerImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateClusterManagerUpdateParameters.withIdentity(identity); + return this; + } + } + public ClusterManagerImpl withAnalyticsWorkspaceId(String analyticsWorkspaceId) { this.innerModel().withAnalyticsWorkspaceId(analyticsWorkspaceId); return this; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java index 18491ffea4fbe..11d22c1f7db08 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.ClusterManagersClient; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterManagerList; import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; 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 ClusterManagersClient. */ +/** + * An instance of this class provides access to all the operations defined in ClusterManagersClient. + */ public final class ClusterManagersClientImpl implements ClusterManagersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ClusterManagersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of ClusterManagersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ClusterManagersClientImpl(NetworkCloudImpl client) { @@ -144,13 +151,13 @@ Mono> listByResourceGroupNext( /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -173,15 +180,15 @@ private Mono> listSinglePageAsync() { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -204,9 +211,9 @@ private Mono> listSinglePageAsync(Context con /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription as paginated response with {@link PagedFlux}. @@ -219,9 +226,9 @@ private PagedFlux listAsync() { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -236,9 +243,9 @@ private PagedFlux listAsync(Context context) { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. @@ -250,9 +257,9 @@ public PagedIterable list() { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -266,15 +273,15 @@ public PagedIterable list(Context context) { /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -301,16 +308,16 @@ private Mono> listByResourceGroupSinglePageAs /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -338,9 +345,9 @@ private Mono> listByResourceGroupSinglePageAs /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -355,9 +362,9 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,15 +380,15 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -390,16 +397,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -408,16 +415,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 properties of the provided cluster manager along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -447,9 +454,9 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. @@ -457,7 +464,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws 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 properties of the provided cluster manager along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -486,9 +493,9 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -504,9 +511,9 @@ private Mono getByResourceGroupAsync(String resourceGroupNa /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. @@ -523,9 +530,9 @@ public Response getByResourceGroupWithResponse(String resou /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -540,17 +547,17 @@ public ClusterManagerInner getByResourceGroup(String resourceGroupName, String c /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response} on successful completion of {@link Mono}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -587,9 +594,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -597,8 +604,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response} on successful completion of {@link Mono}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -634,9 +641,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -644,7 +651,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterManagerInner> beginCreateOrUpdateAsync( @@ -657,9 +664,9 @@ private PollerFlux, ClusterManagerInner> beginCr /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -668,7 +675,7 @@ private PollerFlux, ClusterManagerInner> beginCr * @throws 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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterManagerInner> beginCreateOrUpdateAsync( @@ -683,9 +690,9 @@ private PollerFlux, ClusterManagerInner> beginCr /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -693,7 +700,7 @@ private PollerFlux, ClusterManagerInner> beginCr * @throws 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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterManagerInner> beginCreateOrUpdate( @@ -704,9 +711,9 @@ public SyncPoller, ClusterManagerInner> beginCre /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -715,7 +722,7 @@ public SyncPoller, ClusterManagerInner> beginCre * @throws 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 clusterManager represents a control-plane to manage one or more - * on-premises clusters. + * on-premises clusters. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterManagerInner> beginCreateOrUpdate( @@ -727,9 +734,9 @@ public SyncPoller, ClusterManagerInner> beginCre /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -737,7 +744,7 @@ public SyncPoller, ClusterManagerInner> beginCre * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterManager represents a control-plane to manage one or more on-premises clusters on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterManagerName, @@ -748,9 +755,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -759,7 +766,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterManager represents a control-plane to manage one or more on-premises clusters on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterManagerName, @@ -770,9 +777,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -789,9 +796,9 @@ public ClusterManagerInner createOrUpdate(String resourceGroupName, String clust /** * Create or update the cluster manager. - * - *

Create a new cluster manager or update properties of the cluster manager if it exists. - * + * + * Create a new cluster manager or update properties of the cluster manager if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerParameters The request body. @@ -809,15 +816,16 @@ public ClusterManagerInner createOrUpdate(String resourceGroupName, String clust /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -847,16 +855,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -885,165 +894,171 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterManagerName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterManagerName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterManagerName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterManagerName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterManagerName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterManagerName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterManagerName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterManagerName) { return this.beginDeleteAsync(resourceGroupName, clusterManagerName).getSyncPoller(); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterManagerName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterManagerName, Context context) { return this.beginDeleteAsync(resourceGroupName, clusterManagerName, context).getSyncPoller(); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterManagerName) { + private Mono deleteAsync(String resourceGroupName, String clusterManagerName) { return beginDeleteAsync(resourceGroupName, clusterManagerName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterManagerName, Context context) { + private Mono deleteAsync(String resourceGroupName, String clusterManagerName, + Context context) { return beginDeleteAsync(resourceGroupName, clusterManagerName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterManagerName) { - deleteAsync(resourceGroupName, clusterManagerName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterManagerName) { + return deleteAsync(resourceGroupName, clusterManagerName).block(); } /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterManagerName, Context context) { - deleteAsync(resourceGroupName, clusterManagerName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterManagerName, Context context) { + return deleteAsync(resourceGroupName, clusterManagerName, context).block(); } /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerUpdateParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response} on successful completion of {@link Mono}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, @@ -1077,10 +1092,10 @@ private Mono> updateWithResponseAsync(String resou /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerUpdateParameters The request body. @@ -1088,8 +1103,8 @@ private Mono> updateWithResponseAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response} on successful completion of {@link Mono}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, @@ -1121,17 +1136,17 @@ private Mono> updateWithResponseAsync(String resou /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterManager represents a control-plane to manage one or more on-premises clusters on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterManagerName) { @@ -1142,10 +1157,10 @@ private Mono updateAsync(String resourceGroupName, String c /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param clusterManagerUpdateParameters The request body. @@ -1153,8 +1168,8 @@ private Mono updateAsync(String resourceGroupName, String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link - * Response}. + * @return clusterManager represents a control-plane to manage one or more on-premises clusters along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String clusterManagerName, @@ -1165,10 +1180,10 @@ public Response updateWithResponse(String resourceGroupName /** * Patch the cluster manager. - * - *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. - * Properties and tag updates can be done independently. - * + * + * Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties + * and tag updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1185,14 +1200,13 @@ public ClusterManagerInner update(String resourceGroupName, String clusterManage /** * 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. * @return clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1214,15 +1228,14 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1243,14 +1256,13 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @return clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1272,15 +1284,14 @@ private Mono> listByResourceGroupNextSinglePa /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java index 3ab946c3755e8..7a74c19939907 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.ClusterManagersClient; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterManager; import com.azure.resourcemanager.networkcloud.models.ClusterManagers; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class ClusterManagersImpl implements ClusterManagers { private static final ClientLogger LOGGER = new ClientLogger(ClusterManagersImpl.class); @@ -29,22 +31,22 @@ public ClusterManagersImpl(ClusterManagersClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterManagerName, @@ -68,21 +70,31 @@ public ClusterManager getByResourceGroup(String resourceGroupName, String cluste } } - public void deleteByResourceGroup(String resourceGroupName, String clusterManagerName) { - this.serviceClient().delete(resourceGroupName, clusterManagerName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String clusterManagerName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, clusterManagerName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String clusterManagerName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterManagerName, context); + public OperationStatusResult delete(String resourceGroupName, String clusterManagerName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, clusterManagerName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public ClusterManager getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + String clusterManagerName = ResourceManagerUtils.getValueFromIdByName(id, "clusterManagers"); if (clusterManagerName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); @@ -91,12 +103,12 @@ public ClusterManager getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + String clusterManagerName = ResourceManagerUtils.getValueFromIdByName(id, "clusterManagers"); if (clusterManagerName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); @@ -104,32 +116,32 @@ public Response getByIdWithResponse(String id, Context context) return this.getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + String clusterManagerName = ResourceManagerUtils.getValueFromIdByName(id, "clusterManagers"); if (clusterManagerName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); } - this.delete(resourceGroupName, clusterManagerName, Context.NONE); + return this.delete(resourceGroupName, clusterManagerName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + String clusterManagerName = ResourceManagerUtils.getValueFromIdByName(id, "clusterManagers"); if (clusterManagerName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); } - this.delete(resourceGroupName, clusterManagerName, context); + return this.delete(resourceGroupName, clusterManagerName, context); } private ClusterManagersClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java index e44ea0e8a61a8..2461ccc434193 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java @@ -170,9 +170,10 @@ public ClusterMetricsConfiguration apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - this.metricsConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "metricsConfigurations"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.metricsConfigurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "metricsConfigurations"); } public ClusterMetricsConfiguration refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java index b33962993966d..a7a9e278218de 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java @@ -36,25 +36,33 @@ import com.azure.resourcemanager.networkcloud.fluent.ClustersClient; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; import com.azure.resourcemanager.networkcloud.models.ClusterList; import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; 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 ClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ public final class ClustersClientImpl implements ClustersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ClustersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of ClustersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ClustersClientImpl(NetworkCloudImpl client) { @@ -124,9 +132,19 @@ Mono>> update(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterPatchParameters clusterUpdateParameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> continueUpdateVersion(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> deploy(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -134,9 +152,19 @@ Mono>> deploy(@HostParam("$host") String endpoint, @BodyParam("application/json") ClusterDeployParameters clusterDeployParameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scanRuntime(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterScanRuntimeParameters clusterScanRuntimeParameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> updateVersion(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -163,13 +191,13 @@ Mono> listByResourceGroupNext( /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -192,15 +220,15 @@ private Mono> listSinglePageAsync() { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -223,9 +251,9 @@ private Mono> listSinglePageAsync(Context context) { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription as paginated response with {@link PagedFlux}. @@ -238,9 +266,9 @@ private PagedFlux listAsync() { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -255,9 +283,9 @@ private PagedFlux listAsync(Context context) { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. @@ -269,9 +297,9 @@ public PagedIterable list() { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -285,15 +313,15 @@ public PagedIterable list(Context context) { /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -320,16 +348,16 @@ private Mono> listByResourceGroupSinglePageAsync(Str /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -357,9 +385,9 @@ private Mono> listByResourceGroupSinglePageAsync(Str /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -374,9 +402,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -392,9 +420,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -408,9 +436,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -425,9 +453,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -462,9 +490,9 @@ private Mono> getByResourceGroupWithResponseAsync(String /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -499,9 +527,9 @@ private Mono> getByResourceGroupWithResponseAsync(String /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -517,9 +545,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -536,9 +564,9 @@ public Response getByResourceGroupWithResponse(String resourceGrou /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -553,9 +581,9 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -563,7 +591,7 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster represents the on-premises Network Cloud cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -598,9 +626,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -609,7 +637,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster represents the on-premises Network Cloud cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -643,9 +671,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -665,9 +693,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -689,9 +717,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -708,9 +736,9 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -729,9 +757,9 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -749,9 +777,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -770,9 +798,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -788,9 +816,9 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, /** * Create or update the cluster. - * - *

Create a new cluster or update the properties of the cluster if it exists. - * + * + * Create a new cluster or update the properties of the cluster if it exists. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterParameters The request body. @@ -808,15 +836,16 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { @@ -844,16 +873,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -881,156 +911,162 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName) { return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, Context context) { return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName) { + private Mono deleteAsync(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + Context context) { return beginDeleteAsync(resourceGroupName, clusterName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName) { + return deleteAsync(resourceGroupName, clusterName).block(); } /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, Context context) { + return deleteAsync(resourceGroupName, clusterName, context).block(); } /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1038,7 +1074,7 @@ public void delete(String resourceGroupName, String clusterName, Context context * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster represents the on-premises Network Cloud cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1069,10 +1105,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1081,7 +1117,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster represents the on-premises Network Cloud cluster along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1112,10 +1148,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1135,10 +1171,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1158,10 +1194,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1183,10 +1219,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1203,10 +1239,10 @@ public SyncPoller, ClusterInner> beginUpdate(String res /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1224,10 +1260,10 @@ public SyncPoller, ClusterInner> beginUpdate(String res /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1245,10 +1281,10 @@ private Mono updateAsync(String resourceGroupName, String clusterN /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1265,10 +1301,10 @@ private Mono updateAsync(String resourceGroupName, String clusterN /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1287,10 +1323,10 @@ private Mono updateAsync(String resourceGroupName, String clusterN /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1306,10 +1342,10 @@ public ClusterInner update(String resourceGroupName, String clusterName) { /** * Patch the cluster. - * - *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and - * tag updates can be done independently. - * + * + * Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag + * updates can be done independently. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateParameters The request body. @@ -1326,18 +1362,299 @@ public ClusterInner update(String resourceGroupName, String clusterName, } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> continueUpdateVersionWithResponseAsync(String resourceGroupName, + String clusterName, ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterContinueUpdateVersionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter clusterContinueUpdateVersionParameters is required and cannot be null.")); + } else { + clusterContinueUpdateVersionParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.continueUpdateVersion(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + clusterContinueUpdateVersionParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> continueUpdateVersionWithResponseAsync(String resourceGroupName, + String clusterName, ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterContinueUpdateVersionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter clusterContinueUpdateVersionParameters is required and cannot be null.")); + } else { + clusterContinueUpdateVersionParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.continueUpdateVersion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, + accept, context); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginContinueUpdateVersionAsync(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + Mono>> mono = continueUpdateVersionWithResponseAsync(resourceGroupName, clusterName, + clusterContinueUpdateVersionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginContinueUpdateVersionAsync(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = continueUpdateVersionWithResponseAsync(resourceGroupName, clusterName, + clusterContinueUpdateVersionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginContinueUpdateVersion( + String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + return this + .beginContinueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters) + .getSyncPoller(); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginContinueUpdateVersion( + String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + return this + .beginContinueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, + context) + .getSyncPoller(); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono continueUpdateVersionAsync(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + return beginContinueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono continueUpdateVersionAsync(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + return beginContinueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + return continueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters) + .block(); + } + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + return continueUpdateVersionAsync(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, + context).block(); + } + + /** + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deployWithResponseAsync(String resourceGroupName, String clusterName, @@ -1367,10 +1684,10 @@ private Mono>> deployWithResponseAsync(String resource } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1378,8 +1695,8 @@ private Mono>> deployWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deployWithResponseAsync(String resourceGroupName, String clusterName, @@ -1409,10 +1726,10 @@ private Mono>> deployWithResponseAsync(String resource } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1432,10 +1749,10 @@ private PollerFlux, OperationStatusResult } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1455,10 +1772,10 @@ private PollerFlux, OperationStatusResult } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1480,10 +1797,10 @@ private PollerFlux, OperationStatusResult } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1499,10 +1816,10 @@ private PollerFlux, OperationStatusResult } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1520,10 +1837,10 @@ public SyncPoller, OperationStatusResultI } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1540,10 +1857,10 @@ private Mono deployAsync(String resourceGroupName, S } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1559,10 +1876,10 @@ private Mono deployAsync(String resourceGroupName, S } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1580,10 +1897,10 @@ private Mono deployAsync(String resourceGroupName, S } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1598,10 +1915,10 @@ public OperationStatusResultInner deploy(String resourceGroupName, String cluste } /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -1617,19 +1934,327 @@ public OperationStatusResultInner deploy(String resourceGroupName, String cluste return deployAsync(resourceGroupName, clusterName, clusterDeployParameters, context).block(); } + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scanRuntimeWithResponseAsync(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterScanRuntimeParameters != null) { + clusterScanRuntimeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.scanRuntime(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, clusterScanRuntimeParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scanRuntimeWithResponseAsync(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterScanRuntimeParameters != null) { + clusterScanRuntimeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.scanRuntime(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, clusterScanRuntimeParameters, accept, + context); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginScanRuntimeAsync( + String resourceGroupName, String clusterName, ClusterScanRuntimeParameters clusterScanRuntimeParameters) { + Mono>> mono + = scanRuntimeWithResponseAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginScanRuntimeAsync(String resourceGroupName, String clusterName) { + final ClusterScanRuntimeParameters clusterScanRuntimeParameters = null; + Mono>> mono + = scanRuntimeWithResponseAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginScanRuntimeAsync( + String resourceGroupName, String clusterName, ClusterScanRuntimeParameters clusterScanRuntimeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = scanRuntimeWithResponseAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginScanRuntime(String resourceGroupName, String clusterName) { + final ClusterScanRuntimeParameters clusterScanRuntimeParameters = null; + return this.beginScanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters).getSyncPoller(); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginScanRuntime( + String resourceGroupName, String clusterName, ClusterScanRuntimeParameters clusterScanRuntimeParameters, + Context context) { + return this.beginScanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters, context) + .getSyncPoller(); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scanRuntimeAsync(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters) { + return beginScanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scanRuntimeAsync(String resourceGroupName, String clusterName) { + final ClusterScanRuntimeParameters clusterScanRuntimeParameters = null; + return beginScanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scanRuntimeAsync(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context) { + return beginScanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner scanRuntime(String resourceGroupName, String clusterName) { + final ClusterScanRuntimeParameters clusterScanRuntimeParameters = null; + return scanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters).block(); + } + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner scanRuntime(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context) { + return scanRuntimeAsync(resourceGroupName, clusterName, clusterScanRuntimeParameters, context).block(); + } + /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateVersionWithResponseAsync(String resourceGroupName, @@ -1665,9 +2290,9 @@ private Mono>> updateVersionWithResponseAsync(String r /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1675,8 +2300,8 @@ private Mono>> updateVersionWithResponseAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateVersionWithResponseAsync(String resourceGroupName, @@ -1711,9 +2336,9 @@ private Mono>> updateVersionWithResponseAsync(String r /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1734,9 +2359,9 @@ private PollerFlux, OperationStatusResult /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1759,9 +2384,9 @@ private PollerFlux, OperationStatusResult /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1779,9 +2404,9 @@ public SyncPoller, OperationStatusResultI /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1801,9 +2426,9 @@ public SyncPoller, OperationStatusResultI /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1821,9 +2446,9 @@ private Mono updateVersionAsync(String resourceGroup /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1842,9 +2467,9 @@ private Mono updateVersionAsync(String resourceGroup /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1861,9 +2486,9 @@ public OperationStatusResultInner updateVersion(String resourceGroupName, String /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -1881,14 +2506,13 @@ public OperationStatusResultInner updateVersion(String resourceGroupName, String /** * 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. * @return clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1910,15 +2534,14 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1938,14 +2561,13 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * 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. * @return clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1967,15 +2589,14 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java index 720d8c14690d9..919a95fca561e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java @@ -13,7 +13,9 @@ import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; import com.azure.resourcemanager.networkcloud.models.Clusters; import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; @@ -33,22 +35,22 @@ public ClustersImpl(ClustersClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, @@ -72,12 +74,44 @@ public Cluster getByResourceGroup(String resourceGroupName, String clusterName) } } - public void deleteByResourceGroup(String resourceGroupName, String clusterName) { - this.serviceClient().delete(resourceGroupName, clusterName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String clusterName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, clusterName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String clusterName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, context); + public OperationStatusResult delete(String resourceGroupName, String clusterName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, clusterName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters) { + OperationStatusResultInner inner = this.serviceClient() + .continueUpdateVersion(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .continueUpdateVersion(resourceGroupName, clusterName, clusterContinueUpdateVersionParameters, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public OperationStatusResult deploy(String resourceGroupName, String clusterName) { @@ -100,6 +134,26 @@ public OperationStatusResult deploy(String resourceGroupName, String clusterName } } + public OperationStatusResult scanRuntime(String resourceGroupName, String clusterName) { + OperationStatusResultInner inner = this.serviceClient().scanRuntime(resourceGroupName, clusterName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult scanRuntime(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context) { + OperationStatusResultInner inner + = this.serviceClient().scanRuntime(resourceGroupName, clusterName, clusterScanRuntimeParameters, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + public OperationStatusResult updateVersion(String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { OperationStatusResultInner inner @@ -123,12 +177,12 @@ public OperationStatusResult updateVersion(String resourceGroupName, String clus } public Cluster getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); @@ -137,12 +191,12 @@ public Cluster getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); @@ -150,32 +204,32 @@ public Response getByIdWithResponse(String id, Context context) { return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - this.delete(resourceGroupName, clusterName, Context.NONE); + return this.delete(resourceGroupName, clusterName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - this.delete(resourceGroupName, clusterName, context); + return this.delete(resourceGroupName, clusterName, context); } private ClustersClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java index fc040256507d3..b986f9ddddd4a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java @@ -165,9 +165,9 @@ public Console apply(Context context) { ConsoleImpl(ConsoleInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); - this.consoleName = Utils.getValueFromIdByName(innerObject.id(), "consoles"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualMachineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.consoleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "consoles"); } public Console refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java index 5d377ecb12651..d21acb66d1e10 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.ConsolesClient; import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ConsoleList; import com.azure.resourcemanager.networkcloud.models.ConsolePatchParameters; 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 ConsolesClient. */ +/** + * An instance of this class provides access to all the operations defined in ConsolesClient. + */ public final class ConsolesClientImpl implements ConsolesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ConsolesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of ConsolesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ConsolesClientImpl(NetworkCloudImpl client) { @@ -128,16 +135,16 @@ Mono> listByVirtualMachineNext( /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of consoles for the provided virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVirtualMachineSinglePageAsync(String resourceGroupName, @@ -169,9 +176,9 @@ private Mono> listByVirtualMachineSinglePageAsync(St /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -179,7 +186,7 @@ private Mono> listByVirtualMachineSinglePageAsync(St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of consoles for the provided virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVirtualMachineSinglePageAsync(String resourceGroupName, @@ -211,9 +218,9 @@ private Mono> listByVirtualMachineSinglePageAsync(St /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -229,9 +236,9 @@ private PagedFlux listByVirtualMachineAsync(String resourceGroupNa /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -250,9 +257,9 @@ private PagedFlux listByVirtualMachineAsync(String resourceGroupNa /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -267,9 +274,9 @@ public PagedIterable listByVirtualMachine(String resourceGroupName /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -286,9 +293,9 @@ public PagedIterable listByVirtualMachine(String resourceGroupName /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -296,7 +303,7 @@ public PagedIterable listByVirtualMachine(String resourceGroupName * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided virtual machine console along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String virtualMachineName, @@ -329,9 +336,9 @@ private Mono> getWithResponseAsync(String resourceGroupNa /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -340,7 +347,7 @@ private Mono> getWithResponseAsync(String resourceGroupNa * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided virtual machine console along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String virtualMachineName, @@ -372,9 +379,9 @@ private Mono> getWithResponseAsync(String resourceGroupNa /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -391,9 +398,9 @@ private Mono getAsync(String resourceGroupName, String virtualMach /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -411,9 +418,9 @@ public Response getWithResponse(String resourceGroupName, String v /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -429,9 +436,9 @@ public ConsoleInner get(String resourceGroupName, String virtualMachineName, Str /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -439,8 +446,8 @@ public ConsoleInner get(String resourceGroupName, String virtualMachineName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return console represents the console of an on-premises Network Cloud virtual machine along with {@link - * Response} on successful completion of {@link Mono}. + * @return console represents the console of an on-premises Network Cloud virtual machine along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -480,9 +487,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -491,8 +498,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return console represents the console of an on-premises Network Cloud virtual machine along with {@link - * Response} on successful completion of {@link Mono}. + * @return console represents the console of an on-premises Network Cloud virtual machine along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -531,9 +538,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -542,7 +549,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConsoleInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -555,9 +562,9 @@ private PollerFlux, ConsoleInner> beginCreateOrUpdateAs /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -567,7 +574,7 @@ private PollerFlux, ConsoleInner> beginCreateOrUpdateAs * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConsoleInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -581,9 +588,9 @@ private PollerFlux, ConsoleInner> beginCreateOrUpdateAs /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -592,7 +599,7 @@ private PollerFlux, ConsoleInner> beginCreateOrUpdateAs * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConsoleInner> beginCreateOrUpdate(String resourceGroupName, @@ -603,9 +610,9 @@ public SyncPoller, ConsoleInner> beginCreateOrUpdate(St /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -615,7 +622,7 @@ public SyncPoller, ConsoleInner> beginCreateOrUpdate(St * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConsoleInner> beginCreateOrUpdate(String resourceGroupName, @@ -627,9 +634,9 @@ public SyncPoller, ConsoleInner> beginCreateOrUpdate(St /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -638,7 +645,7 @@ public SyncPoller, ConsoleInner> beginCreateOrUpdate(St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return console represents the console of an on-premises Network Cloud virtual machine on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String virtualMachineName, @@ -649,9 +656,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -661,7 +668,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return console represents the console of an on-premises Network Cloud virtual machine on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String virtualMachineName, @@ -673,9 +680,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -693,9 +700,9 @@ public ConsoleInner createOrUpdate(String resourceGroupName, String virtualMachi /** * Create or update the virtual machine console. - * - *

Create a new virtual machine console or update the properties of the existing virtual machine console. - * + * + * Create a new virtual machine console or update the properties of the existing virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -715,16 +722,17 @@ public ConsoleInner createOrUpdate(String resourceGroupName, String virtualMachi /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -757,9 +765,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -767,7 +775,8 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -799,31 +808,32 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualMachineName, - String consoleName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String virtualMachineName, String consoleName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName, consoleName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -831,42 +841,42 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualMachineName, - String consoleName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - String consoleName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String virtualMachineName, String consoleName) { return this.beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName).getSyncPoller(); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -874,38 +884,39 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - String consoleName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { return this.beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName, context).getSyncPoller(); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName, String consoleName) { + private Mono deleteAsync(String resourceGroupName, String virtualMachineName, + String consoleName) { return beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -913,37 +924,38 @@ private Mono deleteAsync(String resourceGroupName, String virtualMachineNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName, String consoleName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String virtualMachineName, + String consoleName, Context context) { return beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName, String consoleName) { - deleteAsync(resourceGroupName, virtualMachineName, consoleName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, String consoleName) { + return deleteAsync(resourceGroupName, virtualMachineName, consoleName).block(); } /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -951,18 +963,20 @@ public void delete(String resourceGroupName, String virtualMachineName, String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { - deleteAsync(resourceGroupName, virtualMachineName, consoleName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, String consoleName, + Context context) { + return deleteAsync(resourceGroupName, virtualMachineName, consoleName, context).block(); } /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -970,8 +984,8 @@ public void delete(String resourceGroupName, String virtualMachineName, String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return console represents the console of an on-premises Network Cloud virtual machine along with {@link - * Response} on successful completion of {@link Mono}. + * @return console represents the console of an on-premises Network Cloud virtual machine along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1008,10 +1022,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1020,8 +1034,8 @@ private Mono>> updateWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return console represents the console of an on-premises Network Cloud virtual machine along with {@link - * Response} on successful completion of {@link Mono}. + * @return console represents the console of an on-premises Network Cloud virtual machine along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1057,10 +1071,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1069,7 +1083,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConsoleInner> beginUpdateAsync(String resourceGroupName, @@ -1082,10 +1096,10 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1093,7 +1107,7 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConsoleInner> beginUpdateAsync(String resourceGroupName, @@ -1107,10 +1121,10 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1120,7 +1134,7 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConsoleInner> beginUpdateAsync(String resourceGroupName, @@ -1135,10 +1149,10 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1146,7 +1160,7 @@ private PollerFlux, ConsoleInner> beginUpdateAsync(Stri * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConsoleInner> beginUpdate(String resourceGroupName, @@ -1158,10 +1172,10 @@ public SyncPoller, ConsoleInner> beginUpdate(String res /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1171,7 +1185,7 @@ public SyncPoller, ConsoleInner> beginUpdate(String res * @throws 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 console represents the console of an on-premises Network Cloud - * virtual machine. + * virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConsoleInner> beginUpdate(String resourceGroupName, @@ -1184,10 +1198,10 @@ public SyncPoller, ConsoleInner> beginUpdate(String res /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1196,7 +1210,7 @@ public SyncPoller, ConsoleInner> beginUpdate(String res * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return console represents the console of an on-premises Network Cloud virtual machine on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName, String consoleName, @@ -1207,10 +1221,10 @@ private Mono updateAsync(String resourceGroupName, String virtualM /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1218,7 +1232,7 @@ private Mono updateAsync(String resourceGroupName, String virtualM * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return console represents the console of an on-premises Network Cloud virtual machine on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName, String consoleName) { @@ -1229,10 +1243,10 @@ private Mono updateAsync(String resourceGroupName, String virtualM /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1242,7 +1256,7 @@ private Mono updateAsync(String resourceGroupName, String virtualM * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return console represents the console of an on-premises Network Cloud virtual machine on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName, String consoleName, @@ -1254,10 +1268,10 @@ private Mono updateAsync(String resourceGroupName, String virtualM /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1274,10 +1288,10 @@ public ConsoleInner update(String resourceGroupName, String virtualMachineName, /** * Patch the virtual machine console. - * - *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * + * Patch the properties of the provided virtual machine console, or update the tags associated with the virtual * machine console. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -1297,14 +1311,13 @@ public ConsoleInner update(String resourceGroupName, String virtualMachineName, /** * 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. * @return consoleList represents a list of virtual machine consoles along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVirtualMachineNextSinglePageAsync(String nextLink) { @@ -1326,15 +1339,14 @@ private Mono> listByVirtualMachineNextSinglePageAsyn /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return consoleList represents a list of virtual machine consoles along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVirtualMachineNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java index 7eac396a168d5..11f844f578346 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.ConsolesClient; import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.Console; import com.azure.resourcemanager.networkcloud.models.Consoles; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class ConsolesImpl implements Consoles { private static final ClientLogger LOGGER = new ClientLogger(ConsolesImpl.class); @@ -30,14 +32,14 @@ public ConsolesImpl(ConsolesClient innerClient, public PagedIterable listByVirtualMachine(String resourceGroupName, String virtualMachineName) { PagedIterable inner = this.serviceClient().listByVirtualMachine(resourceGroupName, virtualMachineName); - return Utils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); } public PagedIterable listByVirtualMachine(String resourceGroupName, String virtualMachineName, Context context) { PagedIterable inner = this.serviceClient().listByVirtualMachine(resourceGroupName, virtualMachineName, context); - return Utils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String virtualMachineName, String consoleName, @@ -61,26 +63,39 @@ public Console get(String resourceGroupName, String virtualMachineName, String c } } - public void delete(String resourceGroupName, String virtualMachineName, String consoleName) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName); + public OperationStatusResult delete(String resourceGroupName, String virtualMachineName, String consoleName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName, context); + public OperationStatusResult delete(String resourceGroupName, String virtualMachineName, String consoleName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public Console getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - String consoleName = Utils.getValueFromIdByName(id, "consoles"); + String consoleName = ResourceManagerUtils.getValueFromIdByName(id, "consoles"); if (consoleName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); @@ -89,17 +104,17 @@ public Console getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - String consoleName = Utils.getValueFromIdByName(id, "consoles"); + String consoleName = ResourceManagerUtils.getValueFromIdByName(id, "consoles"); if (consoleName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); @@ -107,42 +122,42 @@ public Response getByIdWithResponse(String id, Context context) { return this.getWithResponse(resourceGroupName, virtualMachineName, consoleName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - String consoleName = Utils.getValueFromIdByName(id, "consoles"); + String consoleName = ResourceManagerUtils.getValueFromIdByName(id, "consoles"); if (consoleName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); } - this.delete(resourceGroupName, virtualMachineName, consoleName, Context.NONE); + return this.delete(resourceGroupName, virtualMachineName, consoleName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - String consoleName = Utils.getValueFromIdByName(id, "consoles"); + String consoleName = ResourceManagerUtils.getValueFromIdByName(id, "consoles"); if (consoleName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); } - this.delete(resourceGroupName, virtualMachineName, consoleName, context); + return this.delete(resourceGroupName, virtualMachineName, consoleName, context); } private ConsolesClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeatureImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeatureImpl.java new file mode 100644 index 0000000000000..58b658cf7b547 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeatureImpl.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.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeature; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureAvailabilityLifecycle; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeaturePatchParameters; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureProvisioningState; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureRequired; +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class KubernetesClusterFeatureImpl + implements KubernetesClusterFeature, KubernetesClusterFeature.Definition, KubernetesClusterFeature.Update { + private KubernetesClusterFeatureInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public KubernetesClusterFeatureAvailabilityLifecycle availabilityLifecycle() { + return this.innerModel().availabilityLifecycle(); + } + + public KubernetesClusterFeatureDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public KubernetesClusterFeatureProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public KubernetesClusterFeatureRequired required() { + return this.innerModel().required(); + } + + public String version() { + return this.innerModel().version(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public KubernetesClusterFeatureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String kubernetesClusterName; + + private String featureName; + + private KubernetesClusterFeaturePatchParameters updateKubernetesClusterFeatureUpdateParameters; + + public KubernetesClusterFeatureImpl withExistingKubernetesCluster(String resourceGroupName, + String kubernetesClusterName) { + this.resourceGroupName = resourceGroupName; + this.kubernetesClusterName = kubernetesClusterName; + return this; + } + + public KubernetesClusterFeature create() { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .createOrUpdate(resourceGroupName, kubernetesClusterName, featureName, this.innerModel(), Context.NONE); + return this; + } + + public KubernetesClusterFeature create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .createOrUpdate(resourceGroupName, kubernetesClusterName, featureName, this.innerModel(), context); + return this; + } + + KubernetesClusterFeatureImpl(String name, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new KubernetesClusterFeatureInner(); + this.serviceManager = serviceManager; + this.featureName = name; + } + + public KubernetesClusterFeatureImpl update() { + this.updateKubernetesClusterFeatureUpdateParameters = new KubernetesClusterFeaturePatchParameters(); + return this; + } + + public KubernetesClusterFeature apply() { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .update(resourceGroupName, kubernetesClusterName, featureName, + updateKubernetesClusterFeatureUpdateParameters, Context.NONE); + return this; + } + + public KubernetesClusterFeature apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .update(resourceGroupName, kubernetesClusterName, featureName, + updateKubernetesClusterFeatureUpdateParameters, context); + return this; + } + + KubernetesClusterFeatureImpl(KubernetesClusterFeatureInner innerObject, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "kubernetesClusters"); + this.featureName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "features"); + } + + public KubernetesClusterFeature refresh() { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .getWithResponse(resourceGroupName, kubernetesClusterName, featureName, Context.NONE) + .getValue(); + return this; + } + + public KubernetesClusterFeature refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKubernetesClusterFeatures() + .getWithResponse(resourceGroupName, kubernetesClusterName, featureName, context) + .getValue(); + return this; + } + + public KubernetesClusterFeatureImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KubernetesClusterFeatureImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KubernetesClusterFeatureImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateKubernetesClusterFeatureUpdateParameters.withTags(tags); + return this; + } + } + + public KubernetesClusterFeatureImpl withOptions(List options) { + if (isInCreateMode()) { + this.innerModel().withOptions(options); + return this; + } else { + this.updateKubernetesClusterFeatureUpdateParameters.withOptions(options); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesClientImpl.java new file mode 100644 index 0000000000000..ab818e878eda2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesClientImpl.java @@ -0,0 +1,1389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +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.networkcloud.fluent.KubernetesClusterFeaturesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatureList; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeaturePatchParameters; +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 KubernetesClusterFeaturesClient. + */ +public final class KubernetesClusterFeaturesClientImpl implements KubernetesClusterFeaturesClient { + /** + * The proxy service used to perform REST calls. + */ + private final KubernetesClusterFeaturesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of KubernetesClusterFeaturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KubernetesClusterFeaturesClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(KubernetesClusterFeaturesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudKubernetesClusterFeatures to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudKubernet") + public interface KubernetesClusterFeaturesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByKubernetesCluster(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kubernetesClusterName") String kubernetesClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kubernetesClusterName") String kubernetesClusterName, + @PathParam("featureName") String featureName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kubernetesClusterName") String kubernetesClusterName, + @PathParam("featureName") String featureName, + @BodyParam("application/json") KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kubernetesClusterName") String kubernetesClusterName, + @PathParam("featureName") String featureName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kubernetesClusterName") String kubernetesClusterName, + @PathParam("featureName") String featureName, + @BodyParam("application/json") KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByKubernetesClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByKubernetesClusterSinglePageAsync(String resourceGroupName, String kubernetesClusterName) { + 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByKubernetesCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, 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())); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of features for the provided Kubernetes cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByKubernetesClusterSinglePageAsync( + String resourceGroupName, String kubernetesClusterName, 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByKubernetesCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKubernetesClusterAsync(String resourceGroupName, + String kubernetesClusterName) { + return new PagedFlux<>(() -> listByKubernetesClusterSinglePageAsync(resourceGroupName, kubernetesClusterName), + nextLink -> listByKubernetesClusterNextSinglePageAsync(nextLink)); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of features for the provided Kubernetes cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKubernetesClusterAsync(String resourceGroupName, + String kubernetesClusterName, Context context) { + return new PagedFlux<>( + () -> listByKubernetesClusterSinglePageAsync(resourceGroupName, kubernetesClusterName, context), + nextLink -> listByKubernetesClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName) { + return new PagedIterable<>(listByKubernetesClusterAsync(resourceGroupName, kubernetesClusterName)); + } + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName, Context context) { + return new PagedIterable<>(listByKubernetesClusterAsync(resourceGroupName, kubernetesClusterName, context)); + } + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName) { + 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, featureName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, kubernetesClusterName, featureName, accept, context); + } + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String kubernetesClusterName, + String featureName) { + return getWithResponseAsync(resourceGroupName, kubernetesClusterName, featureName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String kubernetesClusterName, String featureName, Context context) { + return getWithResponseAsync(resourceGroupName, kubernetesClusterName, featureName, context).block(); + } + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesClusterFeatureInner get(String resourceGroupName, String kubernetesClusterName, + String featureName) { + return getWithResponse(resourceGroupName, kubernetesClusterName, featureName, Context.NONE).getValue(); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters) { + 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + if (kubernetesClusterFeatureParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter kubernetesClusterFeatureParameters is required and cannot be null.")); + } else { + kubernetesClusterFeatureParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + if (kubernetesClusterFeatureParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter kubernetesClusterFeatureParameters is required and cannot be null.")); + } else { + kubernetesClusterFeatureParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters, accept, context); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KubernetesClusterFeatureInner> + beginCreateOrUpdateAsync(String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + kubernetesClusterName, featureName, kubernetesClusterFeatureParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), KubernetesClusterFeatureInner.class, KubernetesClusterFeatureInner.class, + this.client.getContext()); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KubernetesClusterFeatureInner> + beginCreateOrUpdateAsync(String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + kubernetesClusterName, featureName, kubernetesClusterFeatureParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), KubernetesClusterFeatureInner.class, KubernetesClusterFeatureInner.class, + context); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KubernetesClusterFeatureInner> beginCreateOrUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters) + .getSyncPoller(); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KubernetesClusterFeatureInner> beginCreateOrUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesClusterFeatureInner createOrUpdate(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeatureInner kubernetesClusterFeatureParameters) { + return createOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters).block(); + } + + /** + * Create or update the Kubernetes cluster feature. + * + * Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesClusterFeatureInner createOrUpdate(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeatureInner kubernetesClusterFeatureParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureParameters, context).block(); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName) { + 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, featureName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, kubernetesClusterName, featureName, accept, context); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, String featureName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName, featureName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, String featureName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName, featureName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName, String featureName) { + return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName, featureName).getSyncPoller(); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName, String featureName, Context context) { + return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName, featureName, context).getSyncPoller(); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, + String featureName) { + return beginDeleteAsync(resourceGroupName, kubernetesClusterName, featureName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, + String featureName, Context context) { + return beginDeleteAsync(resourceGroupName, kubernetesClusterName, featureName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, + String featureName) { + return deleteAsync(resourceGroupName, kubernetesClusterName, featureName).block(); + } + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, String featureName, + Context context) { + return deleteAsync(resourceGroupName, kubernetesClusterName, featureName, context).block(); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters) { + 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + if (kubernetesClusterFeatureUpdateParameters != null) { + kubernetesClusterFeatureUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, 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 (kubernetesClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter kubernetesClusterName is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + if (kubernetesClusterFeatureUpdateParameters != null) { + kubernetesClusterFeatureUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, kubernetesClusterName, featureName, kubernetesClusterFeatureUpdateParameters, accept, + context); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KubernetesClusterFeatureInner> beginUpdateAsync( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, kubernetesClusterName, + featureName, kubernetesClusterFeatureUpdateParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), KubernetesClusterFeatureInner.class, KubernetesClusterFeatureInner.class, + this.client.getContext()); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KubernetesClusterFeatureInner> + beginUpdateAsync(String resourceGroupName, String kubernetesClusterName, String featureName) { + final KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, kubernetesClusterName, + featureName, kubernetesClusterFeatureUpdateParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), KubernetesClusterFeatureInner.class, KubernetesClusterFeatureInner.class, + this.client.getContext()); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KubernetesClusterFeatureInner> beginUpdateAsync( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, kubernetesClusterName, + featureName, kubernetesClusterFeatureUpdateParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), KubernetesClusterFeatureInner.class, KubernetesClusterFeatureInner.class, + context); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KubernetesClusterFeatureInner> + beginUpdate(String resourceGroupName, String kubernetesClusterName, String featureName) { + final KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KubernetesClusterFeatureInner> beginUpdate( + String resourceGroupName, String kubernetesClusterName, String featureName, + KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, Context context) { + return this + .beginUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters) { + return beginUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String kubernetesClusterName, + String featureName) { + final KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesClusterFeatureInner update(String resourceGroupName, String kubernetesClusterName, + String featureName) { + final KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters = null; + return updateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters).block(); + } + + /** + * Patch the Kubernetes cluster feature. + * + * Patch properties of the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @param kubernetesClusterFeatureUpdateParameters The request body. + * @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 kubernetesClusterFeature represents the feature of a Kubernetes cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesClusterFeatureInner update(String resourceGroupName, String kubernetesClusterName, + String featureName, KubernetesClusterFeaturePatchParameters kubernetesClusterFeatureUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, kubernetesClusterName, featureName, + kubernetesClusterFeatureUpdateParameters, 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 kubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByKubernetesClusterNextSinglePageAsync(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.listByKubernetesClusterNext(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 kubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByKubernetesClusterNextSinglePageAsync(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.listByKubernetesClusterNext(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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesImpl.java new file mode 100644 index 0000000000000..0e50e74ebcbc9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterFeaturesImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.KubernetesClusterFeaturesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeature; +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeatures; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; + +public final class KubernetesClusterFeaturesImpl implements KubernetesClusterFeatures { + private static final ClientLogger LOGGER = new ClientLogger(KubernetesClusterFeaturesImpl.class); + + private final KubernetesClusterFeaturesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public KubernetesClusterFeaturesImpl(KubernetesClusterFeaturesClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName) { + PagedIterable inner + = this.serviceClient().listByKubernetesCluster(resourceGroupName, kubernetesClusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterFeatureImpl(inner1, this.manager())); + } + + public PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName, Context context) { + PagedIterable inner + = this.serviceClient().listByKubernetesCluster(resourceGroupName, kubernetesClusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterFeatureImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String kubernetesClusterName, + String featureName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, kubernetesClusterName, featureName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new KubernetesClusterFeatureImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KubernetesClusterFeature get(String resourceGroupName, String kubernetesClusterName, String featureName) { + KubernetesClusterFeatureInner inner + = this.serviceClient().get(resourceGroupName, kubernetesClusterName, featureName); + if (inner != null) { + return new KubernetesClusterFeatureImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String featureName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, kubernetesClusterName, featureName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String featureName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, kubernetesClusterName, featureName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public KubernetesClusterFeature getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); + if (kubernetesClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); + } + String featureName = ResourceManagerUtils.getValueFromIdByName(id, "features"); + if (featureName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'features'.", id))); + } + return this.getWithResponse(resourceGroupName, kubernetesClusterName, featureName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); + if (kubernetesClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); + } + String featureName = ResourceManagerUtils.getValueFromIdByName(id, "features"); + if (featureName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'features'.", id))); + } + return this.getWithResponse(resourceGroupName, kubernetesClusterName, featureName, context); + } + + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); + if (kubernetesClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); + } + String featureName = ResourceManagerUtils.getValueFromIdByName(id, "features"); + if (featureName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'features'.", id))); + } + return this.delete(resourceGroupName, kubernetesClusterName, featureName, Context.NONE); + } + + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); + if (kubernetesClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); + } + String featureName = ResourceManagerUtils.getValueFromIdByName(id, "features"); + if (featureName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'features'.", id))); + } + return this.delete(resourceGroupName, kubernetesClusterName, featureName, context); + } + + private KubernetesClusterFeaturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public KubernetesClusterFeatureImpl define(String name) { + return new KubernetesClusterFeatureImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterImpl.java index 1c1f1998d07cb..41923e25ea9cb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClusterImpl.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterInner; import com.azure.resourcemanager.networkcloud.models.AadConfiguration; import com.azure.resourcemanager.networkcloud.models.AdministratorConfiguration; +import com.azure.resourcemanager.networkcloud.models.AdministratorConfigurationPatch; import com.azure.resourcemanager.networkcloud.models.AvailableUpgrade; import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodeConfiguration; import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; @@ -235,8 +236,8 @@ public KubernetesCluster apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.kubernetesClusterName = Utils.getValueFromIdByName(innerObject.id(), "kubernetesClusters"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "kubernetesClusters"); } public KubernetesCluster refresh() { @@ -335,6 +336,12 @@ public KubernetesClusterImpl withAdministratorConfiguration(AdministratorConfigu return this; } + public KubernetesClusterImpl + withAdministratorConfiguration(AdministratorConfigurationPatch administratorConfiguration) { + this.updateKubernetesClusterUpdateParameters.withAdministratorConfiguration(administratorConfiguration); + return this; + } + public KubernetesClusterImpl withControlPlaneNodeConfiguration(ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration) { this.updateKubernetesClusterUpdateParameters.withControlPlaneNodeConfiguration(controlPlaneNodeConfiguration); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersClientImpl.java index aef4f65826adb..119d4f8979bfb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersClientImpl.java @@ -43,17 +43,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in KubernetesClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in KubernetesClustersClient. + */ public final class KubernetesClustersClientImpl implements KubernetesClustersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final KubernetesClustersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of KubernetesClustersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ KubernetesClustersClientImpl(NetworkCloudImpl client) { @@ -130,7 +136,7 @@ Mono>> update(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restartNode(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -158,13 +164,13 @@ Mono> listByResourceGroupNext( /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Kubernetes clusters in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -187,15 +193,15 @@ private Mono> listSinglePageAsync() { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Kubernetes clusters in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -218,9 +224,9 @@ private Mono> listSinglePageAsync(Context /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link PagedFlux}. @@ -233,9 +239,9 @@ private PagedFlux listAsync() { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,13 +256,13 @@ private PagedFlux listAsync(Context context) { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -265,15 +271,15 @@ public PagedIterable list() { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -282,15 +288,15 @@ public PagedIterable list(Context context) { /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Kubernetes clusters in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -317,16 +323,16 @@ private Mono> listByResourceGroupSinglePag /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Kubernetes clusters in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -354,15 +360,15 @@ private Mono> listByResourceGroupSinglePag /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -372,16 +378,16 @@ private PagedFlux listByResourceGroupAsync(String resour /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -391,15 +397,15 @@ private PagedFlux listByResourceGroupAsync(String resour /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -408,16 +414,16 @@ public PagedIterable listByResourceGroup(String resource /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -426,16 +432,16 @@ public PagedIterable listByResourceGroup(String resource /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 properties of the provided the Kubernetes cluster along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -465,9 +471,9 @@ private Mono> getByResourceGroupWithResponseAsy /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -475,7 +481,7 @@ private Mono> getByResourceGroupWithResponseAsy * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided the Kubernetes cluster along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -504,9 +510,9 @@ private Mono> getByResourceGroupWithResponseAsy /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -523,9 +529,9 @@ private Mono getByResourceGroupAsync(String resourceGrou /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -542,9 +548,9 @@ public Response getByResourceGroupWithResponse(String re /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -559,9 +565,9 @@ public KubernetesClusterInner getByResourceGroup(String resourceGroupName, Strin /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -569,7 +575,7 @@ public KubernetesClusterInner getByResourceGroup(String resourceGroupName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud along with {@link Response} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -606,9 +612,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -617,7 +623,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud along with {@link Response} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -653,9 +659,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -663,7 +669,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, KubernetesClusterInner> beginCreateOrUpdateAsync( @@ -677,9 +683,9 @@ private PollerFlux, KubernetesClusterInner> b /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -688,7 +694,7 @@ private PollerFlux, KubernetesClusterInner> b * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, KubernetesClusterInner> beginCreateOrUpdateAsync( @@ -703,9 +709,9 @@ private PollerFlux, KubernetesClusterInner> b /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -713,7 +719,7 @@ private PollerFlux, KubernetesClusterInner> b * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, KubernetesClusterInner> beginCreateOrUpdate( @@ -724,9 +730,9 @@ public SyncPoller, KubernetesClusterInner> be /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -735,7 +741,7 @@ public SyncPoller, KubernetesClusterInner> be * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, KubernetesClusterInner> beginCreateOrUpdate( @@ -748,9 +754,9 @@ public SyncPoller, KubernetesClusterInner> be /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -758,7 +764,7 @@ public SyncPoller, KubernetesClusterInner> be * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String kubernetesClusterName, @@ -769,9 +775,9 @@ private Mono createOrUpdateAsync(String resourceGroupNam /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -780,7 +786,7 @@ private Mono createOrUpdateAsync(String resourceGroupNam * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String kubernetesClusterName, @@ -792,9 +798,9 @@ private Mono createOrUpdateAsync(String resourceGroupNam /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -811,9 +817,9 @@ public KubernetesClusterInner createOrUpdate(String resourceGroupName, String ku /** * Create or update the Kubernetes cluster. - * - *

Create a new Kubernetes cluster or update the properties of the existing one. - * + * + * Create a new Kubernetes cluster or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterParameters The request body. @@ -832,15 +838,16 @@ public KubernetesClusterInner createOrUpdate(String resourceGroupName, String ku /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -870,16 +877,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -908,159 +916,164 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String kubernetesClusterName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String kubernetesClusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String kubernetesClusterName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, kubernetesClusterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName) { return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName).getSyncPoller(); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String kubernetesClusterName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String kubernetesClusterName, Context context) { return this.beginDeleteAsync(resourceGroupName, kubernetesClusterName, context).getSyncPoller(); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName) { + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName) { return beginDeleteAsync(resourceGroupName, kubernetesClusterName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, Context context) { + private Mono deleteAsync(String resourceGroupName, String kubernetesClusterName, + Context context) { return beginDeleteAsync(resourceGroupName, kubernetesClusterName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String kubernetesClusterName) { - deleteAsync(resourceGroupName, kubernetesClusterName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName) { + return deleteAsync(resourceGroupName, kubernetesClusterName).block(); } /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String kubernetesClusterName, Context context) { - deleteAsync(resourceGroupName, kubernetesClusterName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String kubernetesClusterName, Context context) { + return deleteAsync(resourceGroupName, kubernetesClusterName, context).block(); } /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1068,7 +1081,7 @@ public void delete(String resourceGroupName, String kubernetesClusterName, Conte * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud along with {@link Response} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1102,10 +1115,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1114,7 +1127,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud along with {@link Response} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1147,10 +1160,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1158,7 +1171,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, KubernetesClusterInner> beginUpdateAsync( @@ -1173,17 +1186,17 @@ private PollerFlux, KubernetesClusterInner> b /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, KubernetesClusterInner> @@ -1198,10 +1211,10 @@ private PollerFlux, KubernetesClusterInner> b /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1210,7 +1223,7 @@ private PollerFlux, KubernetesClusterInner> b * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, KubernetesClusterInner> beginUpdateAsync( @@ -1225,17 +1238,17 @@ private PollerFlux, KubernetesClusterInner> b /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, KubernetesClusterInner> beginUpdate(String resourceGroupName, @@ -1247,10 +1260,10 @@ public SyncPoller, KubernetesClusterInner> be /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1259,7 +1272,7 @@ public SyncPoller, KubernetesClusterInner> be * @throws 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 kubernetesCluster represents the Kubernetes cluster hosted on - * Network Cloud. + * Network Cloud. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, KubernetesClusterInner> beginUpdate(String resourceGroupName, @@ -1272,10 +1285,10 @@ public SyncPoller, KubernetesClusterInner> be /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1283,7 +1296,7 @@ public SyncPoller, KubernetesClusterInner> be * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String kubernetesClusterName, @@ -1294,17 +1307,17 @@ private Mono updateAsync(String resourceGroupName, Strin /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String kubernetesClusterName) { @@ -1315,10 +1328,10 @@ private Mono updateAsync(String resourceGroupName, Strin /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1327,7 +1340,7 @@ private Mono updateAsync(String resourceGroupName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesCluster represents the Kubernetes cluster hosted on Network Cloud on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String kubernetesClusterName, @@ -1339,10 +1352,10 @@ private Mono updateAsync(String resourceGroupName, Strin /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1358,10 +1371,10 @@ public KubernetesClusterInner update(String resourceGroupName, String kubernetes /** * Patch the Kubernetes cluster. - * - *

Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes + * + * Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes * cluster. Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterUpdateParameters The request body. @@ -1380,17 +1393,17 @@ public KubernetesClusterInner update(String resourceGroupName, String kubernetes /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartNodeWithResponseAsync(String resourceGroupName, @@ -1427,9 +1440,9 @@ private Mono>> restartNodeWithResponseAsync(String res /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1437,8 +1450,8 @@ private Mono>> restartNodeWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartNodeWithResponseAsync(String resourceGroupName, @@ -1475,9 +1488,9 @@ private Mono>> restartNodeWithResponseAsync(String res /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1499,9 +1512,9 @@ private PollerFlux, OperationStatusResult /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1524,9 +1537,9 @@ private PollerFlux, OperationStatusResult /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1546,9 +1559,9 @@ public SyncPoller, OperationStatusResultI /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1570,9 +1583,9 @@ public SyncPoller, OperationStatusResultI /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1591,9 +1604,9 @@ private Mono restartNodeAsync(String resourceGroupNa /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1612,9 +1625,9 @@ private Mono restartNodeAsync(String resourceGroupNa /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1632,9 +1645,9 @@ public OperationStatusResultInner restartNode(String resourceGroupName, String k /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -1653,14 +1666,13 @@ public OperationStatusResultInner restartNode(String resourceGroupName, String k /** * 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. * @return kubernetesClusterList represents a list of Kubernetes clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1682,15 +1694,14 @@ private Mono> listBySubscriptionNextSingle /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesClusterList represents a list of Kubernetes clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1711,14 +1722,13 @@ private Mono> listBySubscriptionNextSingle /** * 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. * @return kubernetesClusterList represents a list of Kubernetes clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1740,15 +1750,14 @@ private Mono> listByResourceGroupNextSingl /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return kubernetesClusterList represents a list of Kubernetes clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersImpl.java index d4e1bcd67216f..8b3d54ded4e70 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/KubernetesClustersImpl.java @@ -32,23 +32,23 @@ public KubernetesClustersImpl(KubernetesClustersClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KubernetesClusterImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -73,12 +73,23 @@ public KubernetesCluster getByResourceGroup(String resourceGroupName, String kub } } - public void deleteByResourceGroup(String resourceGroupName, String kubernetesClusterName) { - this.serviceClient().delete(resourceGroupName, kubernetesClusterName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String kubernetesClusterName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, kubernetesClusterName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String kubernetesClusterName, Context context) { - this.serviceClient().delete(resourceGroupName, kubernetesClusterName, context); + public OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, kubernetesClusterName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public OperationStatusResult restartNode(String resourceGroupName, String kubernetesClusterName, @@ -104,12 +115,12 @@ public OperationStatusResult restartNode(String resourceGroupName, String kubern } public KubernetesCluster getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); @@ -118,12 +129,12 @@ public KubernetesCluster getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); @@ -131,32 +142,32 @@ public Response getByIdWithResponse(String id, Context contex return this.getByResourceGroupWithResponse(resourceGroupName, kubernetesClusterName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - this.delete(resourceGroupName, kubernetesClusterName, Context.NONE); + return this.delete(resourceGroupName, kubernetesClusterName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String kubernetesClusterName = Utils.getValueFromIdByName(id, "kubernetesClusters"); + String kubernetesClusterName = ResourceManagerUtils.getValueFromIdByName(id, "kubernetesClusters"); if (kubernetesClusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'kubernetesClusters'.", id))); } - this.delete(resourceGroupName, kubernetesClusterName, context); + return this.delete(resourceGroupName, kubernetesClusterName, context); } private KubernetesClustersClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java index b91d06a4dea6e..506f30d6fdbc4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java @@ -187,8 +187,8 @@ public L2Network apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.l2NetworkName = Utils.getValueFromIdByName(innerObject.id(), "l2Networks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l2NetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "l2Networks"); } public L2Network refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java index eb1d860c14b0c..2d6138be56251 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.L2NetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L2NetworkList; import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; 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 L2NetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in L2NetworksClient. + */ public final class L2NetworksClientImpl implements L2NetworksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final L2NetworksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of L2NetworksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ L2NetworksClientImpl(NetworkCloudImpl client) { @@ -140,13 +147,13 @@ Mono> listByResourceGroupNext( /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 2 (L2) networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -169,15 +176,15 @@ private Mono> listSinglePageAsync() { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 2 (L2) networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -200,13 +207,13 @@ private Mono> listSinglePageAsync(Context context) /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -216,15 +223,15 @@ private PagedFlux listAsync() { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -234,13 +241,13 @@ private PagedFlux listAsync(Context context) { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -249,15 +256,15 @@ public PagedIterable list() { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -266,15 +273,15 @@ public PagedIterable list(Context context) { /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 2 (L2) networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -301,16 +308,16 @@ private Mono> listByResourceGroupSinglePageAsync(S /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 2 (L2) networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -338,15 +345,15 @@ private Mono> listByResourceGroupSinglePageAsync(S /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -356,16 +363,16 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -375,15 +382,15 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -392,16 +399,16 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -410,16 +417,16 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided layer 2 (L2) network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -448,9 +455,9 @@ private Mono> getByResourceGroupWithResponseAsync(Strin /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. @@ -458,7 +465,7 @@ private Mono> getByResourceGroupWithResponseAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided layer 2 (L2) network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -486,9 +493,9 @@ private Mono> getByResourceGroupWithResponseAsync(Strin /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -504,9 +511,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. @@ -523,9 +530,9 @@ public Response getByResourceGroupWithResponse(String resourceGr /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -540,9 +547,9 @@ public L2NetworkInner getByResourceGroup(String resourceGroupName, String l2Netw /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -550,7 +557,7 @@ public L2NetworkInner getByResourceGroup(String resourceGroupName, String l2Netw * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -586,9 +593,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -597,7 +604,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -631,9 +638,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -641,7 +648,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, L2NetworkInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -654,9 +661,9 @@ private PollerFlux, L2NetworkInner> beginCreateOrUpda /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -665,7 +672,7 @@ private PollerFlux, L2NetworkInner> beginCreateOrUpda * @throws 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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, L2NetworkInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -679,9 +686,9 @@ private PollerFlux, L2NetworkInner> beginCreateOrUpda /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -689,7 +696,7 @@ private PollerFlux, L2NetworkInner> beginCreateOrUpda * @throws 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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, L2NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -699,9 +706,9 @@ public SyncPoller, L2NetworkInner> beginCreateOrUpdat /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -710,7 +717,7 @@ public SyncPoller, L2NetworkInner> beginCreateOrUpdat * @throws 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 l2Network represents a network that utilizes a single isolation - * domain set up for layer-2 resources. + * domain set up for layer-2 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, L2NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -721,9 +728,9 @@ public SyncPoller, L2NetworkInner> beginCreateOrUpdat /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -731,7 +738,7 @@ public SyncPoller, L2NetworkInner> beginCreateOrUpdat * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String l2NetworkName, @@ -742,9 +749,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -753,7 +760,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String l2NetworkName, @@ -764,9 +771,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -783,9 +790,9 @@ public L2NetworkInner createOrUpdate(String resourceGroupName, String l2NetworkN /** * Create or update the layer 2 (L2) network. - * - *

Create a new layer 2 (L2) network or update the properties of the existing network. - * + * + * Create a new layer 2 (L2) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkParameters The request body. @@ -803,15 +810,16 @@ public L2NetworkInner createOrUpdate(String resourceGroupName, String l2NetworkN /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String l2NetworkName) { @@ -839,16 +847,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String l2NetworkName, @@ -876,155 +885,161 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String l2NetworkName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String l2NetworkName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, l2NetworkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String l2NetworkName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String l2NetworkName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, l2NetworkName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String l2NetworkName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String l2NetworkName) { return this.beginDeleteAsync(resourceGroupName, l2NetworkName).getSyncPoller(); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String l2NetworkName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String l2NetworkName, Context context) { return this.beginDeleteAsync(resourceGroupName, l2NetworkName, context).getSyncPoller(); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String l2NetworkName) { + private Mono deleteAsync(String resourceGroupName, String l2NetworkName) { return beginDeleteAsync(resourceGroupName, l2NetworkName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String l2NetworkName, Context context) { + private Mono deleteAsync(String resourceGroupName, String l2NetworkName, + Context context) { return beginDeleteAsync(resourceGroupName, l2NetworkName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String l2NetworkName) { - deleteAsync(resourceGroupName, l2NetworkName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String l2NetworkName) { + return deleteAsync(resourceGroupName, l2NetworkName).block(); } /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String l2NetworkName, Context context) { - deleteAsync(resourceGroupName, l2NetworkName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String l2NetworkName, Context context) { + return deleteAsync(resourceGroupName, l2NetworkName, context).block(); } /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkUpdateParameters The request body. @@ -1032,7 +1047,7 @@ public void delete(String resourceGroupName, String l2NetworkName, Context conte * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String l2NetworkName, @@ -1065,9 +1080,9 @@ private Mono> updateWithResponseAsync(String resourceGr /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkUpdateParameters The request body. @@ -1076,7 +1091,7 @@ private Mono> updateWithResponseAsync(String resourceGr * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String l2NetworkName, @@ -1107,16 +1122,16 @@ private Mono> updateWithResponseAsync(String resourceGr /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String l2NetworkName) { @@ -1127,9 +1142,9 @@ private Mono updateAsync(String resourceGroupName, String l2Netw /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param l2NetworkUpdateParameters The request body. @@ -1138,7 +1153,7 @@ private Mono updateAsync(String resourceGroupName, String l2Netw * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String l2NetworkName, @@ -1148,9 +1163,9 @@ public Response updateWithResponse(String resourceGroupName, Str /** * Patch the layer 2 (L2) network. - * - *

Update tags associated with the provided layer 2 (L2) network. - * + * + * Update tags associated with the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1166,14 +1181,13 @@ public L2NetworkInner update(String resourceGroupName, String l2NetworkName) { /** * 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. * @return l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1195,15 +1209,14 @@ private Mono> listBySubscriptionNextSinglePageAsyn /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1224,14 +1237,13 @@ private Mono> listBySubscriptionNextSinglePageAsyn /** * 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. * @return l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1253,15 +1265,14 @@ private Mono> listByResourceGroupNextSinglePageAsy /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java index 645e8a7e44eb8..80779e9664585 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.L2NetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L2Network; import com.azure.resourcemanager.networkcloud.models.L2Networks; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class L2NetworksImpl implements L2Networks { private static final ClientLogger LOGGER = new ClientLogger(L2NetworksImpl.class); @@ -29,22 +31,22 @@ public L2NetworksImpl(L2NetworksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String l2NetworkName, @@ -68,21 +70,31 @@ public L2Network getByResourceGroup(String resourceGroupName, String l2NetworkNa } } - public void deleteByResourceGroup(String resourceGroupName, String l2NetworkName) { - this.serviceClient().delete(resourceGroupName, l2NetworkName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String l2NetworkName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, l2NetworkName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String l2NetworkName, Context context) { - this.serviceClient().delete(resourceGroupName, l2NetworkName, context); + public OperationStatusResult delete(String resourceGroupName, String l2NetworkName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, l2NetworkName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public L2Network getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + String l2NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l2Networks"); if (l2NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); @@ -91,12 +103,12 @@ public L2Network getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + String l2NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l2Networks"); if (l2NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); @@ -104,32 +116,32 @@ public Response getByIdWithResponse(String id, Context context) { return this.getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + String l2NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l2Networks"); if (l2NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); } - this.delete(resourceGroupName, l2NetworkName, Context.NONE); + return this.delete(resourceGroupName, l2NetworkName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + String l2NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l2Networks"); if (l2NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); } - this.delete(resourceGroupName, l2NetworkName, context); + return this.delete(resourceGroupName, l2NetworkName, context); } private L2NetworksClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java index d7ed7f1aaee8f..fc51b01946496 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java @@ -209,8 +209,8 @@ public L3Network apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.l3NetworkName = Utils.getValueFromIdByName(innerObject.id(), "l3Networks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l3NetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "l3Networks"); } public L3Network refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java index ca0c3b525babc..eca2dbaa27ad6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.L3NetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L3NetworkList; import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; 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 L3NetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in L3NetworksClient. + */ public final class L3NetworksClientImpl implements L3NetworksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final L3NetworksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of L3NetworksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ L3NetworksClientImpl(NetworkCloudImpl client) { @@ -140,13 +147,13 @@ Mono> listByResourceGroupNext( /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 3 (L3) networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -169,15 +176,15 @@ private Mono> listSinglePageAsync() { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 3 (L3) networks in the provided subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -200,13 +207,13 @@ private Mono> listSinglePageAsync(Context context) /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -216,15 +223,15 @@ private PagedFlux listAsync() { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedFlux}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -234,13 +241,13 @@ private PagedFlux listAsync(Context context) { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -249,15 +256,15 @@ public PagedIterable list() { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -266,15 +273,15 @@ public PagedIterable list(Context context) { /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 3 (L3) networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -301,16 +308,16 @@ private Mono> listByResourceGroupSinglePageAsync(S /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of layer 3 (L3) networks in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -338,15 +345,15 @@ private Mono> listByResourceGroupSinglePageAsync(S /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -356,16 +363,16 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedFlux}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -375,15 +382,15 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -392,16 +399,16 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -410,16 +417,16 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided layer 3 (L3) network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -448,9 +455,9 @@ private Mono> getByResourceGroupWithResponseAsync(Strin /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. @@ -458,7 +465,7 @@ private Mono> getByResourceGroupWithResponseAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided layer 3 (L3) network along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -486,9 +493,9 @@ private Mono> getByResourceGroupWithResponseAsync(Strin /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -504,9 +511,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. @@ -523,9 +530,9 @@ public Response getByResourceGroupWithResponse(String resourceGr /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -540,9 +547,9 @@ public L3NetworkInner getByResourceGroup(String resourceGroupName, String l3Netw /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -550,7 +557,7 @@ public L3NetworkInner getByResourceGroup(String resourceGroupName, String l3Netw * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -586,9 +593,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -597,7 +604,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -631,9 +638,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -641,7 +648,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, L3NetworkInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -654,9 +661,9 @@ private PollerFlux, L3NetworkInner> beginCreateOrUpda /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -665,7 +672,7 @@ private PollerFlux, L3NetworkInner> beginCreateOrUpda * @throws 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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, L3NetworkInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -679,9 +686,9 @@ private PollerFlux, L3NetworkInner> beginCreateOrUpda /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -689,7 +696,7 @@ private PollerFlux, L3NetworkInner> beginCreateOrUpda * @throws 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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, L3NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -699,9 +706,9 @@ public SyncPoller, L3NetworkInner> beginCreateOrUpdat /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -710,7 +717,7 @@ public SyncPoller, L3NetworkInner> beginCreateOrUpdat * @throws 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 l3Network represents a network that utilizes a single isolation - * domain set up for layer-3 resources. + * domain set up for layer-3 resources. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, L3NetworkInner> beginCreateOrUpdate(String resourceGroupName, @@ -721,9 +728,9 @@ public SyncPoller, L3NetworkInner> beginCreateOrUpdat /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -731,7 +738,7 @@ public SyncPoller, L3NetworkInner> beginCreateOrUpdat * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String l3NetworkName, @@ -742,9 +749,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -753,7 +760,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String l3NetworkName, @@ -764,9 +771,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -783,9 +790,9 @@ public L3NetworkInner createOrUpdate(String resourceGroupName, String l3NetworkN /** * Create or update the layer 3 (L3) network. - * - *

Create a new layer 3 (L3) network or update the properties of the existing network. - * + * + * Create a new layer 3 (L3) network or update the properties of the existing network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkParameters The request body. @@ -803,15 +810,16 @@ public L3NetworkInner createOrUpdate(String resourceGroupName, String l3NetworkN /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String l3NetworkName) { @@ -839,16 +847,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String l3NetworkName, @@ -876,155 +885,161 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String l3NetworkName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String l3NetworkName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, l3NetworkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String l3NetworkName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String l3NetworkName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, l3NetworkName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String l3NetworkName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String l3NetworkName) { return this.beginDeleteAsync(resourceGroupName, l3NetworkName).getSyncPoller(); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String l3NetworkName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String l3NetworkName, Context context) { return this.beginDeleteAsync(resourceGroupName, l3NetworkName, context).getSyncPoller(); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String l3NetworkName) { + private Mono deleteAsync(String resourceGroupName, String l3NetworkName) { return beginDeleteAsync(resourceGroupName, l3NetworkName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String l3NetworkName, Context context) { + private Mono deleteAsync(String resourceGroupName, String l3NetworkName, + Context context) { return beginDeleteAsync(resourceGroupName, l3NetworkName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String l3NetworkName) { - deleteAsync(resourceGroupName, l3NetworkName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String l3NetworkName) { + return deleteAsync(resourceGroupName, l3NetworkName).block(); } /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String l3NetworkName, Context context) { - deleteAsync(resourceGroupName, l3NetworkName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String l3NetworkName, Context context) { + return deleteAsync(resourceGroupName, l3NetworkName, context).block(); } /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkUpdateParameters The request body. @@ -1032,7 +1047,7 @@ public void delete(String resourceGroupName, String l3NetworkName, Context conte * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String l3NetworkName, @@ -1065,9 +1080,9 @@ private Mono> updateWithResponseAsync(String resourceGr /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkUpdateParameters The request body. @@ -1076,7 +1091,7 @@ private Mono> updateWithResponseAsync(String resourceGr * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String l3NetworkName, @@ -1107,16 +1122,16 @@ private Mono> updateWithResponseAsync(String resourceGr /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String l3NetworkName) { @@ -1127,9 +1142,9 @@ private Mono updateAsync(String resourceGroupName, String l3Netw /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param l3NetworkUpdateParameters The request body. @@ -1138,7 +1153,7 @@ private Mono updateAsync(String resourceGroupName, String l3Netw * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String l3NetworkName, @@ -1148,9 +1163,9 @@ public Response updateWithResponse(String resourceGroupName, Str /** * Patch the layer 3 (L3) network. - * - *

Update tags associated with the provided layer 3 (L3) network. - * + * + * Update tags associated with the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1166,14 +1181,13 @@ public L3NetworkInner update(String resourceGroupName, String l3NetworkName) { /** * 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. * @return l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1195,15 +1209,14 @@ private Mono> listBySubscriptionNextSinglePageAsyn /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1224,14 +1237,13 @@ private Mono> listBySubscriptionNextSinglePageAsyn /** * 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. * @return l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1253,15 +1265,14 @@ private Mono> listByResourceGroupNextSinglePageAsy /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java index 02f347a2d7ccd..fba96d7d4de08 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.L3NetworksClient; import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.L3Network; import com.azure.resourcemanager.networkcloud.models.L3Networks; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class L3NetworksImpl implements L3Networks { private static final ClientLogger LOGGER = new ClientLogger(L3NetworksImpl.class); @@ -29,22 +31,22 @@ public L3NetworksImpl(L3NetworksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String l3NetworkName, @@ -68,21 +70,31 @@ public L3Network getByResourceGroup(String resourceGroupName, String l3NetworkNa } } - public void deleteByResourceGroup(String resourceGroupName, String l3NetworkName) { - this.serviceClient().delete(resourceGroupName, l3NetworkName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String l3NetworkName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, l3NetworkName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String l3NetworkName, Context context) { - this.serviceClient().delete(resourceGroupName, l3NetworkName, context); + public OperationStatusResult delete(String resourceGroupName, String l3NetworkName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, l3NetworkName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public L3Network getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + String l3NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l3Networks"); if (l3NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); @@ -91,12 +103,12 @@ public L3Network getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + String l3NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l3Networks"); if (l3NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); @@ -104,32 +116,32 @@ public Response getByIdWithResponse(String id, Context context) { return this.getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + String l3NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l3Networks"); if (l3NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); } - this.delete(resourceGroupName, l3NetworkName, Context.NONE); + return this.delete(resourceGroupName, l3NetworkName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + String l3NetworkName = ResourceManagerUtils.getValueFromIdByName(id, "l3Networks"); if (l3NetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); } - this.delete(resourceGroupName, l3NetworkName, context); + return this.delete(resourceGroupName, l3NetworkName, context); } private L3NetworksClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java index 7e2484f9e1f1a..f63353000cd3e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java @@ -34,23 +34,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.MetricsConfigurationsClient; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationList; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; 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 MetricsConfigurationsClient. */ +/** + * An instance of this class provides access to all the operations defined in MetricsConfigurationsClient. + */ public final class MetricsConfigurationsClientImpl implements MetricsConfigurationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MetricsConfigurationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of MetricsConfigurationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MetricsConfigurationsClientImpl(NetworkCloudImpl client) { @@ -128,16 +135,16 @@ Mono> listByClusterNext( /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of metrics configurations for the provided cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -168,9 +175,9 @@ private Mono> listByClusterSingl /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -178,7 +185,7 @@ private Mono> listByClusterSingl * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of metrics configurations for the provided cluster along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, @@ -209,9 +216,9 @@ private Mono> listByClusterSingl /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -228,9 +235,9 @@ private PagedFlux listByClusterAsync(String re /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -248,16 +255,16 @@ private PagedFlux listByClusterAsync(String re /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { @@ -266,17 +273,17 @@ public PagedIterable listByCluster(String reso /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, @@ -286,9 +293,9 @@ public PagedIterable listByCluster(String reso /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -296,7 +303,7 @@ public PagedIterable listByCluster(String reso * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metrics configuration of the provided cluster along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -328,9 +335,9 @@ private Mono> getWithResponseAsync(St /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -339,7 +346,7 @@ private Mono> getWithResponseAsync(St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return metrics configuration of the provided cluster along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -371,9 +378,9 @@ private Mono> getWithResponseAsync(St /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -391,9 +398,9 @@ private Mono getAsync(String resourceGroupName /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -411,9 +418,9 @@ public Response getWithResponse(String resourc /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -430,9 +437,9 @@ public ClusterMetricsConfigurationInner get(String resourceGroupName, String clu /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -441,7 +448,7 @@ public ClusterMetricsConfigurationInner get(String resourceGroupName, String clu * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -482,9 +489,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -494,7 +501,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -534,9 +541,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -545,7 +552,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterMetricsConfigurationInner> @@ -560,9 +567,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -572,7 +579,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterMetricsConfigurationInner> @@ -588,9 +595,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -599,7 +606,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterMetricsConfigurationInner> @@ -613,9 +620,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -625,7 +632,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterMetricsConfigurationInner> @@ -639,9 +646,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -650,7 +657,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, @@ -661,9 +668,9 @@ private Mono createOrUpdateAsync(String resour /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -673,7 +680,7 @@ private Mono createOrUpdateAsync(String resour * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, @@ -685,9 +692,9 @@ private Mono createOrUpdateAsync(String resour /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -706,9 +713,9 @@ public ClusterMetricsConfigurationInner createOrUpdate(String resourceGroupName, /** * Create or update metrics configuration of the cluster. - * - *

Create new or update the existing metrics configuration of the provided cluster. - * + * + * Create new or update the existing metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -729,16 +736,17 @@ public ClusterMetricsConfigurationInner createOrUpdate(String resourceGroupName, /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -770,9 +778,9 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -780,7 +788,8 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, @@ -812,31 +821,32 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String metricsConfigurationName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String clusterName, String metricsConfigurationName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -844,42 +854,42 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String metricsConfigurationName, Context context) { + private PollerFlux, OperationStatusResultInner> beginDeleteAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String metricsConfigurationName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String metricsConfigurationName) { return this.beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName).getSyncPoller(); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -887,38 +897,39 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String metricsConfigurationName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { return this.beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).getSyncPoller(); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String metricsConfigurationName) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String metricsConfigurationName) { return beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -926,37 +937,39 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String metricsConfigurationName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String clusterName, + String metricsConfigurationName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName) { - deleteAsync(resourceGroupName, clusterName, metricsConfigurationName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, + String metricsConfigurationName) { + return deleteAsync(resourceGroupName, clusterName, metricsConfigurationName).block(); } /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -964,18 +977,20 @@ public void delete(String resourceGroupName, String clusterName, String metricsC * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { - deleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String clusterName, + String metricsConfigurationName, Context context) { + return deleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).block(); } /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -984,7 +999,7 @@ public void delete(String resourceGroupName, String clusterName, String metricsC * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1022,10 +1037,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1035,7 +1050,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, @@ -1072,10 +1087,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1084,7 +1099,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterMetricsConfigurationInner> beginUpdateAsync( @@ -1099,10 +1114,10 @@ private PollerFlux, ClusterMetricsC /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1110,7 +1125,7 @@ private PollerFlux, ClusterMetricsC * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterMetricsConfigurationInner> @@ -1125,10 +1140,10 @@ private PollerFlux, ClusterMetricsC /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1138,7 +1153,7 @@ private PollerFlux, ClusterMetricsC * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterMetricsConfigurationInner> beginUpdateAsync( @@ -1154,10 +1169,10 @@ private PollerFlux, ClusterMetricsC /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1165,7 +1180,7 @@ private PollerFlux, ClusterMetricsC * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterMetricsConfigurationInner> @@ -1179,10 +1194,10 @@ private PollerFlux, ClusterMetricsC /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1192,7 +1207,7 @@ private PollerFlux, ClusterMetricsC * @throws 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 clusterMetricsConfiguration represents the metrics configuration of - * an on-premises Network Cloud cluster. + * an on-premises Network Cloud cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( @@ -1206,10 +1221,10 @@ public SyncPoller, ClusterMetricsCo /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1218,7 +1233,7 @@ public SyncPoller, ClusterMetricsCo * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1230,10 +1245,10 @@ private Mono updateAsync(String resourceGroupN /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1241,7 +1256,7 @@ private Mono updateAsync(String resourceGroupN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1253,10 +1268,10 @@ private Mono updateAsync(String resourceGroupN /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1266,7 +1281,7 @@ private Mono updateAsync(String resourceGroupN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -1278,10 +1293,10 @@ private Mono updateAsync(String resourceGroupN /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1300,10 +1315,10 @@ public ClusterMetricsConfigurationInner update(String resourceGroupName, String /** * Patch metrics configuration of the cluster. - * - *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * + * Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -1324,14 +1339,13 @@ public ClusterMetricsConfigurationInner update(String resourceGroupName, String /** * 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. * @return clusterMetricsConfigurationList represents a list of metrics configuration of the cluster along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink) { @@ -1352,15 +1366,14 @@ private Mono> listByClusterNextS /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return clusterMetricsConfigurationList represents a list of metrics configuration of the cluster along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java index 36612039e27bf..899776eb25ed2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java @@ -11,8 +11,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.MetricsConfigurationsClient; import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; import com.azure.resourcemanager.networkcloud.models.MetricsConfigurations; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; public final class MetricsConfigurationsImpl implements MetricsConfigurations { private static final ClientLogger LOGGER = new ClientLogger(MetricsConfigurationsImpl.class); @@ -30,14 +32,16 @@ public MetricsConfigurationsImpl(MetricsConfigurationsClient innerClient, public PagedIterable listByCluster(String resourceGroupName, String clusterName) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); - return Utils.mapPage(inner, inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); } public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String clusterName, @@ -63,26 +67,39 @@ public ClusterMetricsConfiguration get(String resourceGroupName, String clusterN } } - public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName) { - this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName); + public OperationStatusResult delete(String resourceGroupName, String clusterName, String metricsConfigurationName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName, context); + public OperationStatusResult delete(String resourceGroupName, String clusterName, String metricsConfigurationName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public ClusterMetricsConfiguration getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + String metricsConfigurationName = ResourceManagerUtils.getValueFromIdByName(id, "metricsConfigurations"); if (metricsConfigurationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", id))); @@ -91,17 +108,17 @@ public ClusterMetricsConfiguration getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + String metricsConfigurationName = ResourceManagerUtils.getValueFromIdByName(id, "metricsConfigurations"); if (metricsConfigurationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", id))); @@ -109,42 +126,42 @@ public Response getByIdWithResponse(String id, Cont return this.getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + String metricsConfigurationName = ResourceManagerUtils.getValueFromIdByName(id, "metricsConfigurations"); if (metricsConfigurationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", id))); } - this.delete(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE); + return this.delete(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + String metricsConfigurationName = ResourceManagerUtils.getValueFromIdByName(id, "metricsConfigurations"); if (metricsConfigurationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", id))); } - this.delete(resourceGroupName, clusterName, metricsConfigurationName, context); + return this.delete(resourceGroupName, clusterName, metricsConfigurationName, context); } private MetricsConfigurationsClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java index b7b0597569bee..f63b25a03e448 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java @@ -14,7 +14,9 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the NetworkCloudImpl type. */ +/** + * A builder for creating a new instance of the NetworkCloudImpl type. + */ @ServiceClientBuilder(serviceClients = { NetworkCloudImpl.class }) public final class NetworkCloudBuilder { /* @@ -24,7 +26,7 @@ public final class NetworkCloudBuilder { /** * Sets The ID of the target subscription. The value must be an UUID. - * + * * @param subscriptionId the subscriptionId value. * @return the NetworkCloudBuilder. */ @@ -40,7 +42,7 @@ public NetworkCloudBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the NetworkCloudBuilder. */ @@ -56,7 +58,7 @@ public NetworkCloudBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the NetworkCloudBuilder. */ @@ -72,7 +74,7 @@ public NetworkCloudBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the NetworkCloudBuilder. */ @@ -88,7 +90,7 @@ public NetworkCloudBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the NetworkCloudBuilder. */ @@ -104,7 +106,7 @@ public NetworkCloudBuilder defaultPollInterval(Duration defaultPollInterval) { /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the NetworkCloudBuilder. */ @@ -115,7 +117,7 @@ public NetworkCloudBuilder serializerAdapter(SerializerAdapter serializerAdapter /** * Builds an instance of NetworkCloudImpl with the provided parameters. - * + * * @return an instance of NetworkCloudImpl. */ public NetworkCloudImpl buildClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java index d3773b89ed982..d94649122bc17 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.networkcloud.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; @@ -30,6 +31,7 @@ import com.azure.resourcemanager.networkcloud.fluent.ClusterManagersClient; import com.azure.resourcemanager.networkcloud.fluent.ClustersClient; import com.azure.resourcemanager.networkcloud.fluent.ConsolesClient; +import com.azure.resourcemanager.networkcloud.fluent.KubernetesClusterFeaturesClient; import com.azure.resourcemanager.networkcloud.fluent.KubernetesClustersClient; import com.azure.resourcemanager.networkcloud.fluent.L2NetworksClient; import com.azure.resourcemanager.networkcloud.fluent.L3NetworksClient; @@ -51,303 +53,369 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the NetworkCloudImpl type. */ +/** + * Initializes a new instance of the NetworkCloudImpl type. + */ @ServiceClient(builder = NetworkCloudBuilder.class) public final class NetworkCloudImpl implements NetworkCloud { - /** The ID of the target subscription. The value must be an UUID. */ + /** + * The ID of the target subscription. The value must be an UUID. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. The value must be an UUID. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The BareMetalMachinesClient object to access its operations. */ + /** + * The BareMetalMachinesClient object to access its operations. + */ private final BareMetalMachinesClient bareMetalMachines; /** * Gets the BareMetalMachinesClient object to access its operations. - * + * * @return the BareMetalMachinesClient object. */ public BareMetalMachinesClient getBareMetalMachines() { return this.bareMetalMachines; } - /** The CloudServicesNetworksClient object to access its operations. */ + /** + * The CloudServicesNetworksClient object to access its operations. + */ private final CloudServicesNetworksClient cloudServicesNetworks; /** * Gets the CloudServicesNetworksClient object to access its operations. - * + * * @return the CloudServicesNetworksClient object. */ public CloudServicesNetworksClient getCloudServicesNetworks() { return this.cloudServicesNetworks; } - /** The ClusterManagersClient object to access its operations. */ + /** + * The ClusterManagersClient object to access its operations. + */ private final ClusterManagersClient clusterManagers; /** * Gets the ClusterManagersClient object to access its operations. - * + * * @return the ClusterManagersClient object. */ public ClusterManagersClient getClusterManagers() { return this.clusterManagers; } - /** The ClustersClient object to access its operations. */ + /** + * The ClustersClient object to access its operations. + */ private final ClustersClient clusters; /** * Gets the ClustersClient object to access its operations. - * + * * @return the ClustersClient object. */ public ClustersClient getClusters() { return this.clusters; } - /** The KubernetesClustersClient object to access its operations. */ + /** + * The KubernetesClustersClient object to access its operations. + */ private final KubernetesClustersClient kubernetesClusters; /** * Gets the KubernetesClustersClient object to access its operations. - * + * * @return the KubernetesClustersClient object. */ public KubernetesClustersClient getKubernetesClusters() { return this.kubernetesClusters; } - /** The L2NetworksClient object to access its operations. */ + /** + * The L2NetworksClient object to access its operations. + */ private final L2NetworksClient l2Networks; /** * Gets the L2NetworksClient object to access its operations. - * + * * @return the L2NetworksClient object. */ public L2NetworksClient getL2Networks() { return this.l2Networks; } - /** The L3NetworksClient object to access its operations. */ + /** + * The L3NetworksClient object to access its operations. + */ private final L3NetworksClient l3Networks; /** * Gets the L3NetworksClient object to access its operations. - * + * * @return the L3NetworksClient object. */ public L3NetworksClient getL3Networks() { return this.l3Networks; } - /** The RackSkusClient object to access its operations. */ + /** + * The RackSkusClient object to access its operations. + */ private final RackSkusClient rackSkus; /** * Gets the RackSkusClient object to access its operations. - * + * * @return the RackSkusClient object. */ public RackSkusClient getRackSkus() { return this.rackSkus; } - /** The RacksClient object to access its operations. */ + /** + * The RacksClient object to access its operations. + */ private final RacksClient racks; /** * Gets the RacksClient object to access its operations. - * + * * @return the RacksClient object. */ public RacksClient getRacks() { return this.racks; } - /** The StorageAppliancesClient object to access its operations. */ + /** + * The StorageAppliancesClient object to access its operations. + */ private final StorageAppliancesClient storageAppliances; /** * Gets the StorageAppliancesClient object to access its operations. - * + * * @return the StorageAppliancesClient object. */ public StorageAppliancesClient getStorageAppliances() { return this.storageAppliances; } - /** The TrunkedNetworksClient object to access its operations. */ + /** + * The TrunkedNetworksClient object to access its operations. + */ private final TrunkedNetworksClient trunkedNetworks; /** * Gets the TrunkedNetworksClient object to access its operations. - * + * * @return the TrunkedNetworksClient object. */ public TrunkedNetworksClient getTrunkedNetworks() { return this.trunkedNetworks; } - /** The VirtualMachinesClient object to access its operations. */ + /** + * The VirtualMachinesClient object to access its operations. + */ private final VirtualMachinesClient virtualMachines; /** * Gets the VirtualMachinesClient object to access its operations. - * + * * @return the VirtualMachinesClient object. */ public VirtualMachinesClient getVirtualMachines() { return this.virtualMachines; } - /** The VolumesClient object to access its operations. */ + /** + * The VolumesClient object to access its operations. + */ private final VolumesClient volumes; /** * Gets the VolumesClient object to access its operations. - * + * * @return the VolumesClient object. */ public VolumesClient getVolumes() { return this.volumes; } - /** The BareMetalMachineKeySetsClient object to access its operations. */ + /** + * The BareMetalMachineKeySetsClient object to access its operations. + */ private final BareMetalMachineKeySetsClient bareMetalMachineKeySets; /** * Gets the BareMetalMachineKeySetsClient object to access its operations. - * + * * @return the BareMetalMachineKeySetsClient object. */ public BareMetalMachineKeySetsClient getBareMetalMachineKeySets() { return this.bareMetalMachineKeySets; } - /** The BmcKeySetsClient object to access its operations. */ + /** + * The BmcKeySetsClient object to access its operations. + */ private final BmcKeySetsClient bmcKeySets; /** * Gets the BmcKeySetsClient object to access its operations. - * + * * @return the BmcKeySetsClient object. */ public BmcKeySetsClient getBmcKeySets() { return this.bmcKeySets; } - /** The MetricsConfigurationsClient object to access its operations. */ + /** + * The MetricsConfigurationsClient object to access its operations. + */ private final MetricsConfigurationsClient metricsConfigurations; /** * Gets the MetricsConfigurationsClient object to access its operations. - * + * * @return the MetricsConfigurationsClient object. */ public MetricsConfigurationsClient getMetricsConfigurations() { return this.metricsConfigurations; } - /** The AgentPoolsClient object to access its operations. */ + /** + * The AgentPoolsClient object to access its operations. + */ private final AgentPoolsClient agentPools; /** * Gets the AgentPoolsClient object to access its operations. - * + * * @return the AgentPoolsClient object. */ public AgentPoolsClient getAgentPools() { return this.agentPools; } - /** The ConsolesClient object to access its operations. */ + /** + * The KubernetesClusterFeaturesClient object to access its operations. + */ + private final KubernetesClusterFeaturesClient kubernetesClusterFeatures; + + /** + * Gets the KubernetesClusterFeaturesClient object to access its operations. + * + * @return the KubernetesClusterFeaturesClient object. + */ + public KubernetesClusterFeaturesClient getKubernetesClusterFeatures() { + return this.kubernetesClusterFeatures; + } + + /** + * The ConsolesClient object to access its operations. + */ private final ConsolesClient consoles; /** * Gets the ConsolesClient object to access its operations. - * + * * @return the ConsolesClient object. */ public ConsolesClient getConsoles() { @@ -356,7 +424,7 @@ public ConsolesClient getConsoles() { /** * Initializes an instance of NetworkCloud client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -371,7 +439,7 @@ public ConsolesClient getConsoles() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-07-01"; + this.apiVersion = "2024-10-01-preview"; this.operations = new OperationsClientImpl(this); this.bareMetalMachines = new BareMetalMachinesClientImpl(this); this.cloudServicesNetworks = new CloudServicesNetworksClientImpl(this); @@ -390,12 +458,13 @@ public ConsolesClient getConsoles() { this.bmcKeySets = new BmcKeySetsClientImpl(this); this.metricsConfigurations = new MetricsConfigurationsClientImpl(this); this.agentPools = new AgentPoolsClientImpl(this); + this.kubernetesClusterFeatures = new KubernetesClusterFeaturesClientImpl(this); this.consoles = new ConsolesClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -404,7 +473,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -414,7 +483,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -432,7 +501,7 @@ public PollerFlux, U> getLroResult(Mono type of poll result. * @param type of final result. @@ -495,7 +564,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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationStatusResultImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationStatusResultImpl.java index fd4b8c79b9c8d..d04aee7078896 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationStatusResultImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationStatusResultImpl.java @@ -23,47 +23,63 @@ public final class OperationStatusResultImpl implements OperationStatusResult { this.serviceManager = serviceManager; } - public String id() { - return this.innerModel().id(); + public OffsetDateTime endTime() { + return this.innerModel().endTime(); } - public String resourceId() { - return this.innerModel().resourceId(); + public ManagementError error() { + return this.innerModel().error(); + } + + public String id() { + return this.innerModel().id(); } public String name() { return this.innerModel().name(); } - public String status() { - return this.innerModel().status(); + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } } public Float percentComplete() { return this.innerModel().percentComplete(); } + public String resourceId() { + return this.innerModel().resourceId(); + } + public OffsetDateTime startTime() { return this.innerModel().startTime(); } - public OffsetDateTime endTime() { - return this.innerModel().endTime(); + public String status() { + return this.innerModel().status(); } - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } + public String exitCode() { + return this.innerModel().exitCode(); } - public ManagementError error() { - return this.innerModel().error(); + public String outputHead() { + return this.innerModel().outputHead(); + } + + public String resultRef() { + return this.innerModel().resultRef(); + } + + public String resultUrl() { + return this.innerModel().resultUrl(); } public OperationStatusResultInner innerModel() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java index c07d81436ec42..e72e4bd1cf2c3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java @@ -30,17 +30,23 @@ import com.azure.resourcemanager.networkcloud.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(NetworkCloudImpl client) { @@ -73,14 +79,13 @@ Mono> listNext(@PathParam(value = "nextLink", enco /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -99,16 +104,15 @@ private Mono> listSinglePageAsync() { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -125,10 +129,9 @@ private Mono> listSinglePageAsync(Context context) /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations as paginated response with {@link PagedFlux}. @@ -140,10 +143,9 @@ private PagedFlux listAsync() { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @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. @@ -158,10 +160,9 @@ private PagedFlux listAsync(Context context) { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations as paginated response with {@link PagedIterable}. @@ -173,10 +174,9 @@ public PagedIterable list() { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @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. @@ -190,14 +190,13 @@ 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. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -217,15 +216,14 @@ 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java index 7a038524f3371..6f7ea399bdd20 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java @@ -27,12 +27,12 @@ public OperationsImpl(OperationsClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java index 561155983c02d..f12e05c649d7a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java @@ -159,8 +159,8 @@ public Rack apply(Context context) { RackImpl(RackInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.rackName = Utils.getValueFromIdByName(innerObject.id(), "racks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.rackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "racks"); } public Rack refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java index 96904e2f6ef38..bfccd4712f904 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java @@ -30,17 +30,23 @@ import com.azure.resourcemanager.networkcloud.models.RackSkuList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RackSkusClient. */ +/** + * An instance of this class provides access to all the operations defined in RackSkusClient. + */ public final class RackSkusClientImpl implements RackSkusClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final RackSkusService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of RackSkusClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ RackSkusClientImpl(NetworkCloudImpl client) { @@ -82,13 +88,13 @@ Mono> listBySubscriptionNext( /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -111,15 +117,15 @@ private Mono> listSinglePageAsync() { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -142,9 +148,9 @@ private Mono> listSinglePageAsync(Context context) { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription as paginated response with {@link PagedFlux}. @@ -157,9 +163,9 @@ private PagedFlux listAsync() { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -174,9 +180,9 @@ private PagedFlux listAsync(Context context) { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. @@ -188,9 +194,9 @@ public PagedIterable list() { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -204,15 +210,15 @@ public PagedIterable list(Context context) { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 properties of the provided rack SKU along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the provided rack SKU along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String rackSkuName) { @@ -236,16 +242,16 @@ private Mono> getWithResponseAsync(String rackSkuName) { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @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 properties of the provided rack SKU along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the provided rack SKU along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String rackSkuName, Context context) { @@ -268,9 +274,9 @@ private Mono> getWithResponseAsync(String rackSkuName, Co /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -284,9 +290,9 @@ private Mono getAsync(String rackSkuName) { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -301,9 +307,9 @@ public Response getWithResponse(String rackSkuName, Context contex /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -317,14 +323,13 @@ public RackSkuInner get(String rackSkuName) { /** * 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. * @return rackSkuList represents a list of rack SKUs along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -346,15 +351,14 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rackSkuList represents a list of rack SKUs along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java index 5beea52d91baf..41228cae5bb08 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java @@ -29,12 +29,12 @@ public RackSkusImpl(RackSkusClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); } public Response getWithResponse(String rackSkuName, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java index ec8cbfb8d44a7..6c32fce0a23ac 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java @@ -33,6 +33,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.RacksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; import com.azure.resourcemanager.networkcloud.models.RackList; import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; @@ -40,17 +41,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RacksClient. */ +/** + * An instance of this class provides access to all the operations defined in RacksClient. + */ public final class RacksClientImpl implements RacksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final RacksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of RacksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ RacksClientImpl(NetworkCloudImpl client) { @@ -136,13 +143,13 @@ Mono> listByResourceGroupNext(@PathParam(value = "nextLink", /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -165,15 +172,15 @@ private Mono> listSinglePageAsync() { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -196,9 +203,9 @@ private Mono> listSinglePageAsync(Context context) { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription as paginated response with {@link PagedFlux}. @@ -211,9 +218,9 @@ private PagedFlux listAsync() { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -228,9 +235,9 @@ private PagedFlux listAsync(Context context) { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription as paginated response with {@link PagedIterable}. @@ -242,9 +249,9 @@ public PagedIterable list() { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -258,15 +265,15 @@ public PagedIterable list(Context context) { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided resource group along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -293,16 +300,16 @@ private Mono> listByResourceGroupSinglePageAsync(String /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided resource group along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -330,9 +337,9 @@ private Mono> listByResourceGroupSinglePageAsync(String /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -347,9 +354,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName) /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -365,9 +372,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName, /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -381,9 +388,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -398,9 +405,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Co /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -434,9 +441,9 @@ private Mono> getByResourceGroupWithResponseAsync(String res /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. @@ -471,9 +478,9 @@ private Mono> getByResourceGroupWithResponseAsync(String res /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -489,9 +496,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. @@ -508,9 +515,9 @@ public Response getByResourceGroupWithResponse(String resourceGroupNa /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -525,10 +532,10 @@ public RackInner getByResourceGroup(String resourceGroupName, String rackName) { /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -536,7 +543,7 @@ public RackInner getByResourceGroup(String resourceGroupName, String rackName) { * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String rackName, @@ -570,10 +577,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -582,7 +589,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String rackName, @@ -615,10 +622,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -626,7 +633,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RackInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -639,10 +646,10 @@ private PollerFlux, RackInner> beginCreateOrUpdateAsync(St /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -651,7 +658,7 @@ private PollerFlux, RackInner> beginCreateOrUpdateAsync(St * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RackInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -665,10 +672,10 @@ private PollerFlux, RackInner> beginCreateOrUpdateAsync(St /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -676,7 +683,7 @@ private PollerFlux, RackInner> beginCreateOrUpdateAsync(St * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RackInner> beginCreateOrUpdate(String resourceGroupName, String rackName, @@ -686,10 +693,10 @@ public SyncPoller, RackInner> beginCreateOrUpdate(String r /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -698,7 +705,7 @@ public SyncPoller, RackInner> beginCreateOrUpdate(String r * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RackInner> beginCreateOrUpdate(String resourceGroupName, String rackName, @@ -708,10 +715,10 @@ public SyncPoller, RackInner> beginCreateOrUpdate(String r /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -719,7 +726,7 @@ public SyncPoller, RackInner> beginCreateOrUpdate(String r * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String rackName, RackInner rackParameters) { @@ -729,10 +736,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, String rac /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -741,7 +748,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String rac * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String rackName, RackInner rackParameters, @@ -752,10 +759,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, String rac /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -771,10 +778,10 @@ public RackInner createOrUpdate(String resourceGroupName, String rackName, RackI /** * Create or update the rack. - * - *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected - * as the life cycle of this resource is managed by the system. - * + * + * Create a new rack or update properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackParameters The request body. @@ -792,16 +799,17 @@ public RackInner createOrUpdate(String resourceGroupName, String rackName, RackI /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String rackName) { @@ -829,17 +837,18 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String rackName, @@ -867,163 +876,169 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String rackName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String rackName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, rackName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String rackName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String rackName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, rackName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String rackName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String rackName) { return this.beginDeleteAsync(resourceGroupName, rackName).getSyncPoller(); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String rackName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String rackName, Context context) { return this.beginDeleteAsync(resourceGroupName, rackName, context).getSyncPoller(); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String rackName) { + private Mono deleteAsync(String resourceGroupName, String rackName) { return beginDeleteAsync(resourceGroupName, rackName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String rackName, Context context) { + private Mono deleteAsync(String resourceGroupName, String rackName, Context context) { return beginDeleteAsync(resourceGroupName, rackName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String rackName) { - deleteAsync(resourceGroupName, rackName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String rackName) { + return deleteAsync(resourceGroupName, rackName).block(); } /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String rackName, Context context) { - deleteAsync(resourceGroupName, rackName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String rackName, Context context) { + return deleteAsync(resourceGroupName, rackName, context).block(); } /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1031,7 +1046,7 @@ public void delete(String resourceGroupName, String rackName, Context context) { * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String rackName, @@ -1063,10 +1078,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1075,7 +1090,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String rackName, @@ -1106,10 +1121,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1117,7 +1132,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RackInner> beginUpdateAsync(String resourceGroupName, String rackName, @@ -1130,17 +1145,17 @@ private PollerFlux, RackInner> beginUpdateAsync(String res /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RackInner> beginUpdateAsync(String resourceGroupName, String rackName) { @@ -1153,10 +1168,10 @@ private PollerFlux, RackInner> beginUpdateAsync(String res /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1165,7 +1180,7 @@ private PollerFlux, RackInner> beginUpdateAsync(String res * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RackInner> beginUpdateAsync(String resourceGroupName, String rackName, @@ -1179,17 +1194,17 @@ private PollerFlux, RackInner> beginUpdateAsync(String res /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName) { @@ -1199,10 +1214,10 @@ public SyncPoller, RackInner> beginUpdate(String resourceG /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1211,7 +1226,7 @@ public SyncPoller, RackInner> beginUpdate(String resourceG * @throws 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 rack represents the hardware of the rack and is dependent upon the - * cluster for lifecycle. + * cluster for lifecycle. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName, @@ -1221,10 +1236,10 @@ public SyncPoller, RackInner> beginUpdate(String resourceG /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1232,7 +1247,7 @@ public SyncPoller, RackInner> beginUpdate(String resourceG * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String rackName, @@ -1243,17 +1258,17 @@ private Mono updateAsync(String resourceGroupName, String rackName, /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String rackName) { @@ -1264,10 +1279,10 @@ private Mono updateAsync(String resourceGroupName, String rackName) { /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1276,7 +1291,7 @@ private Mono updateAsync(String resourceGroupName, String rackName) { * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String rackName, @@ -1287,10 +1302,10 @@ private Mono updateAsync(String resourceGroupName, String rackName, /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1306,10 +1321,10 @@ public RackInner update(String resourceGroupName, String rackName) { /** * Patch the rack. - * - *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * + * Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates * can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param rackUpdateParameters The request body. @@ -1327,14 +1342,13 @@ public RackInner update(String resourceGroupName, String rackName, RackPatchPara /** * 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. - * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1356,15 +1370,14 @@ private Mono> listBySubscriptionNextSinglePageAsync(Str /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1384,14 +1397,13 @@ private Mono> listBySubscriptionNextSinglePageAsync(Str /** * 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. - * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1413,15 +1425,14 @@ private Mono> listByResourceGroupNextSinglePageAsync(St /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return rackList represents a list of racks along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java index 0bbcd87710b94..555d5f503b6e3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.RacksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; import com.azure.resourcemanager.networkcloud.models.Rack; import com.azure.resourcemanager.networkcloud.models.Racks; @@ -29,22 +31,22 @@ public RacksImpl(RacksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String rackName, Context context) { @@ -67,21 +69,31 @@ public Rack getByResourceGroup(String resourceGroupName, String rackName) { } } - public void deleteByResourceGroup(String resourceGroupName, String rackName) { - this.serviceClient().delete(resourceGroupName, rackName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String rackName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, rackName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String rackName, Context context) { - this.serviceClient().delete(resourceGroupName, rackName, context); + public OperationStatusResult delete(String resourceGroupName, String rackName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, rackName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public Rack getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String rackName = Utils.getValueFromIdByName(id, "racks"); + String rackName = ResourceManagerUtils.getValueFromIdByName(id, "racks"); if (rackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); @@ -90,12 +102,12 @@ public Rack getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String rackName = Utils.getValueFromIdByName(id, "racks"); + String rackName = ResourceManagerUtils.getValueFromIdByName(id, "racks"); if (rackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); @@ -103,32 +115,32 @@ public Response getByIdWithResponse(String id, Context context) { return this.getByResourceGroupWithResponse(resourceGroupName, rackName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String rackName = Utils.getValueFromIdByName(id, "racks"); + String rackName = ResourceManagerUtils.getValueFromIdByName(id, "racks"); if (rackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); } - this.delete(resourceGroupName, rackName, Context.NONE); + return this.delete(resourceGroupName, rackName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String rackName = Utils.getValueFromIdByName(id, "racks"); + String rackName = ResourceManagerUtils.getValueFromIdByName(id, "racks"); if (rackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); } - this.delete(resourceGroupName, rackName, context); + return this.delete(resourceGroupName, rackName, context); } private RacksClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ResourceManagerUtils.java similarity index 88% rename from sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java rename to sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ResourceManagerUtils.java index 834cea43b1f8f..de59d4b50b4e4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -124,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(continuationToken), - pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(preferredPageSize), - pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -189,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java index 15c6a06386b87..a01056db1e70c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java @@ -13,12 +13,14 @@ import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.SecretRotationStatus; import com.azure.resourcemanager.networkcloud.models.StorageAppliance; import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; import java.util.Collections; +import java.util.List; import java.util.Map; public final class StorageApplianceImpl @@ -88,6 +90,14 @@ public String managementIpv4Address() { return this.innerModel().managementIpv4Address(); } + public String manufacturer() { + return this.innerModel().manufacturer(); + } + + public String model() { + return this.innerModel().model(); + } + public StorageApplianceProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -108,6 +118,15 @@ public RemoteVendorManagementStatus remoteVendorManagementStatus() { return this.innerModel().remoteVendorManagementStatus(); } + public List secretRotationStatus() { + List inner = this.innerModel().secretRotationStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String serialNumber() { return this.innerModel().serialNumber(); } @@ -116,6 +135,10 @@ public String storageApplianceSkuId() { return this.innerModel().storageApplianceSkuId(); } + public String version() { + return this.innerModel().version(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -190,8 +213,8 @@ public StorageAppliance apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.storageApplianceName = Utils.getValueFromIdByName(innerObject.id(), "storageAppliances"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageApplianceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAppliances"); } public StorageAppliance refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java index 9941210d7392b..74d2661e1fcb1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java @@ -43,17 +43,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in StorageAppliancesClient. */ +/** + * An instance of this class provides access to all the operations defined in StorageAppliancesClient. + */ public final class StorageAppliancesClientImpl implements StorageAppliancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final StorageAppliancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of StorageAppliancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ StorageAppliancesClientImpl(NetworkCloudImpl client) { @@ -130,7 +136,7 @@ Mono>> update(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> disableRemoteVendorManagement(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -140,7 +146,7 @@ Mono>> disableRemoteVendorManagement(@HostParam("$host @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> enableRemoteVendorManagement(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -168,13 +174,13 @@ Mono> listByResourceGroupNext( /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of storage appliances in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -197,15 +203,15 @@ private Mono> listSinglePageAsync() { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of storage appliances in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -228,9 +234,9 @@ private Mono> listSinglePageAsync(Context c /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of storage appliances in the provided subscription as paginated response with {@link PagedFlux}. @@ -243,9 +249,9 @@ private PagedFlux listAsync() { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -260,13 +266,13 @@ private PagedFlux listAsync(Context context) { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -275,15 +281,15 @@ public PagedIterable list() { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -292,15 +298,15 @@ public PagedIterable list(Context context) { /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of storage appliances in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -327,16 +333,16 @@ private Mono> listByResourceGroupSinglePage /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of storage appliances in the provided resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -364,9 +370,9 @@ private Mono> listByResourceGroupSinglePage /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -381,9 +387,9 @@ private PagedFlux listByResourceGroupAsync(String resourc /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -399,15 +405,15 @@ private PagedFlux listByResourceGroupAsync(String resourc /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -416,16 +422,16 @@ public PagedIterable listByResourceGroup(String resourceG /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -434,16 +440,16 @@ public PagedIterable listByResourceGroup(String resourceG /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided storage appliance along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -473,9 +479,9 @@ private Mono> getByResourceGroupWithResponseAsyn /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -483,7 +489,7 @@ private Mono> getByResourceGroupWithResponseAsyn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of the provided storage appliance along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -512,9 +518,9 @@ private Mono> getByResourceGroupWithResponseAsyn /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -530,9 +536,9 @@ private Mono getByResourceGroupAsync(String resourceGroup /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -549,9 +555,9 @@ public Response getByResourceGroupWithResponse(String res /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,10 +572,10 @@ public StorageApplianceInner getByResourceGroup(String resourceGroupName, String /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -577,7 +583,7 @@ public StorageApplianceInner getByResourceGroup(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -614,10 +620,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -626,7 +632,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -662,10 +668,10 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -673,7 +679,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageApplianceInner> beginCreateOrUpdateAsync( @@ -687,10 +693,10 @@ private PollerFlux, StorageApplianceInner> beg /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -699,7 +705,7 @@ private PollerFlux, StorageApplianceInner> beg * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageApplianceInner> beginCreateOrUpdateAsync( @@ -714,10 +720,10 @@ private PollerFlux, StorageApplianceInner> beg /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -725,7 +731,7 @@ private PollerFlux, StorageApplianceInner> beg * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageApplianceInner> beginCreateOrUpdate( @@ -736,10 +742,10 @@ public SyncPoller, StorageApplianceInner> begi /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -748,7 +754,7 @@ public SyncPoller, StorageApplianceInner> begi * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageApplianceInner> beginCreateOrUpdate( @@ -761,10 +767,10 @@ public SyncPoller, StorageApplianceInner> begi /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -772,7 +778,7 @@ public SyncPoller, StorageApplianceInner> begi * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String storageApplianceName, @@ -783,10 +789,10 @@ private Mono createOrUpdateAsync(String resourceGroupName /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -795,7 +801,7 @@ private Mono createOrUpdateAsync(String resourceGroupName * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String storageApplianceName, @@ -807,10 +813,10 @@ private Mono createOrUpdateAsync(String resourceGroupName /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -827,10 +833,10 @@ public StorageApplianceInner createOrUpdate(String resourceGroupName, String sto /** * Create or update the storage appliance. - * - *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests - * will be rejected as the life cycle of this resource is managed by the system. - * + * + * Create a new storage appliance or update the properties of the existing one. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceParameters The request body. @@ -849,16 +855,17 @@ public StorageApplianceInner createOrUpdate(String resourceGroupName, String sto /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -888,17 +895,18 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -927,166 +935,172 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageApplianceName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String storageApplianceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageApplianceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageApplianceName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String storageApplianceName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageApplianceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String storageApplianceName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String storageApplianceName) { return this.beginDeleteAsync(resourceGroupName, storageApplianceName).getSyncPoller(); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String storageApplianceName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String storageApplianceName, Context context) { return this.beginDeleteAsync(resourceGroupName, storageApplianceName, context).getSyncPoller(); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String storageApplianceName) { + private Mono deleteAsync(String resourceGroupName, String storageApplianceName) { return beginDeleteAsync(resourceGroupName, storageApplianceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String storageApplianceName, Context context) { + private Mono deleteAsync(String resourceGroupName, String storageApplianceName, + Context context) { return beginDeleteAsync(resourceGroupName, storageApplianceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String storageApplianceName) { - deleteAsync(resourceGroupName, storageApplianceName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String storageApplianceName) { + return deleteAsync(resourceGroupName, storageApplianceName).block(); } /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String storageApplianceName, Context context) { - deleteAsync(resourceGroupName, storageApplianceName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String storageApplianceName, Context context) { + return deleteAsync(resourceGroupName, storageApplianceName, context).block(); } /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1094,7 +1108,7 @@ public void delete(String resourceGroupName, String storageApplianceName, Contex * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1128,10 +1142,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1140,7 +1154,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1173,10 +1187,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1184,7 +1198,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageApplianceInner> beginUpdateAsync( @@ -1199,17 +1213,17 @@ private PollerFlux, StorageApplianceInner> beg /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageApplianceInner> @@ -1224,10 +1238,10 @@ private PollerFlux, StorageApplianceInner> beg /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1236,7 +1250,7 @@ private PollerFlux, StorageApplianceInner> beg * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageApplianceInner> beginUpdateAsync( @@ -1251,17 +1265,17 @@ private PollerFlux, StorageApplianceInner> beg /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageApplianceInner> beginUpdate(String resourceGroupName, @@ -1273,10 +1287,10 @@ public SyncPoller, StorageApplianceInner> begi /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1285,7 +1299,7 @@ public SyncPoller, StorageApplianceInner> begi * @throws 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 storageAppliance represents on-premises Network Cloud storage - * appliance. + * appliance. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageApplianceInner> beginUpdate(String resourceGroupName, @@ -1297,10 +1311,10 @@ public SyncPoller, StorageApplianceInner> begi /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1308,7 +1322,7 @@ public SyncPoller, StorageApplianceInner> begi * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String storageApplianceName, @@ -1319,17 +1333,17 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String storageApplianceName) { @@ -1340,10 +1354,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1352,7 +1366,7 @@ private Mono updateAsync(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageAppliance represents on-premises Network Cloud storage appliance on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String storageApplianceName, @@ -1364,10 +1378,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1383,10 +1397,10 @@ public StorageApplianceInner update(String resourceGroupName, String storageAppl /** * Patch the storage appliance. - * - *

Update properties of the provided storage appliance, or update tags associated with the storage appliance + * + * Update properties of the provided storage appliance, or update tags associated with the storage appliance * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceUpdateParameters The request body. @@ -1404,16 +1418,16 @@ public StorageApplianceInner update(String resourceGroupName, String storageAppl /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> disableRemoteVendorManagementWithResponseAsync(String resourceGroupName, @@ -1444,17 +1458,17 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> disableRemoteVendorManagementWithResponseAsync(String resourceGroupName, @@ -1483,9 +1497,9 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1505,9 +1519,9 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -1529,9 +1543,9 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1547,9 +1561,9 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -1567,9 +1581,9 @@ private Mono>> disableRemoteVendorManagementWithRespon /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1586,9 +1600,9 @@ private Mono disableRemoteVendorManagementAsync(Stri /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -1606,9 +1620,9 @@ private Mono disableRemoteVendorManagementAsync(Stri /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1624,9 +1638,9 @@ public OperationStatusResultInner disableRemoteVendorManagement(String resourceG /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -1643,17 +1657,17 @@ public OperationStatusResultInner disableRemoteVendorManagement(String resourceG /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> enableRemoteVendorManagementWithResponseAsync(String resourceGroupName, @@ -1688,9 +1702,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1698,8 +1712,8 @@ private Mono>> enableRemoteVendorManagementWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> enableRemoteVendorManagementWithResponseAsync(String resourceGroupName, @@ -1734,9 +1748,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1758,9 +1772,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1782,9 +1796,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1808,9 +1822,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1831,9 +1845,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1856,9 +1870,9 @@ private Mono>> enableRemoteVendorManagementWithRespons /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1878,9 +1892,9 @@ private Mono enableRemoteVendorManagementAsync(Strin /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1900,9 +1914,9 @@ private Mono enableRemoteVendorManagementAsync(Strin /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1924,9 +1938,9 @@ private Mono enableRemoteVendorManagementAsync(Strin /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1945,9 +1959,9 @@ public OperationStatusResultInner enableRemoteVendorManagement(String resourceGr /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -1968,14 +1982,13 @@ public OperationStatusResultInner enableRemoteVendorManagement(String resourceGr /** * 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. * @return storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1997,15 +2010,14 @@ private Mono> listBySubscriptionNextSingleP /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -2026,14 +2038,13 @@ private Mono> listBySubscriptionNextSingleP /** * 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. * @return storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2055,15 +2066,14 @@ private Mono> listByResourceGroupNextSingle /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java index db22a32ce78b6..f4f184c58eb08 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java @@ -32,23 +32,23 @@ public StorageAppliancesImpl(StorageAppliancesClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -72,12 +72,23 @@ public StorageAppliance getByResourceGroup(String resourceGroupName, String stor } } - public void deleteByResourceGroup(String resourceGroupName, String storageApplianceName) { - this.serviceClient().delete(resourceGroupName, storageApplianceName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String storageApplianceName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, storageApplianceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String storageApplianceName, Context context) { - this.serviceClient().delete(resourceGroupName, storageApplianceName, context); + public OperationStatusResult delete(String resourceGroupName, String storageApplianceName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, storageApplianceName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public OperationStatusResult disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName) { @@ -125,12 +136,12 @@ public OperationStatusResult enableRemoteVendorManagement(String resourceGroupNa } public StorageAppliance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + String storageApplianceName = ResourceManagerUtils.getValueFromIdByName(id, "storageAppliances"); if (storageApplianceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); @@ -139,12 +150,12 @@ public StorageAppliance getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + String storageApplianceName = ResourceManagerUtils.getValueFromIdByName(id, "storageAppliances"); if (storageApplianceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); @@ -152,32 +163,32 @@ public Response getByIdWithResponse(String id, Context context return this.getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + String storageApplianceName = ResourceManagerUtils.getValueFromIdByName(id, "storageAppliances"); if (storageApplianceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); } - this.delete(resourceGroupName, storageApplianceName, Context.NONE); + return this.delete(resourceGroupName, storageApplianceName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + String storageApplianceName = ResourceManagerUtils.getValueFromIdByName(id, "storageAppliances"); if (storageApplianceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); } - this.delete(resourceGroupName, storageApplianceName, context); + return this.delete(resourceGroupName, storageApplianceName, context); } private StorageAppliancesClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java index 3b93fd5ab1209..41b93661c4f30 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java @@ -202,8 +202,8 @@ public TrunkedNetwork apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.trunkedNetworkName = Utils.getValueFromIdByName(innerObject.id(), "trunkedNetworks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.trunkedNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "trunkedNetworks"); } public TrunkedNetwork refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java index 8ae7b613f7198..8b1015a89420a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java @@ -33,6 +33,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.TrunkedNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkList; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; @@ -40,17 +41,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in TrunkedNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in TrunkedNetworksClient. + */ public final class TrunkedNetworksClientImpl implements TrunkedNetworksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final TrunkedNetworksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of TrunkedNetworksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TrunkedNetworksClientImpl(NetworkCloudImpl client) { @@ -144,13 +151,13 @@ Mono> listByResourceGroupNext( /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -173,15 +180,15 @@ private Mono> listSinglePageAsync() { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -204,9 +211,9 @@ private Mono> listSinglePageAsync(Context con /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription as paginated response with {@link PagedFlux}. @@ -219,9 +226,9 @@ private PagedFlux listAsync() { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -236,9 +243,9 @@ private PagedFlux listAsync(Context context) { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. @@ -250,9 +257,9 @@ public PagedIterable list() { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -266,15 +273,15 @@ public PagedIterable list(Context context) { /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -301,16 +308,16 @@ private Mono> listByResourceGroupSinglePageAs /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -338,9 +345,9 @@ private Mono> listByResourceGroupSinglePageAs /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -355,9 +362,9 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,15 +380,15 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -390,16 +397,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -408,16 +415,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the provided trunked network along with {@link Response} on successful completion of {@link - * Mono}. + * @return properties of the provided trunked network along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -447,17 +454,17 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the provided trunked network along with {@link Response} on successful completion of {@link - * Mono}. + * @return properties of the provided trunked network along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -486,9 +493,9 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -504,9 +511,9 @@ private Mono getByResourceGroupAsync(String resourceGroupNa /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. @@ -523,9 +530,9 @@ public Response getByResourceGroupWithResponse(String resou /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -540,9 +547,9 @@ public TrunkedNetworkInner getByResourceGroup(String resourceGroupName, String t /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -550,7 +557,7 @@ public TrunkedNetworkInner getByResourceGroup(String resourceGroupName, String t * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -587,9 +594,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -598,7 +605,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -634,9 +641,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -644,7 +651,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TrunkedNetworkInner> beginCreateOrUpdateAsync( @@ -657,9 +664,9 @@ private PollerFlux, TrunkedNetworkInner> beginCr /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -668,7 +675,7 @@ private PollerFlux, TrunkedNetworkInner> beginCr * @throws 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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TrunkedNetworkInner> beginCreateOrUpdateAsync( @@ -683,9 +690,9 @@ private PollerFlux, TrunkedNetworkInner> beginCr /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -693,7 +700,7 @@ private PollerFlux, TrunkedNetworkInner> beginCr * @throws 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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( @@ -704,9 +711,9 @@ public SyncPoller, TrunkedNetworkInner> beginCre /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -715,7 +722,7 @@ public SyncPoller, TrunkedNetworkInner> beginCre * @throws 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 trunkedNetwork represents a network that utilizes multiple - * isolation domains and specified VLANs to create a trunked network. + * isolation domains and specified VLANs to create a trunked network. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( @@ -727,9 +734,9 @@ public SyncPoller, TrunkedNetworkInner> beginCre /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -737,7 +744,7 @@ public SyncPoller, TrunkedNetworkInner> beginCre * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network on successful completion of {@link Mono}. + * create a trunked network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String trunkedNetworkName, @@ -748,9 +755,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -759,7 +766,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network on successful completion of {@link Mono}. + * create a trunked network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String trunkedNetworkName, @@ -770,9 +777,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -780,7 +787,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) public TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetworkName, @@ -790,9 +797,9 @@ public TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunk /** * Create or update the trunked network. - * - *

Create a new trunked network or update the properties of the existing trunked network. - * + * + * Create a new trunked network or update the properties of the existing trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkParameters The request body. @@ -801,7 +808,7 @@ public TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunk * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) public TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunkedNetworkName, @@ -811,15 +818,16 @@ public TrunkedNetworkInner createOrUpdate(String resourceGroupName, String trunk /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -849,16 +857,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -887,156 +896,162 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String trunkedNetworkName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String trunkedNetworkName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, trunkedNetworkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String trunkedNetworkName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String trunkedNetworkName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, trunkedNetworkName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String trunkedNetworkName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String trunkedNetworkName) { return this.beginDeleteAsync(resourceGroupName, trunkedNetworkName).getSyncPoller(); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String trunkedNetworkName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String trunkedNetworkName, Context context) { return this.beginDeleteAsync(resourceGroupName, trunkedNetworkName, context).getSyncPoller(); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String trunkedNetworkName) { + private Mono deleteAsync(String resourceGroupName, String trunkedNetworkName) { return beginDeleteAsync(resourceGroupName, trunkedNetworkName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String trunkedNetworkName, Context context) { + private Mono deleteAsync(String resourceGroupName, String trunkedNetworkName, + Context context) { return beginDeleteAsync(resourceGroupName, trunkedNetworkName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String trunkedNetworkName) { - deleteAsync(resourceGroupName, trunkedNetworkName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String trunkedNetworkName) { + return deleteAsync(resourceGroupName, trunkedNetworkName).block(); } /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String trunkedNetworkName, Context context) { - deleteAsync(resourceGroupName, trunkedNetworkName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String trunkedNetworkName, Context context) { + return deleteAsync(resourceGroupName, trunkedNetworkName, context).block(); } /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkUpdateParameters The request body. @@ -1044,7 +1059,7 @@ public void delete(String resourceGroupName, String trunkedNetworkName, Context * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, @@ -1078,9 +1093,9 @@ private Mono> updateWithResponseAsync(String resou /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkUpdateParameters The request body. @@ -1089,7 +1104,7 @@ private Mono> updateWithResponseAsync(String resou * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, @@ -1121,16 +1136,16 @@ private Mono> updateWithResponseAsync(String resou /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network on successful completion of {@link Mono}. + * create a trunked network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String trunkedNetworkName) { @@ -1141,9 +1156,9 @@ private Mono updateAsync(String resourceGroupName, String t /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param trunkedNetworkUpdateParameters The request body. @@ -1152,7 +1167,7 @@ private Mono updateAsync(String resourceGroupName, String t * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network along with {@link Response}. + * create a trunked network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String trunkedNetworkName, @@ -1163,16 +1178,16 @@ public Response updateWithResponse(String resourceGroupName /** * Patch the trunked network. - * - *

Update tags associated with the provided trunked network. - * + * + * Update tags associated with the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to - * create a trunked network. + * create a trunked network. */ @ServiceMethod(returns = ReturnType.SINGLE) public TrunkedNetworkInner update(String resourceGroupName, String trunkedNetworkName) { @@ -1183,14 +1198,13 @@ public TrunkedNetworkInner update(String resourceGroupName, String trunkedNetwor /** * 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. * @return trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1212,15 +1226,14 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -1241,14 +1254,13 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @return trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1270,15 +1282,14 @@ private Mono> listByResourceGroupNextSinglePa /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java index a6b9021efc3c9..f602a54317769 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.TrunkedNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; import com.azure.resourcemanager.networkcloud.models.TrunkedNetworks; @@ -29,22 +31,22 @@ public TrunkedNetworksImpl(TrunkedNetworksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String trunkedNetworkName, @@ -68,21 +70,31 @@ public TrunkedNetwork getByResourceGroup(String resourceGroupName, String trunke } } - public void deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName) { - this.serviceClient().delete(resourceGroupName, trunkedNetworkName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, trunkedNetworkName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String trunkedNetworkName, Context context) { - this.serviceClient().delete(resourceGroupName, trunkedNetworkName, context); + public OperationStatusResult delete(String resourceGroupName, String trunkedNetworkName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, trunkedNetworkName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public TrunkedNetwork getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + String trunkedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "trunkedNetworks"); if (trunkedNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); @@ -91,12 +103,12 @@ public TrunkedNetwork getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + String trunkedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "trunkedNetworks"); if (trunkedNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); @@ -104,32 +116,32 @@ public Response getByIdWithResponse(String id, Context context) return this.getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + String trunkedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "trunkedNetworks"); if (trunkedNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); } - this.delete(resourceGroupName, trunkedNetworkName, Context.NONE); + return this.delete(resourceGroupName, trunkedNetworkName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + String trunkedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "trunkedNetworks"); if (trunkedNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); } - this.delete(resourceGroupName, trunkedNetworkName, context); + return this.delete(resourceGroupName, trunkedNetworkName, context); } private TrunkedNetworksClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java index 657b1e83ca6a7..901e3dc8864b3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java @@ -91,6 +91,10 @@ public String clusterId() { return this.innerModel().clusterId(); } + public ExtendedLocation consoleExtendedLocation() { + return this.innerModel().consoleExtendedLocation(); + } + public long cpuCores() { return this.innerModel().cpuCores(); } @@ -257,8 +261,8 @@ public VirtualMachine apply(Context context) { com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualMachineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualMachines"); } public VirtualMachine refresh() { @@ -371,6 +375,11 @@ public VirtualMachineImpl withBootMethod(VirtualMachineBootMethod bootMethod) { return this; } + public VirtualMachineImpl withConsoleExtendedLocation(ExtendedLocation consoleExtendedLocation) { + this.innerModel().withConsoleExtendedLocation(consoleExtendedLocation); + return this; + } + public VirtualMachineImpl withIsolateEmulatorThread(VirtualMachineIsolateEmulatorThread isolateEmulatorThread) { this.innerModel().withIsolateEmulatorThread(isolateEmulatorThread); return this; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java index 54ab369588062..24fd9b355db84 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java @@ -43,17 +43,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachinesClient. + */ public final class VirtualMachinesClientImpl implements VirtualMachinesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualMachinesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of VirtualMachinesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VirtualMachinesClientImpl(NetworkCloudImpl client) { @@ -130,7 +136,7 @@ Mono>> update(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> powerOff(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -141,7 +147,7 @@ Mono>> powerOff(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> reimage(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -151,7 +157,7 @@ Mono>> reimage(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restart(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -161,7 +167,7 @@ Mono>> restart(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> start(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -188,13 +194,13 @@ Mono> listByResourceGroupNext( /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -217,15 +223,15 @@ private Mono> listSinglePageAsync() { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -248,9 +254,9 @@ private Mono> listSinglePageAsync(Context con /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedFlux}. @@ -263,9 +269,9 @@ private PagedFlux listAsync() { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -280,9 +286,9 @@ private PagedFlux listAsync(Context context) { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. @@ -294,9 +300,9 @@ public PagedIterable list() { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -310,15 +316,15 @@ public PagedIterable list(Context context) { /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -345,16 +351,16 @@ private Mono> listByResourceGroupSinglePageAs /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -382,9 +388,9 @@ private Mono> listByResourceGroupSinglePageAs /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -399,9 +405,9 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -417,15 +423,15 @@ private PagedFlux listByResourceGroupAsync(String resourceG /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -434,16 +440,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -452,16 +458,16 @@ public PagedIterable listByResourceGroup(String resourceGro /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the provided virtual machine along with {@link Response} on successful completion of {@link - * Mono}. + * @return properties of the provided virtual machine along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -491,17 +497,17 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the provided virtual machine along with {@link Response} on successful completion of {@link - * Mono}. + * @return properties of the provided virtual machine along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -530,9 +536,9 @@ private Mono> getByResourceGroupWithResponseAsync( /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -548,9 +554,9 @@ private Mono getByResourceGroupAsync(String resourceGroupNa /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -567,9 +573,9 @@ public Response getByResourceGroupWithResponse(String resou /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -584,9 +590,9 @@ public VirtualMachineInner getByResourceGroup(String resourceGroupName, String v /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -594,7 +600,7 @@ public VirtualMachineInner getByResourceGroup(String resourceGroupName, String v * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -631,9 +637,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -642,7 +648,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -678,9 +684,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -688,7 +694,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( @@ -701,9 +707,9 @@ private PollerFlux, VirtualMachineInner> beginCr /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -712,7 +718,7 @@ private PollerFlux, VirtualMachineInner> beginCr * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( @@ -727,9 +733,9 @@ private PollerFlux, VirtualMachineInner> beginCr /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -737,7 +743,7 @@ private PollerFlux, VirtualMachineInner> beginCr * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( @@ -748,9 +754,9 @@ public SyncPoller, VirtualMachineInner> beginCre /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -759,7 +765,7 @@ public SyncPoller, VirtualMachineInner> beginCre * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( @@ -771,9 +777,9 @@ public SyncPoller, VirtualMachineInner> beginCre /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -781,7 +787,7 @@ public SyncPoller, VirtualMachineInner> beginCre * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String virtualMachineName, @@ -792,9 +798,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -803,7 +809,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String virtualMachineName, @@ -814,9 +820,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -833,9 +839,9 @@ public VirtualMachineInner createOrUpdate(String resourceGroupName, String virtu /** * Create or update the virtual machine. - * - *

Create a new virtual machine or update the properties of the existing virtual machine. - * + * + * Create a new virtual machine or update the properties of the existing virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineParameters The request body. @@ -853,15 +859,16 @@ public VirtualMachineInner createOrUpdate(String resourceGroupName, String virtu /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -891,16 +898,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, @@ -929,157 +937,163 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualMachineName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String virtualMachineName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualMachineName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String virtualMachineName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String virtualMachineName) { return this.beginDeleteAsync(resourceGroupName, virtualMachineName).getSyncPoller(); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String virtualMachineName, Context context) { return this.beginDeleteAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName) { + private Mono deleteAsync(String resourceGroupName, String virtualMachineName) { return beginDeleteAsync(resourceGroupName, virtualMachineName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName, Context context) { + private Mono deleteAsync(String resourceGroupName, String virtualMachineName, + Context context) { return beginDeleteAsync(resourceGroupName, virtualMachineName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName) { - deleteAsync(resourceGroupName, virtualMachineName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName) { + return deleteAsync(resourceGroupName, virtualMachineName).block(); } /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName, Context context) { - deleteAsync(resourceGroupName, virtualMachineName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String virtualMachineName, Context context) { + return deleteAsync(resourceGroupName, virtualMachineName, context).block(); } /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1087,7 +1101,7 @@ public void delete(String resourceGroupName, String virtualMachineName, Context * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1121,10 +1135,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1133,7 +1147,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, @@ -1165,10 +1179,10 @@ private Mono>> updateWithResponseAsync(String resource /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1176,7 +1190,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineInner> beginUpdateAsync(String resourceGroupName, @@ -1189,17 +1203,17 @@ private PollerFlux, VirtualMachineInner> beginUp /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineInner> beginUpdateAsync(String resourceGroupName, @@ -1213,10 +1227,10 @@ private PollerFlux, VirtualMachineInner> beginUp /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1225,7 +1239,7 @@ private PollerFlux, VirtualMachineInner> beginUp * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineInner> beginUpdateAsync(String resourceGroupName, @@ -1239,17 +1253,17 @@ private PollerFlux, VirtualMachineInner> beginUp /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineInner> beginUpdate(String resourceGroupName, @@ -1261,10 +1275,10 @@ public SyncPoller, VirtualMachineInner> beginUpd /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1273,7 +1287,7 @@ public SyncPoller, VirtualMachineInner> beginUpd * @throws 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 virtualMachine represents the on-premises Network Cloud virtual - * machine. + * machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineInner> beginUpdate(String resourceGroupName, @@ -1284,10 +1298,10 @@ public SyncPoller, VirtualMachineInner> beginUpd /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1295,7 +1309,7 @@ public SyncPoller, VirtualMachineInner> beginUpd * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName, @@ -1306,17 +1320,17 @@ private Mono updateAsync(String resourceGroupName, String v /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName) { @@ -1327,10 +1341,10 @@ private Mono updateAsync(String resourceGroupName, String v /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1339,7 +1353,7 @@ private Mono updateAsync(String resourceGroupName, String v * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String virtualMachineName, @@ -1350,10 +1364,10 @@ private Mono updateAsync(String resourceGroupName, String v /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1369,10 +1383,10 @@ public VirtualMachineInner update(String resourceGroupName, String virtualMachin /** * Patch the virtual machine. - * - *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * + * Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. * Properties and tag updates can be done independently. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachineUpdateParameters The request body. @@ -1390,17 +1404,17 @@ public VirtualMachineInner update(String resourceGroupName, String virtualMachin /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> powerOffWithResponseAsync(String resourceGroupName, @@ -1434,9 +1448,9 @@ private Mono>> powerOffWithResponseAsync(String resour /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1444,8 +1458,8 @@ private Mono>> powerOffWithResponseAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> powerOffWithResponseAsync(String resourceGroupName, @@ -1477,9 +1491,9 @@ private Mono>> powerOffWithResponseAsync(String resour /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1501,9 +1515,9 @@ private PollerFlux, OperationStatusResult /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1524,9 +1538,9 @@ private PollerFlux, OperationStatusResult /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1549,9 +1563,9 @@ private PollerFlux, OperationStatusResult /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1569,9 +1583,9 @@ private PollerFlux, OperationStatusResult /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1591,9 +1605,9 @@ public SyncPoller, OperationStatusResultI /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1611,9 +1625,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1630,9 +1644,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1652,9 +1666,9 @@ private Mono powerOffAsync(String resourceGroupName, /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1670,9 +1684,9 @@ public OperationStatusResultInner powerOff(String resourceGroupName, String virt /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -1690,16 +1704,16 @@ public OperationStatusResultInner powerOff(String resourceGroupName, String virt /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> reimageWithResponseAsync(String resourceGroupName, @@ -1729,17 +1743,17 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> reimageWithResponseAsync(String resourceGroupName, @@ -1768,9 +1782,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1789,9 +1803,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -1812,9 +1826,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1830,9 +1844,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -1849,9 +1863,9 @@ private Mono>> reimageWithResponseAsync(String resourc /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1867,9 +1881,9 @@ private Mono reimageAsync(String resourceGroupName, /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -1887,9 +1901,9 @@ private Mono reimageAsync(String resourceGroupName, /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1904,9 +1918,9 @@ public OperationStatusResultInner reimage(String resourceGroupName, String virtu /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -1922,16 +1936,16 @@ public OperationStatusResultInner reimage(String resourceGroupName, String virtu /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, @@ -1961,17 +1975,17 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, @@ -2000,9 +2014,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2021,9 +2035,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2044,9 +2058,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2062,9 +2076,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2081,9 +2095,9 @@ private Mono>> restartWithResponseAsync(String resourc /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2099,9 +2113,9 @@ private Mono restartAsync(String resourceGroupName, /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2119,9 +2133,9 @@ private Mono restartAsync(String resourceGroupName, /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2136,9 +2150,9 @@ public OperationStatusResultInner restart(String resourceGroupName, String virtu /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2154,16 +2168,16 @@ public OperationStatusResultInner restart(String resourceGroupName, String virtu /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, @@ -2193,17 +2207,17 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, String virtualMachineName, @@ -2232,9 +2246,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2253,9 +2267,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2275,9 +2289,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2293,9 +2307,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2312,9 +2326,9 @@ private Mono>> startWithResponseAsync(String resourceG /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2330,9 +2344,9 @@ private Mono startAsync(String resourceGroupName, St /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2350,9 +2364,9 @@ private Mono startAsync(String resourceGroupName, St /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2367,9 +2381,9 @@ public OperationStatusResultInner start(String resourceGroupName, String virtual /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -2385,14 +2399,13 @@ public OperationStatusResultInner start(String resourceGroupName, String virtual /** * 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. * @return virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -2414,15 +2427,14 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, @@ -2443,14 +2455,13 @@ private Mono> listBySubscriptionNextSinglePag /** * 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. * @return virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2472,15 +2483,14 @@ private Mono> listByResourceGroupNextSinglePa /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java index 34c79f7b67b85..87d3e0ee15b6e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java @@ -32,22 +32,22 @@ public VirtualMachinesImpl(VirtualMachinesClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String virtualMachineName, @@ -71,12 +71,22 @@ public VirtualMachine getByResourceGroup(String resourceGroupName, String virtua } } - public void deleteByResourceGroup(String resourceGroupName, String virtualMachineName) { - this.serviceClient().delete(resourceGroupName, virtualMachineName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String virtualMachineName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, virtualMachineName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String virtualMachineName, Context context) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, context); + public OperationStatusResult delete(String resourceGroupName, String virtualMachineName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, virtualMachineName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public OperationStatusResult powerOff(String resourceGroupName, String virtualMachineName) { @@ -154,12 +164,12 @@ public OperationStatusResult start(String resourceGroupName, String virtualMachi } public VirtualMachine getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); @@ -168,12 +178,12 @@ public VirtualMachine getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); @@ -181,32 +191,32 @@ public Response getByIdWithResponse(String id, Context context) return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - this.delete(resourceGroupName, virtualMachineName, Context.NONE); + return this.delete(resourceGroupName, virtualMachineName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + String virtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachines"); if (virtualMachineName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); } - this.delete(resourceGroupName, virtualMachineName, context); + return this.delete(resourceGroupName, virtualMachineName, context); } private VirtualMachinesClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java index d638e517a0462..06bbd02e87189 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java @@ -159,8 +159,8 @@ public Volume apply(Context context) { VolumeImpl(VolumeInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.volumeName = Utils.getValueFromIdByName(innerObject.id(), "volumes"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.volumeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "volumes"); } public Volume refresh() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java index 6e5f6b752cba7..14f498b919570 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java @@ -33,6 +33,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkcloud.fluent.VolumesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; import com.azure.resourcemanager.networkcloud.models.VolumeList; import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; @@ -40,17 +41,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VolumesClient. */ +/** + * An instance of this class provides access to all the operations defined in VolumesClient. + */ public final class VolumesClientImpl implements VolumesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VolumesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final NetworkCloudImpl client; /** * Initializes an instance of VolumesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VolumesClientImpl(NetworkCloudImpl client) { @@ -139,13 +146,13 @@ Mono> listByResourceGroupNext( /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -168,15 +175,15 @@ private Mono> listSinglePageAsync() { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -199,9 +206,9 @@ private Mono> listSinglePageAsync(Context context) { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription as paginated response with {@link PagedFlux}. @@ -214,9 +221,9 @@ private PagedFlux listAsync() { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -231,9 +238,9 @@ private PagedFlux listAsync(Context context) { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. @@ -245,9 +252,9 @@ public PagedIterable list() { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -261,15 +268,15 @@ public PagedIterable list(Context context) { /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -296,16 +303,16 @@ private Mono> listByResourceGroupSinglePageAsync(Stri /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -333,9 +340,9 @@ private Mono> listByResourceGroupSinglePageAsync(Stri /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -350,9 +357,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -368,9 +375,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -384,9 +391,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -401,9 +408,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -438,9 +445,9 @@ private Mono> getByResourceGroupWithResponseAsync(String r /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. @@ -475,9 +482,9 @@ private Mono> getByResourceGroupWithResponseAsync(String r /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -493,9 +500,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Stri /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. @@ -512,9 +519,9 @@ public Response getByResourceGroupWithResponse(String resourceGroup /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -529,17 +536,17 @@ public VolumeInner getByResourceGroup(String resourceGroupName, String volumeNam /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return volume represents storage made available for use by resources running on the cluster along with {@link - * Response} on successful completion of {@link Mono}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -574,9 +581,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -584,8 +591,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return volume represents storage made available for use by resources running on the cluster along with {@link - * Response} on successful completion of {@link Mono}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -619,9 +626,9 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -629,7 +636,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws 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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VolumeInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -642,9 +649,9 @@ private PollerFlux, VolumeInner> beginCreateOrUpdateAsyn /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -653,7 +660,7 @@ private PollerFlux, VolumeInner> beginCreateOrUpdateAsyn * @throws 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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VolumeInner> beginCreateOrUpdateAsync(String resourceGroupName, @@ -667,9 +674,9 @@ private PollerFlux, VolumeInner> beginCreateOrUpdateAsyn /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -677,7 +684,7 @@ private PollerFlux, VolumeInner> beginCreateOrUpdateAsyn * @throws 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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VolumeInner> beginCreateOrUpdate(String resourceGroupName, @@ -687,9 +694,9 @@ public SyncPoller, VolumeInner> beginCreateOrUpdate(Stri /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -698,7 +705,7 @@ public SyncPoller, VolumeInner> beginCreateOrUpdate(Stri * @throws 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 volume represents storage made available for use by resources - * running on the cluster. + * running on the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VolumeInner> beginCreateOrUpdate(String resourceGroupName, @@ -708,9 +715,9 @@ public SyncPoller, VolumeInner> beginCreateOrUpdate(Stri /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -718,7 +725,7 @@ public SyncPoller, VolumeInner> beginCreateOrUpdate(Stri * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return volume represents storage made available for use by resources running on the cluster on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String volumeName, @@ -729,9 +736,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String v /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -740,7 +747,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String v * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return volume represents storage made available for use by resources running on the cluster on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String volumeName, @@ -751,9 +758,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String v /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -769,9 +776,9 @@ public VolumeInner createOrUpdate(String resourceGroupName, String volumeName, V /** * Create or update the volume. - * - *

Create a new volume or update the properties of the existing one. - * + * + * Create a new volume or update the properties of the existing one. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeParameters The request body. @@ -789,15 +796,16 @@ public VolumeInner createOrUpdate(String resourceGroupName, String volumeName, V /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String volumeName) { @@ -825,16 +833,17 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String volumeName, @@ -862,163 +871,168 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String volumeName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String volumeName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, volumeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, this.client.getContext()); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String volumeName, - Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String volumeName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, volumeName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String volumeName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String volumeName) { return this.beginDeleteAsync(resourceGroupName, volumeName).getSyncPoller(); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String volumeName, - Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String volumeName, Context context) { return this.beginDeleteAsync(resourceGroupName, volumeName, context).getSyncPoller(); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String volumeName) { + private Mono deleteAsync(String resourceGroupName, String volumeName) { return beginDeleteAsync(resourceGroupName, volumeName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String volumeName, Context context) { + private Mono deleteAsync(String resourceGroupName, String volumeName, Context context) { return beginDeleteAsync(resourceGroupName, volumeName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String volumeName) { - deleteAsync(resourceGroupName, volumeName).block(); + public OperationStatusResultInner delete(String resourceGroupName, String volumeName) { + return deleteAsync(resourceGroupName, volumeName).block(); } /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @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 current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String volumeName, Context context) { - deleteAsync(resourceGroupName, volumeName, context).block(); + public OperationStatusResultInner delete(String resourceGroupName, String volumeName, Context context) { + return deleteAsync(resourceGroupName, volumeName, context).block(); } /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeUpdateParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return volume represents storage made available for use by resources running on the cluster along with {@link - * Response} on successful completion of {@link Mono}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String volumeName, @@ -1049,9 +1063,9 @@ private Mono> updateWithResponseAsync(String resourceGroup /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeUpdateParameters The request body. @@ -1059,8 +1073,8 @@ private Mono> updateWithResponseAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return volume represents storage made available for use by resources running on the cluster along with {@link - * Response} on successful completion of {@link Mono}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String volumeName, @@ -1091,16 +1105,16 @@ private Mono> updateWithResponseAsync(String resourceGroup /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return volume represents storage made available for use by resources running on the cluster on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String volumeName) { @@ -1111,9 +1125,9 @@ private Mono updateAsync(String resourceGroupName, String volumeNam /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param volumeUpdateParameters The request body. @@ -1121,8 +1135,8 @@ private Mono updateAsync(String resourceGroupName, String volumeNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return volume represents storage made available for use by resources running on the cluster along with {@link - * Response}. + * @return volume represents storage made available for use by resources running on the cluster along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String volumeName, @@ -1132,9 +1146,9 @@ public Response updateWithResponse(String resourceGroupName, String /** * Patch the volume. - * - *

Update tags associated with the provided volume. - * + * + * Update tags associated with the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1150,14 +1164,13 @@ public VolumeInner update(String resourceGroupName, String volumeName) { /** * 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. * @return volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1179,15 +1192,14 @@ private Mono> listBySubscriptionNextSinglePageAsync(S /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1207,14 +1219,13 @@ private Mono> listBySubscriptionNextSinglePageAsync(S /** * 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. * @return volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1236,15 +1247,14 @@ private Mono> listByResourceGroupNextSinglePageAsync( /** * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java index 1654d201b0214..20a536094cc9c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.networkcloud.fluent.VolumesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; import com.azure.resourcemanager.networkcloud.models.Volume; import com.azure.resourcemanager.networkcloud.models.Volumes; @@ -29,22 +31,22 @@ public VolumesImpl(VolumesClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String volumeName, @@ -68,21 +70,31 @@ public Volume getByResourceGroup(String resourceGroupName, String volumeName) { } } - public void deleteByResourceGroup(String resourceGroupName, String volumeName) { - this.serviceClient().delete(resourceGroupName, volumeName); + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String volumeName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, volumeName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String volumeName, Context context) { - this.serviceClient().delete(resourceGroupName, volumeName, context); + public OperationStatusResult delete(String resourceGroupName, String volumeName, Context context) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, volumeName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } } public Volume getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String volumeName = Utils.getValueFromIdByName(id, "volumes"); + String volumeName = ResourceManagerUtils.getValueFromIdByName(id, "volumes"); if (volumeName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); @@ -91,12 +103,12 @@ public Volume getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String volumeName = Utils.getValueFromIdByName(id, "volumes"); + String volumeName = ResourceManagerUtils.getValueFromIdByName(id, "volumes"); if (volumeName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); @@ -104,32 +116,32 @@ public Response getByIdWithResponse(String id, Context context) { return this.getByResourceGroupWithResponse(resourceGroupName, volumeName, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String volumeName = Utils.getValueFromIdByName(id, "volumes"); + String volumeName = ResourceManagerUtils.getValueFromIdByName(id, "volumes"); if (volumeName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); } - this.delete(resourceGroupName, volumeName, Context.NONE); + return this.delete(resourceGroupName, volumeName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String volumeName = Utils.getValueFromIdByName(id, "volumes"); + String volumeName = ResourceManagerUtils.getValueFromIdByName(id, "volumes"); if (volumeName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); } - this.delete(resourceGroupName, volumeName, context); + return this.delete(resourceGroupName, volumeName, context); } private VolumesClient serviceClient() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java index 59b7f3fc4c13f..473bde0bfed19 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java @@ -3,7 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for NetworkCloud. The Network Cloud APIs provide management of the on-premises - * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + * Package containing the implementations for NetworkCloud. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ package com.azure.resourcemanager.networkcloud.implementation; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AadConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AadConfiguration.java index 3144e0a846945..3ed7ccc3adf44 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AadConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AadConfiguration.java @@ -6,27 +6,34 @@ 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; -/** AadConfiguration represents the Azure Active Directory Integration properties. */ +/** + * AadConfiguration represents the Azure Active Directory Integration properties. + */ @Fluent -public final class AadConfiguration { +public final class AadConfiguration implements JsonSerializable { /* * The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes * cluster. */ - @JsonProperty(value = "adminGroupObjectIds", required = true) private List adminGroupObjectIds; - /** Creates an instance of AadConfiguration class. */ + /** + * Creates an instance of AadConfiguration class. + */ public AadConfiguration() { } /** * Get the adminGroupObjectIds property: The list of Azure Active Directory group object IDs that will have an * administrative role on the Kubernetes cluster. - * + * * @return the adminGroupObjectIds value. */ public List adminGroupObjectIds() { @@ -36,7 +43,7 @@ public List adminGroupObjectIds() { /** * Set the adminGroupObjectIds property: The list of Azure Active Directory group object IDs that will have an * administrative role on the Kubernetes cluster. - * + * * @param adminGroupObjectIds the adminGroupObjectIds value to set. * @return the AadConfiguration object itself. */ @@ -47,15 +54,55 @@ public AadConfiguration withAdminGroupObjectIds(List adminGroupObjectIds /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (adminGroupObjectIds() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property adminGroupObjectIds in model AadConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property adminGroupObjectIds in model AadConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(AadConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("adminGroupObjectIds", this.adminGroupObjectIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AadConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AadConfiguration 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 AadConfiguration. + */ + public static AadConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AadConfiguration deserializedAadConfiguration = new AadConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminGroupObjectIds".equals(fieldName)) { + List adminGroupObjectIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAadConfiguration.adminGroupObjectIds = adminGroupObjectIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAadConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java index 13c937d5902ba..29d42ef3dad3a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java index 39eff25eb498e..2bc9d801c0197 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java @@ -6,32 +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; /** * AdministrativeCredentials represents the admin credentials for the device requiring password-based authentication. */ @Fluent -public final class AdministrativeCredentials { +public final class AdministrativeCredentials implements JsonSerializable { /* * The password of the administrator of the device used during initialization. */ - @JsonProperty(value = "password") private String password; /* * The username of the administrator of the device used during initialization. */ - @JsonProperty(value = "username", required = true) private String username; - /** Creates an instance of AdministrativeCredentials class. */ + /** + * Creates an instance of AdministrativeCredentials class. + */ public AdministrativeCredentials() { } /** * Get the password property: The password of the administrator of the device used during initialization. - * + * * @return the password value. */ public String password() { @@ -40,7 +44,7 @@ public String password() { /** * Set the password property: The password of the administrator of the device used during initialization. - * + * * @param password the password value to set. * @return the AdministrativeCredentials object itself. */ @@ -51,7 +55,7 @@ public AdministrativeCredentials withPassword(String password) { /** * Get the username property: The username of the administrator of the device used during initialization. - * + * * @return the username value. */ public String username() { @@ -60,7 +64,7 @@ public String username() { /** * Set the username property: The username of the administrator of the device used during initialization. - * + * * @param username the username value to set. * @return the AdministrativeCredentials object itself. */ @@ -71,19 +75,61 @@ public AdministrativeCredentials withUsername(String username) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (password() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property password in model AdministrativeCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property password in model AdministrativeCredentials")); } if (username() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property username in model AdministrativeCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property username in model AdministrativeCredentials")); } } private static final ClientLogger LOGGER = new ClientLogger(AdministrativeCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministrativeCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministrativeCredentials 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 AdministrativeCredentials. + */ + public static AdministrativeCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministrativeCredentials deserializedAdministrativeCredentials = new AdministrativeCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("password".equals(fieldName)) { + deserializedAdministrativeCredentials.password = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedAdministrativeCredentials.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministrativeCredentials; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfiguration.java index ea84c6a170526..cac48d15c23a2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfiguration.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.networkcloud.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; /** @@ -13,29 +17,29 @@ * agent pool nodes in Kubernetes clusters. */ @Fluent -public final class AdministratorConfiguration { +public final class AdministratorConfiguration implements JsonSerializable { /* * The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If * not supplied, a user name will be chosen by the service. */ - @JsonProperty(value = "adminUsername") private String adminUsername; /* * The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, * specification of public keys may be required to produce a working environment. */ - @JsonProperty(value = "sshPublicKeys") private List sshPublicKeys; - /** Creates an instance of AdministratorConfiguration class. */ + /** + * Creates an instance of AdministratorConfiguration class. + */ public AdministratorConfiguration() { } /** * Get the adminUsername property: The user name for the administrator that will be applied to the operating systems * that run Kubernetes nodes. If not supplied, a user name will be chosen by the service. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -45,7 +49,7 @@ public String adminUsername() { /** * Set the adminUsername property: The user name for the administrator that will be applied to the operating systems * that run Kubernetes nodes. If not supplied, a user name will be chosen by the service. - * + * * @param adminUsername the adminUsername value to set. * @return the AdministratorConfiguration object itself. */ @@ -57,7 +61,7 @@ public AdministratorConfiguration withAdminUsername(String adminUsername) { /** * Get the sshPublicKeys property: The SSH configuration for the operating systems that run the nodes in the * Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. - * + * * @return the sshPublicKeys value. */ public List sshPublicKeys() { @@ -67,7 +71,7 @@ public List sshPublicKeys() { /** * Set the sshPublicKeys property: The SSH configuration for the operating systems that run the nodes in the * Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. - * + * * @param sshPublicKeys the sshPublicKeys value to set. * @return the AdministratorConfiguration object itself. */ @@ -78,7 +82,7 @@ public AdministratorConfiguration withSshPublicKeys(List sshPublic /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -86,4 +90,44 @@ public void validate() { sshPublicKeys().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeArrayField("sshPublicKeys", this.sshPublicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorConfiguration 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 AdministratorConfiguration. + */ + public static AdministratorConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorConfiguration deserializedAdministratorConfiguration = new AdministratorConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUsername".equals(fieldName)) { + deserializedAdministratorConfiguration.adminUsername = reader.getString(); + } else if ("sshPublicKeys".equals(fieldName)) { + List sshPublicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedAdministratorConfiguration.sshPublicKeys = sshPublicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfigurationPatch.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfigurationPatch.java new file mode 100644 index 0000000000000..6194969fb69c5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministratorConfigurationPatch.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + */ +@Fluent +public final class AdministratorConfigurationPatch implements JsonSerializable { + /* + * SshPublicKey represents the public key used to authenticate with a resource through SSH. + */ + private List sshPublicKeys; + + /** + * Creates an instance of AdministratorConfigurationPatch class. + */ + public AdministratorConfigurationPatch() { + } + + /** + * Get the sshPublicKeys property: SshPublicKey represents the public key used to authenticate with a resource + * through SSH. + * + * @return the sshPublicKeys value. + */ + public List sshPublicKeys() { + return this.sshPublicKeys; + } + + /** + * Set the sshPublicKeys property: SshPublicKey represents the public key used to authenticate with a resource + * through SSH. + * + * @param sshPublicKeys the sshPublicKeys value to set. + * @return the AdministratorConfigurationPatch object itself. + */ + public AdministratorConfigurationPatch withSshPublicKeys(List sshPublicKeys) { + this.sshPublicKeys = sshPublicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshPublicKeys() != null) { + sshPublicKeys().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sshPublicKeys", this.sshPublicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorConfigurationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorConfigurationPatch 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 AdministratorConfigurationPatch. + */ + public static AdministratorConfigurationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorConfigurationPatch deserializedAdministratorConfigurationPatch + = new AdministratorConfigurationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPublicKeys".equals(fieldName)) { + List sshPublicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedAdministratorConfigurationPatch.sshPublicKeys = sshPublicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorConfigurationPatch; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdvertiseToFabric.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdvertiseToFabric.java index ef8bc8f9b2327..666a18ad793ce 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdvertiseToFabric.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdvertiseToFabric.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * This field is ignored if fabricPeeringEnabled is set to False. */ public final class AdvertiseToFabric extends ExpandableStringEnum { - /** Static value True for AdvertiseToFabric. */ + /** + * Static value True for AdvertiseToFabric. + */ public static final AdvertiseToFabric TRUE = fromString("True"); - /** Static value False for AdvertiseToFabric. */ + /** + * Static value False for AdvertiseToFabric. + */ public static final AdvertiseToFabric FALSE = fromString("False"); /** * Creates a new instance of AdvertiseToFabric value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public AdvertiseToFabric() { /** * Creates or finds a AdvertiseToFabric from its string representation. - * + * * @param name a name to look for. * @return the corresponding AdvertiseToFabric. */ - @JsonCreator public static AdvertiseToFabric fromString(String name) { return fromString(name, AdvertiseToFabric.class); } /** * Gets known AdvertiseToFabric values. - * + * * @return known AdvertiseToFabric values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentOptions.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentOptions.java index cb4ebea98db44..ccdb72834bac3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentOptions.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentOptions.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.networkcloud.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; -/** AgentOptions are configurations that will be applied to each agent in an agent pool. */ +/** + * AgentOptions are configurations that will be applied to each agent in an agent pool. + */ @Fluent -public final class AgentOptions { +public final class AgentOptions implements JsonSerializable { /* * The number of hugepages to allocate. */ - @JsonProperty(value = "hugepagesCount", required = true) private long hugepagesCount; /* * The size of the hugepages to allocate. */ - @JsonProperty(value = "hugepagesSize") private HugepagesSize hugepagesSize; - /** Creates an instance of AgentOptions class. */ + /** + * Creates an instance of AgentOptions class. + */ public AgentOptions() { } /** * Get the hugepagesCount property: The number of hugepages to allocate. - * + * * @return the hugepagesCount value. */ public long hugepagesCount() { @@ -37,7 +43,7 @@ public long hugepagesCount() { /** * Set the hugepagesCount property: The number of hugepages to allocate. - * + * * @param hugepagesCount the hugepagesCount value to set. * @return the AgentOptions object itself. */ @@ -48,7 +54,7 @@ public AgentOptions withHugepagesCount(long hugepagesCount) { /** * Get the hugepagesSize property: The size of the hugepages to allocate. - * + * * @return the hugepagesSize value. */ public HugepagesSize hugepagesSize() { @@ -57,7 +63,7 @@ public HugepagesSize hugepagesSize() { /** * Set the hugepagesSize property: The size of the hugepages to allocate. - * + * * @param hugepagesSize the hugepagesSize value to set. * @return the AgentOptions object itself. */ @@ -68,9 +74,49 @@ public AgentOptions withHugepagesSize(HugepagesSize hugepagesSize) { /** * 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.writeLongField("hugepagesCount", this.hugepagesCount); + jsonWriter.writeStringField("hugepagesSize", this.hugepagesSize == null ? null : this.hugepagesSize.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentOptions 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 AgentOptions. + */ + public static AgentOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentOptions deserializedAgentOptions = new AgentOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hugepagesCount".equals(fieldName)) { + deserializedAgentOptions.hugepagesCount = reader.getLong(); + } else if ("hugepagesSize".equals(fieldName)) { + deserializedAgentOptions.hugepagesSize = HugepagesSize.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentOptions; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPool.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPool.java index 499ab227b0506..5d3240b71947c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPool.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPool.java @@ -11,87 +11,78 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of AgentPool. */ +/** + * An immutable client-side representation of AgentPool. + */ public interface AgentPool { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** - * Gets the administratorConfiguration property: AdministratorConfiguration represents the administrative - * credentials that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Gets the administratorConfiguration property: The administrator credentials to be used for the nodes in this + * agent pool. + * * @return the administratorConfiguration value. */ AdministratorConfiguration administratorConfiguration(); /** - * Gets the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Gets the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @return the agentOptions value. */ AgentOptions agentOptions(); /** - * Gets the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Gets the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool + * for use by the workloads that run on this Kubernetes cluster. + * * @return the attachedNetworkConfiguration value. */ AttachedNetworkConfiguration attachedNetworkConfiguration(); @@ -99,42 +90,42 @@ public interface AgentPool { /** * Gets the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @return the availabilityZones value. */ List availabilityZones(); /** * Gets the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ long count(); /** * Gets the detailedStatus property: The current status of the agent pool. - * + * * @return the detailedStatus value. */ AgentPoolDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the kubernetesVersion property: The Kubernetes version running in this agent pool. - * + * * @return the kubernetesVersion value. */ String kubernetesVersion(); /** * Gets the labels property: The labels applied to the nodes in this agent pool. - * + * * @return the labels value. */ List labels(); @@ -143,86 +134,92 @@ public interface AgentPool { * Gets the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @return the mode value. */ AgentPoolMode mode(); /** * Gets the provisioningState property: The provisioning state of the agent pool. - * + * * @return the provisioningState value. */ AgentPoolProvisioningState provisioningState(); /** * Gets the taints property: The taints applied to the nodes in this agent pool. - * + * * @return the taints value. */ List taints(); /** - * Gets the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Gets the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ AgentPoolUpgradeSettings upgradeSettings(); /** * Gets the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @return the vmSkuName value. */ String vmSkuName(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.AgentPoolInner object. - * + * * @return the inner object. */ AgentPoolInner innerModel(); - /** The entirety of the AgentPool definition. */ + /** + * The entirety of the AgentPool definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, DefinitionStages.WithCount, DefinitionStages.WithMode, DefinitionStages.WithVmSkuName, DefinitionStages.WithCreate { } - /** The AgentPool definition stages. */ + /** + * The AgentPool definition stages. + */ interface DefinitionStages { - /** The first stage of the AgentPool definition. */ + /** + * The first stage of the AgentPool definition. + */ interface Blank extends WithLocation { } - /** The stage of the AgentPool definition allowing to specify location. */ + /** + * The stage of the AgentPool definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -230,18 +227,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the AgentPool definition allowing to specify parent resource. */ + /** + * The stage of the AgentPool definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, kubernetesClusterName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @return the next definition stage. @@ -249,40 +248,46 @@ interface WithParentResource { WithCount withExistingKubernetesCluster(String resourceGroupName, String kubernetesClusterName); } - /** The stage of the AgentPool definition allowing to specify count. */ + /** + * The stage of the AgentPool definition allowing to specify count. + */ interface WithCount { /** * Specifies the count property: The number of virtual machines that use this configuration.. - * + * * @param count The number of virtual machines that use this configuration. * @return the next definition stage. */ WithMode withCount(long count); } - /** The stage of the AgentPool definition allowing to specify mode. */ + /** + * The stage of the AgentPool definition allowing to specify mode. + */ interface WithMode { /** * Specifies the mode property: The selection of how this agent pool is utilized, either as a system pool or * a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user * pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node * pool with at least one node.. - * + * * @param mode The selection of how this agent pool is utilized, either as a system pool or a user pool. - * System pools run the features and critical services for the Kubernetes Cluster, while user pools are - * dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with - * at least one node. + * System pools run the features and critical services for the Kubernetes Cluster, while user pools are + * dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at + * least one node. * @return the next definition stage. */ WithVmSkuName withMode(AgentPoolMode mode); } - /** The stage of the AgentPool definition allowing to specify vmSkuName. */ + /** + * The stage of the AgentPool definition allowing to specify vmSkuName. + */ interface WithVmSkuName { /** * Specifies the vmSkuName property: The name of the VM SKU that determines the size of resources allocated * for node VMs.. - * + * * @param vmSkuName The name of the VM SKU that determines the size of resources allocated for node VMs. * @return the next definition stage. */ @@ -299,143 +304,141 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExt DefinitionStages.WithLabels, DefinitionStages.WithTaints, DefinitionStages.WithUpgradeSettings { /** * Executes the create request. - * + * * @return the created resource. */ AgentPool create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ AgentPool create(Context context); } - /** The stage of the AgentPool definition allowing to specify tags. */ + /** + * The stage of the AgentPool definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the AgentPool definition allowing to specify extendedLocation. */ + /** + * The stage of the AgentPool definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the AgentPool definition allowing to specify administratorConfiguration. */ + /** + * The stage of the AgentPool definition allowing to specify administratorConfiguration. + */ interface WithAdministratorConfiguration { /** - * Specifies the administratorConfiguration property: AdministratorConfiguration represents the - * administrative credentials that will be applied to the control plane and agent pool nodes in Kubernetes - * clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool.. - * - * @param administratorConfiguration AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - *

The administrator credentials to be used for the nodes in this agent pool. + * Specifies the administratorConfiguration property: The administrator credentials to be used for the nodes + * in this agent pool.. + * + * @param administratorConfiguration The administrator credentials to be used for the nodes in this agent + * pool. * @return the next definition stage. */ WithCreate withAdministratorConfiguration(AdministratorConfiguration administratorConfiguration); } - /** The stage of the AgentPool definition allowing to specify agentOptions. */ + /** + * The stage of the AgentPool definition allowing to specify agentOptions. + */ interface WithAgentOptions { /** - * Specifies the agentOptions property: AgentOptions are configurations that will be applied to each agent - * in an agent pool. - * - *

The configurations that will be applied to each agent in this agent pool.. - * - * @param agentOptions AgentOptions are configurations that will be applied to each agent in an agent pool. - *

The configurations that will be applied to each agent in this agent pool. + * Specifies the agentOptions property: The configurations that will be applied to each agent in this agent + * pool.. + * + * @param agentOptions The configurations that will be applied to each agent in this agent pool. * @return the next definition stage. */ WithCreate withAgentOptions(AgentOptions agentOptions); } - /** The stage of the AgentPool definition allowing to specify attachedNetworkConfiguration. */ + /** + * The stage of the AgentPool definition allowing to specify attachedNetworkConfiguration. + */ interface WithAttachedNetworkConfiguration { /** - * Specifies the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of - * workload networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on - * this Kubernetes cluster.. - * - * @param attachedNetworkConfiguration AttachedNetworkConfiguration represents the set of workload networks - * to attach to a resource. - *

The configuration of networks being attached to the agent pool for use by the workloads that run - * on this Kubernetes cluster. + * Specifies the attachedNetworkConfiguration property: The configuration of networks being attached to the + * agent pool for use by the workloads that run on this Kubernetes cluster.. + * + * @param attachedNetworkConfiguration The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. * @return the next definition stage. */ WithCreate withAttachedNetworkConfiguration(AttachedNetworkConfiguration attachedNetworkConfiguration); } - /** The stage of the AgentPool definition allowing to specify availabilityZones. */ + /** + * The stage of the AgentPool definition allowing to specify availabilityZones. + */ interface WithAvailabilityZones { /** * Specifies the availabilityZones property: The list of availability zones of the Network Cloud cluster * used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be * used.. - * + * * @param availabilityZones The list of availability zones of the Network Cloud cluster used for the - * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. + * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. * @return the next definition stage. */ WithCreate withAvailabilityZones(List availabilityZones); } - /** The stage of the AgentPool definition allowing to specify labels. */ + /** + * The stage of the AgentPool definition allowing to specify labels. + */ interface WithLabels { /** * Specifies the labels property: The labels applied to the nodes in this agent pool.. - * + * * @param labels The labels applied to the nodes in this agent pool. * @return the next definition stage. */ WithCreate withLabels(List labels); } - /** The stage of the AgentPool definition allowing to specify taints. */ + /** + * The stage of the AgentPool definition allowing to specify taints. + */ interface WithTaints { /** * Specifies the taints property: The taints applied to the nodes in this agent pool.. - * + * * @param taints The taints applied to the nodes in this agent pool. * @return the next definition stage. */ WithCreate withTaints(List taints); } - /** The stage of the AgentPool definition allowing to specify upgradeSettings. */ + /** + * The stage of the AgentPool definition allowing to specify upgradeSettings. + */ interface WithUpgradeSettings { /** - * Specifies the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an - * agent pool. - * - *

The configuration of the agent pool.. - * - * @param upgradeSettings AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - *

The configuration of the agent pool. + * Specifies the upgradeSettings property: The configuration of the agent pool.. + * + * @param upgradeSettings The configuration of the agent pool. * @return the next definition stage. */ WithCreate withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); @@ -444,63 +447,85 @@ interface WithUpgradeSettings { /** * Begins update for the AgentPool resource. - * + * * @return the stage of resource update. */ AgentPool.Update update(); - /** The template for AgentPool update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithCount, UpdateStages.WithUpgradeSettings { + /** + * The template for AgentPool update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithAdministratorConfiguration, UpdateStages.WithCount, + UpdateStages.WithUpgradeSettings { /** * Executes the update request. - * + * * @return the updated resource. */ AgentPool apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ AgentPool apply(Context context); } - /** The AgentPool update stages. */ + /** + * The AgentPool update stages. + */ interface UpdateStages { - /** The stage of the AgentPool update allowing to specify tags. */ + /** + * The stage of the AgentPool update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the AgentPool update allowing to specify count. */ + /** + * The stage of the AgentPool update allowing to specify administratorConfiguration. + */ + interface WithAdministratorConfiguration { + /** + * Specifies the administratorConfiguration property: The configuration of administrator credentials for the + * control plane nodes.. + * + * @param administratorConfiguration The configuration of administrator credentials for the control plane + * nodes. + * @return the next definition stage. + */ + Update withAdministratorConfiguration(NodePoolAdministratorConfigurationPatch administratorConfiguration); + } + + /** + * The stage of the AgentPool update allowing to specify count. + */ interface WithCount { /** * Specifies the count property: The number of virtual machines that use this configuration.. - * + * * @param count The number of virtual machines that use this configuration. * @return the next definition stage. */ Update withCount(Long count); } - /** The stage of the AgentPool update allowing to specify upgradeSettings. */ + /** + * The stage of the AgentPool update allowing to specify upgradeSettings. + */ interface WithUpgradeSettings { /** - * Specifies the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an - * agent pool. - * - *

The configuration of the agent pool.. - * - * @param upgradeSettings AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - *

The configuration of the agent pool. + * Specifies the upgradeSettings property: The configuration of the agent pool.. + * + * @param upgradeSettings The configuration of the agent pool. * @return the next definition stage. */ Update withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); @@ -509,14 +534,14 @@ interface WithUpgradeSettings { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ AgentPool refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolDetailedStatus.java index c73fd0feeee31..9fe2df6cac5cf 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current status of the agent pool. */ +/** + * The current status of the agent pool. + */ public final class AgentPoolDetailedStatus extends ExpandableStringEnum { - /** Static value Available for AgentPoolDetailedStatus. */ + /** + * Static value Available for AgentPoolDetailedStatus. + */ public static final AgentPoolDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Error for AgentPoolDetailedStatus. */ + /** + * Static value Error for AgentPoolDetailedStatus. + */ public static final AgentPoolDetailedStatus ERROR = fromString("Error"); - /** Static value Provisioning for AgentPoolDetailedStatus. */ + /** + * Static value Provisioning for AgentPoolDetailedStatus. + */ public static final AgentPoolDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of AgentPoolDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public AgentPoolDetailedStatus() { /** * Creates or finds a AgentPoolDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding AgentPoolDetailedStatus. */ - @JsonCreator public static AgentPoolDetailedStatus fromString(String name) { return fromString(name, AgentPoolDetailedStatus.class); } /** * Gets known AgentPoolDetailedStatus values. - * + * * @return known AgentPoolDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolList.java index cb52083f7235f..dff3eb64bb277 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.AgentPoolInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** AgentPoolList represents a list of Kubernetes cluster agent pools. */ +/** + * AgentPoolList represents a list of Kubernetes cluster agent pools. + */ @Fluent -public final class AgentPoolList { +public final class AgentPoolList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of agent pools. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of AgentPoolList class. */ + /** + * Creates an instance of AgentPoolList class. + */ public AgentPoolList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the AgentPoolList object itself. */ @@ -50,7 +56,7 @@ public AgentPoolList withNextLink(String nextLink) { /** * Get the value property: The list of agent pools. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of agent pools. - * + * * @param value the value value to set. * @return the AgentPoolList object itself. */ @@ -70,7 +76,7 @@ public AgentPoolList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolList 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 AgentPoolList. + */ + public static AgentPoolList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolList deserializedAgentPoolList = new AgentPoolList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedAgentPoolList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AgentPoolInner.fromJson(reader1)); + deserializedAgentPoolList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolMode.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolMode.java index 7be484dd6a151..47fb80793b21d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolMode.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -14,18 +13,24 @@ * Kubernetes cluster must contain at least one system node pool with at least one node. */ public final class AgentPoolMode extends ExpandableStringEnum { - /** Static value System for AgentPoolMode. */ + /** + * Static value System for AgentPoolMode. + */ public static final AgentPoolMode SYSTEM = fromString("System"); - /** Static value User for AgentPoolMode. */ + /** + * Static value User for AgentPoolMode. + */ public static final AgentPoolMode USER = fromString("User"); - /** Static value NotApplicable for AgentPoolMode. */ + /** + * Static value NotApplicable for AgentPoolMode. + */ public static final AgentPoolMode NOT_APPLICABLE = fromString("NotApplicable"); /** * Creates a new instance of AgentPoolMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +39,17 @@ public AgentPoolMode() { /** * Creates or finds a AgentPoolMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding AgentPoolMode. */ - @JsonCreator public static AgentPoolMode fromString(String name) { return fromString(name, AgentPoolMode.class); } /** * Gets known AgentPoolMode values. - * + * * @return known AgentPoolMode values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolPatchParameters.java index 80ad969198f93..93682c120aa01 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolPatchParameters.java @@ -5,39 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.AgentPoolPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. */ +/** + * AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + */ @Fluent -public final class AgentPoolPatchParameters { +public final class AgentPoolPatchParameters implements JsonSerializable { /* - * AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private AgentPoolPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of AgentPoolPatchParameters class. */ + /** + * Creates an instance of AgentPoolPatchParameters class. + */ public AgentPoolPatchParameters() { } /** - * Get the innerProperties property: AgentPoolPatchProperties represents the properties of an agent pool that can be - * modified. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private AgentPoolPatchProperties innerProperties() { @@ -46,7 +45,7 @@ private AgentPoolPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the AgentPoolPatchParameters object itself. */ @@ -64,9 +63,35 @@ public AgentPoolPatchParameters withTags(Map tags) { return this; } + /** + * Get the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @return the administratorConfiguration value. + */ + public NodePoolAdministratorConfigurationPatch administratorConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().administratorConfiguration(); + } + + /** + * Set the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @param administratorConfiguration the administratorConfiguration value to set. + * @return the AgentPoolPatchParameters object itself. + */ + public AgentPoolPatchParameters + withAdministratorConfiguration(NodePoolAdministratorConfigurationPatch administratorConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolPatchProperties(); + } + this.innerProperties().withAdministratorConfiguration(administratorConfiguration); + return this; + } + /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public Long count() { @@ -75,7 +100,7 @@ public Long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the AgentPoolPatchParameters object itself. */ @@ -88,10 +113,8 @@ public AgentPoolPatchParameters withCount(Long count) { } /** - * Get the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Get the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ public AgentPoolUpgradeSettings upgradeSettings() { @@ -99,10 +122,8 @@ public AgentPoolUpgradeSettings upgradeSettings() { } /** - * Set the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Set the upgradeSettings property: The configuration of the agent pool. + * * @param upgradeSettings the upgradeSettings value to set. * @return the AgentPoolPatchParameters object itself. */ @@ -116,7 +137,7 @@ public AgentPoolPatchParameters withUpgradeSettings(AgentPoolUpgradeSettings upg /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -124,4 +145,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolPatchParameters 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 AgentPoolPatchParameters. + */ + public static AgentPoolPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolPatchParameters deserializedAgentPoolPatchParameters = new AgentPoolPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAgentPoolPatchParameters.innerProperties = AgentPoolPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAgentPoolPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolProvisioningState.java index 6d39053d61e6e..025d7f4cea76e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolProvisioningState.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the agent pool. */ +/** + * The provisioning state of the agent pool. + */ public final class AgentPoolProvisioningState extends ExpandableStringEnum { - /** Static value Accepted for AgentPoolProvisioningState. */ + /** + * Static value Accepted for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Canceled for AgentPoolProvisioningState. */ + /** + * Static value Canceled for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState CANCELED = fromString("Canceled"); - /** Static value Deleting for AgentPoolProvisioningState. */ + /** + * Static value Deleting for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for AgentPoolProvisioningState. */ + /** + * Static value Failed for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState FAILED = fromString("Failed"); - /** Static value InProgress for AgentPoolProvisioningState. */ + /** + * Static value InProgress for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState IN_PROGRESS = fromString("InProgress"); - /** Static value Succeeded for AgentPoolProvisioningState. */ + /** + * Static value Succeeded for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Updating for AgentPoolProvisioningState. */ + /** + * Static value Updating for AgentPoolProvisioningState. + */ public static final AgentPoolProvisioningState UPDATING = fromString("Updating"); /** * Creates a new instance of AgentPoolProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public AgentPoolProvisioningState() { /** * Creates or finds a AgentPoolProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding AgentPoolProvisioningState. */ - @JsonCreator public static AgentPoolProvisioningState fromString(String name) { return fromString(name, AgentPoolProvisioningState.class); } /** * Gets known AgentPoolProvisioningState values. - * + * * @return known AgentPoolProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolUpgradeSettings.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolUpgradeSettings.java index 9cd70642ab3b9..aa6d8de3eec3c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolUpgradeSettings.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPoolUpgradeSettings.java @@ -5,30 +5,74 @@ package com.azure.resourcemanager.networkcloud.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; -/** AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. */ +/** + * AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. + */ @Fluent -public final class AgentPoolUpgradeSettings { +public final class AgentPoolUpgradeSettings implements JsonSerializable { + /* + * The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of + * the agent pool. If not specified during creation, a value of 1800 seconds is used. + */ + private Long drainTimeout; + /* * The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer * (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent - * pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the - * default is 1. + * pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during + * creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0. */ - @JsonProperty(value = "maxSurge") private String maxSurge; - /** Creates an instance of AgentPoolUpgradeSettings class. */ + /* + * The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an + * integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total + * agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified + * during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + */ + private String maxUnavailable; + + /** + * Creates an instance of AgentPoolUpgradeSettings class. + */ public AgentPoolUpgradeSettings() { } + /** + * Get the drainTimeout property: The maximum time in seconds that is allowed for a node drain to complete before + * proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used. + * + * @return the drainTimeout value. + */ + public Long drainTimeout() { + return this.drainTimeout; + } + + /** + * Set the drainTimeout property: The maximum time in seconds that is allowed for a node drain to complete before + * proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used. + * + * @param drainTimeout the drainTimeout value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withDrainTimeout(Long drainTimeout) { + this.drainTimeout = drainTimeout; + return this; + } + /** * Get the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can * either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the * percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded - * up. If not specified, the default is 1. - * + * up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater + * than 0. + * * @return the maxSurge value. */ public String maxSurge() { @@ -39,8 +83,9 @@ public String maxSurge() { * Set the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can * either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the * percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded - * up. If not specified, the default is 1. - * + * up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater + * than 0. + * * @param maxSurge the maxSurge value to set. * @return the AgentPoolUpgradeSettings object itself. */ @@ -49,11 +94,81 @@ public AgentPoolUpgradeSettings withMaxSurge(String maxSurge) { return this; } + /** + * Get the maxUnavailable property: The maximum number or percentage of nodes that can be unavailable during + * upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is + * specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, + * fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and + * MaxUnavailable must be greater than 0. + * + * @return the maxUnavailable value. + */ + public String maxUnavailable() { + return this.maxUnavailable; + } + + /** + * Set the maxUnavailable property: The maximum number or percentage of nodes that can be unavailable during + * upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is + * specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, + * fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and + * MaxUnavailable must be greater than 0. + * + * @param maxUnavailable the maxUnavailable value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withMaxUnavailable(String maxUnavailable) { + this.maxUnavailable = maxUnavailable; + 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.writeNumberField("drainTimeout", this.drainTimeout); + jsonWriter.writeStringField("maxSurge", this.maxSurge); + jsonWriter.writeStringField("maxUnavailable", this.maxUnavailable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentPoolUpgradeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentPoolUpgradeSettings 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 AgentPoolUpgradeSettings. + */ + public static AgentPoolUpgradeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentPoolUpgradeSettings deserializedAgentPoolUpgradeSettings = new AgentPoolUpgradeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("drainTimeout".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.drainTimeout = reader.getNullable(JsonReader::getLong); + } else if ("maxSurge".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.maxSurge = reader.getString(); + } else if ("maxUnavailable".equals(fieldName)) { + deserializedAgentPoolUpgradeSettings.maxUnavailable = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentPoolUpgradeSettings; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPools.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPools.java index 4ff1b119ea879..d67b94c91536f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPools.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AgentPools.java @@ -8,45 +8,47 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AgentPools. */ +/** + * Resource collection API of AgentPools. + */ public interface AgentPools { /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName); /** * List agent pools of the Kubernetes cluster. - * - *

Get a list of agent pools for the provided Kubernetes cluster. - * + * + * Get a list of agent pools for the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 a list of agent pools for the provided Kubernetes cluster as paginated response with {@link - * PagedIterable}. + * @return a list of agent pools for the provided Kubernetes cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByKubernetesCluster(String resourceGroupName, String kubernetesClusterName, Context context); /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -61,9 +63,9 @@ Response getWithResponse(String resourceGroupName, String kubernetesC /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -76,23 +78,24 @@ Response getWithResponse(String resourceGroupName, String kubernetesC /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent 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 the current status of an async operation. */ - void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName); + OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName); /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param agentPoolName The name of the Kubernetes cluster agent pool. @@ -100,14 +103,16 @@ Response getWithResponse(String resourceGroupName, String kubernetesC * @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 current status of an async operation. */ - void delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, Context context); + OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String agentPoolName, + Context context); /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,9 +123,9 @@ Response getWithResponse(String resourceGroupName, String kubernetesC /** * Retrieve the Kubernetes cluster agent pool. - * - *

Get properties of the provided Kubernetes cluster agent pool. - * + * + * Get properties of the provided Kubernetes cluster agent pool. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -132,32 +137,34 @@ Response getWithResponse(String resourceGroupName, String kubernetesC /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the Kubernetes cluster agent pool. - * - *

Delete the provided Kubernetes cluster agent pool. - * + * + * Delete the provided Kubernetes cluster agent pool. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new AgentPool resource. - * + * * @param name resource name. * @return the first stage of the new AgentPool definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AnalyticsOutputSettings.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AnalyticsOutputSettings.java new file mode 100644 index 0000000000000..280c5bf6a4fd5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AnalyticsOutputSettings.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this + * cluster. + */ +@Fluent +public final class AnalyticsOutputSettings implements JsonSerializable { + /* + * The resource ID of the analytics workspace that is to be used by the specified identity. + */ + private String analyticsWorkspaceId; + + /* + * The selection of the managed identity to use with this analytics workspace. The identity type must be either + * system assigned or user assigned. + */ + private IdentitySelector associatedIdentity; + + /** + * Creates an instance of AnalyticsOutputSettings class. + */ + public AnalyticsOutputSettings() { + } + + /** + * Get the analyticsWorkspaceId property: The resource ID of the analytics workspace that is to be used by the + * specified identity. + * + * @return the analyticsWorkspaceId value. + */ + public String analyticsWorkspaceId() { + return this.analyticsWorkspaceId; + } + + /** + * Set the analyticsWorkspaceId property: The resource ID of the analytics workspace that is to be used by the + * specified identity. + * + * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. + * @return the AnalyticsOutputSettings object itself. + */ + public AnalyticsOutputSettings withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + this.analyticsWorkspaceId = analyticsWorkspaceId; + return this; + } + + /** + * Get the associatedIdentity property: The selection of the managed identity to use with this analytics workspace. + * The identity type must be either system assigned or user assigned. + * + * @return the associatedIdentity value. + */ + public IdentitySelector associatedIdentity() { + return this.associatedIdentity; + } + + /** + * Set the associatedIdentity property: The selection of the managed identity to use with this analytics workspace. + * The identity type must be either system assigned or user assigned. + * + * @param associatedIdentity the associatedIdentity value to set. + * @return the AnalyticsOutputSettings object itself. + */ + public AnalyticsOutputSettings withAssociatedIdentity(IdentitySelector associatedIdentity) { + this.associatedIdentity = associatedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedIdentity() != null) { + associatedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("analyticsWorkspaceId", this.analyticsWorkspaceId); + jsonWriter.writeJsonField("associatedIdentity", this.associatedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyticsOutputSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyticsOutputSettings 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 AnalyticsOutputSettings. + */ + public static AnalyticsOutputSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyticsOutputSettings deserializedAnalyticsOutputSettings = new AnalyticsOutputSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("analyticsWorkspaceId".equals(fieldName)) { + deserializedAnalyticsOutputSettings.analyticsWorkspaceId = reader.getString(); + } else if ("associatedIdentity".equals(fieldName)) { + deserializedAnalyticsOutputSettings.associatedIdentity = IdentitySelector.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyticsOutputSettings; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AttachedNetworkConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AttachedNetworkConfiguration.java index 60eb8d51aa487..5f261713b79ef 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AttachedNetworkConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AttachedNetworkConfiguration.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.networkcloud.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; -/** AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. */ +/** + * AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + */ @Fluent -public final class AttachedNetworkConfiguration { +public final class AttachedNetworkConfiguration implements JsonSerializable { /* * The list of Layer 2 Networks and related configuration for attachment. */ - @JsonProperty(value = "l2Networks") private List l2Networks; /* * The list of Layer 3 Networks and related configuration for attachment. */ - @JsonProperty(value = "l3Networks") private List l3Networks; /* * The list of Trunked Networks and related configuration for attachment. */ - @JsonProperty(value = "trunkedNetworks") private List trunkedNetworks; - /** Creates an instance of AttachedNetworkConfiguration class. */ + /** + * Creates an instance of AttachedNetworkConfiguration class. + */ public AttachedNetworkConfiguration() { } /** * Get the l2Networks property: The list of Layer 2 Networks and related configuration for attachment. - * + * * @return the l2Networks value. */ public List l2Networks() { @@ -44,7 +49,7 @@ public List l2Networks() { /** * Set the l2Networks property: The list of Layer 2 Networks and related configuration for attachment. - * + * * @param l2Networks the l2Networks value to set. * @return the AttachedNetworkConfiguration object itself. */ @@ -55,7 +60,7 @@ public AttachedNetworkConfiguration withL2Networks(List l3Networks() { @@ -64,7 +69,7 @@ public List l3Networks() { /** * Set the l3Networks property: The list of Layer 3 Networks and related configuration for attachment. - * + * * @param l3Networks the l3Networks value to set. * @return the AttachedNetworkConfiguration object itself. */ @@ -75,7 +80,7 @@ public AttachedNetworkConfiguration withL3Networks(List trunkedNetworks() { @@ -84,7 +89,7 @@ public List trunkedNetworks() { /** * Set the trunkedNetworks property: The list of Trunked Networks and related configuration for attachment. - * + * * @param trunkedNetworks the trunkedNetworks value to set. * @return the AttachedNetworkConfiguration object itself. */ @@ -96,7 +101,7 @@ public List trunkedNetworks() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -110,4 +115,53 @@ public void validate() { trunkedNetworks().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("l2Networks", this.l2Networks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("l3Networks", this.l3Networks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trunkedNetworks", this.trunkedNetworks, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AttachedNetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AttachedNetworkConfiguration 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 AttachedNetworkConfiguration. + */ + public static AttachedNetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AttachedNetworkConfiguration deserializedAttachedNetworkConfiguration = new AttachedNetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("l2Networks".equals(fieldName)) { + List l2Networks + = reader.readArray(reader1 -> L2NetworkAttachmentConfiguration.fromJson(reader1)); + deserializedAttachedNetworkConfiguration.l2Networks = l2Networks; + } else if ("l3Networks".equals(fieldName)) { + List l3Networks + = reader.readArray(reader1 -> L3NetworkAttachmentConfiguration.fromJson(reader1)); + deserializedAttachedNetworkConfiguration.l3Networks = l3Networks; + } else if ("trunkedNetworks".equals(fieldName)) { + List trunkedNetworks + = reader.readArray(reader1 -> TrunkedNetworkAttachmentConfiguration.fromJson(reader1)); + deserializedAttachedNetworkConfiguration.trunkedNetworks = trunkedNetworks; + } else { + reader.skipChildren(); + } + } + + return deserializedAttachedNetworkConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailabilityLifecycle.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailabilityLifecycle.java index cf33c00295e51..85432d4e59855 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailabilityLifecycle.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailabilityLifecycle.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The version lifecycle indicator. */ +/** + * The version lifecycle indicator. + */ public final class AvailabilityLifecycle extends ExpandableStringEnum { - /** Static value Preview for AvailabilityLifecycle. */ + /** + * Static value Preview for AvailabilityLifecycle. + */ public static final AvailabilityLifecycle PREVIEW = fromString("Preview"); - /** Static value GenerallyAvailable for AvailabilityLifecycle. */ + /** + * Static value GenerallyAvailable for AvailabilityLifecycle. + */ public static final AvailabilityLifecycle GENERALLY_AVAILABLE = fromString("GenerallyAvailable"); /** * Creates a new instance of AvailabilityLifecycle value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public AvailabilityLifecycle() { /** * Creates or finds a AvailabilityLifecycle from its string representation. - * + * * @param name a name to look for. * @return the corresponding AvailabilityLifecycle. */ - @JsonCreator public static AvailabilityLifecycle fromString(String name) { return fromString(name, AvailabilityLifecycle.class); } /** * Gets known AvailabilityLifecycle values. - * + * * @return known AvailabilityLifecycle values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailableUpgrade.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailableUpgrade.java index 6473783059559..03ba1e29378c9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailableUpgrade.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AvailableUpgrade.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.networkcloud.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; -/** AvailableUpgrade represents an upgrade available for a Kubernetes cluster. */ +/** + * AvailableUpgrade represents an upgrade available for a Kubernetes cluster. + */ @Immutable -public final class AvailableUpgrade { +public final class AvailableUpgrade implements JsonSerializable { /* * The version lifecycle indicator. */ - @JsonProperty(value = "availabilityLifecycle", access = JsonProperty.Access.WRITE_ONLY) private AvailabilityLifecycle availabilityLifecycle; /* * The version available for upgrading. */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; - /** Creates an instance of AvailableUpgrade class. */ + /** + * Creates an instance of AvailableUpgrade class. + */ public AvailableUpgrade() { } /** * Get the availabilityLifecycle property: The version lifecycle indicator. - * + * * @return the availabilityLifecycle value. */ public AvailabilityLifecycle availabilityLifecycle() { @@ -37,7 +43,7 @@ public AvailabilityLifecycle availabilityLifecycle() { /** * Get the version property: The version available for upgrading. - * + * * @return the version value. */ public String version() { @@ -46,9 +52,47 @@ public String version() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableUpgrade from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableUpgrade 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 AvailableUpgrade. + */ + public static AvailableUpgrade fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableUpgrade deserializedAvailableUpgrade = new AvailableUpgrade(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityLifecycle".equals(fieldName)) { + deserializedAvailableUpgrade.availabilityLifecycle + = AvailabilityLifecycle.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedAvailableUpgrade.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableUpgrade; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java index 458c70aa7903e..4bc4d1cb6e8af 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of BareMetalMachine. */ +/** + * An immutable client-side representation of BareMetalMachine. + */ public interface BareMetalMachine { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,7 +67,7 @@ public interface BareMetalMachine { /** * Gets the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ List associatedResourceIds(); @@ -76,81 +75,73 @@ public interface BareMetalMachine { /** * Gets the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @return the bmcConnectionString value. */ String bmcConnectionString(); /** - * Gets the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Gets the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. + * * @return the bmcCredentials value. */ AdministrativeCredentials bmcCredentials(); /** * Gets the bmcMacAddress property: The MAC address of the BMC device. - * + * * @return the bmcMacAddress value. */ String bmcMacAddress(); /** * Gets the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @return the bootMacAddress value. */ String bootMacAddress(); /** * Gets the clusterId property: The resource ID of the cluster this bare metal machine is associated with. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the cordonStatus property: The cordon status of the bare metal machine. - * + * * @return the cordonStatus value. */ BareMetalMachineCordonStatus cordonStatus(); /** * Gets the detailedStatus property: The more detailed status of the bare metal machine. - * + * * @return the detailedStatus value. */ BareMetalMachineDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** - * Gets the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as - * exposed to the customer, including information acquired from the model/sku information and from the ironic - * inspector. - * - *

The hardware inventory, including information acquired from the model/sku information and from the ironic - * inspector. - * + * Gets the hardwareInventory property: The hardware inventory, including information acquired from the model/sku + * information and from the ironic inspector. + * * @return the hardwareInventory value. */ HardwareInventory hardwareInventory(); /** - * Gets the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation - * details performed for this bare metal machine. - * - *

The details of the latest hardware validation performed for this bare metal machine. - * + * Gets the hardwareValidationStatus property: The details of the latest hardware validation performed for this bare + * metal machine. + * * @return the hardwareValidationStatus value. */ HardwareValidationStatus hardwareValidationStatus(); @@ -158,7 +149,7 @@ public interface BareMetalMachine { /** * Gets the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. - * + * * @return the hybridAksClustersAssociatedIds value. */ List hybridAksClustersAssociatedIds(); @@ -166,35 +157,50 @@ public interface BareMetalMachine { /** * Gets the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's * Kubernetes control plane. - * + * * @return the kubernetesNodeName value. */ String kubernetesNodeName(); /** * Gets the kubernetesVersion property: The version of Kubernetes running on this machine. - * + * * @return the kubernetesVersion value. */ String kubernetesVersion(); + /** + * Gets the machineClusterVersion property: The cluster version that has been applied to this machine during + * deployment or a version update. + * + * @return the machineClusterVersion value. + */ + String machineClusterVersion(); + /** * Gets the machineDetails property: The custom details provided by the customer. - * + * * @return the machineDetails value. */ String machineDetails(); /** * Gets the machineName property: The OS-level hostname assigned to this machine. - * + * * @return the machineName value. */ String machineName(); + /** + * Gets the machineRoles property: The list of roles that are assigned to the cluster node running on this machine. + * + * @return the machineRoles value. + */ + List machineRoles(); + /** * Gets the machineSkuId property: The unique internal identifier of the bare metal machine SKU. - * + * * @return the machineSkuId value. */ String machineSkuId(); @@ -202,7 +208,7 @@ public interface BareMetalMachine { /** * Gets the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv4Address value. */ String oamIpv4Address(); @@ -210,35 +216,35 @@ public interface BareMetalMachine { /** * Gets the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster * deployment. - * + * * @return the oamIpv6Address value. */ String oamIpv6Address(); /** * Gets the osImage property: The image that is currently provisioned to the OS disk. - * + * * @return the osImage value. */ String osImage(); /** * Gets the powerState property: The power state derived from the baseboard management controller. - * + * * @return the powerState value. */ BareMetalMachinePowerState powerState(); /** * Gets the provisioningState property: The provisioning state of the bare metal machine. - * + * * @return the provisioningState value. */ BareMetalMachineProvisioningState provisioningState(); /** * Gets the rackId property: The resource ID of the rack where this bare metal machine resides. - * + * * @return the rackId value. */ String rackId(); @@ -246,28 +252,42 @@ public interface BareMetalMachine { /** * Gets the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up * i.e. the lowest slot is 1. - * + * * @return the rackSlot value. */ long rackSlot(); /** * Gets the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. - * + * * @return the readyState value. */ BareMetalMachineReadyState readyState(); + /** + * Gets the runtimeProtectionStatus property: The runtime protection status of the bare metal machine. + * + * @return the runtimeProtectionStatus value. + */ + RuntimeProtectionStatus runtimeProtectionStatus(); + + /** + * Gets the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + List secretRotationStatus(); + /** * Gets the serialNumber property: The serial number of the bare metal machine. - * + * * @return the serialNumber value. */ String serialNumber(); /** * Gets the serviceTag property: The discovered value of the machine's service tag. - * + * * @return the serviceTag value. */ String serviceTag(); @@ -275,40 +295,42 @@ public interface BareMetalMachine { /** * Gets the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * the resource IDs for the VirtualMachines that are hosted on this bare metal machine. - * + * * @return the virtualMachinesAssociatedIds value. */ List virtualMachinesAssociatedIds(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner object. - * + * * @return the inner object. */ BareMetalMachineInner innerModel(); - /** The entirety of the BareMetalMachine definition. */ + /** + * The entirety of the BareMetalMachine definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithBmcConnectionString, DefinitionStages.WithBmcCredentials, @@ -317,17 +339,23 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocati DefinitionStages.WithRackSlot, DefinitionStages.WithSerialNumber, DefinitionStages.WithCreate { } - /** The BareMetalMachine definition stages. */ + /** + * The BareMetalMachine definition stages. + */ interface DefinitionStages { - /** The first stage of the BareMetalMachine definition. */ + /** + * The first stage of the BareMetalMachine definition. + */ interface Blank extends WithLocation { } - /** The stage of the BareMetalMachine definition allowing to specify location. */ + /** + * The stage of the BareMetalMachine definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -335,153 +363,169 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the BareMetalMachine definition allowing to specify parent resource. */ + /** + * The stage of the BareMetalMachine definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the BareMetalMachine definition allowing to specify extendedLocation. */ + /** + * The stage of the BareMetalMachine definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithBmcConnectionString withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the BareMetalMachine definition allowing to specify bmcConnectionString. */ + /** + * The stage of the BareMetalMachine definition allowing to specify bmcConnectionString. + */ interface WithBmcConnectionString { /** * Specifies the bmcConnectionString property: The connection string for the baseboard management controller * including IP address and protocol.. - * + * * @param bmcConnectionString The connection string for the baseboard management controller including IP - * address and protocol. + * address and protocol. * @return the next definition stage. */ WithBmcCredentials withBmcConnectionString(String bmcConnectionString); } - /** The stage of the BareMetalMachine definition allowing to specify bmcCredentials. */ + /** + * The stage of the BareMetalMachine definition allowing to specify bmcCredentials. + */ interface WithBmcCredentials { /** - * Specifies the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine.. - * - * @param bmcCredentials AdministrativeCredentials represents the admin credentials for the device requiring - * password-based authentication. - *

The credentials of the baseboard management controller on this bare metal machine. + * Specifies the bmcCredentials property: The credentials of the baseboard management controller on this + * bare metal machine.. + * + * @param bmcCredentials The credentials of the baseboard management controller on this bare metal machine. * @return the next definition stage. */ WithBmcMacAddress withBmcCredentials(AdministrativeCredentials bmcCredentials); } - /** The stage of the BareMetalMachine definition allowing to specify bmcMacAddress. */ + /** + * The stage of the BareMetalMachine definition allowing to specify bmcMacAddress. + */ interface WithBmcMacAddress { /** * Specifies the bmcMacAddress property: The MAC address of the BMC device.. - * + * * @param bmcMacAddress The MAC address of the BMC device. * @return the next definition stage. */ WithBootMacAddress withBmcMacAddress(String bmcMacAddress); } - /** The stage of the BareMetalMachine definition allowing to specify bootMacAddress. */ + /** + * The stage of the BareMetalMachine definition allowing to specify bootMacAddress. + */ interface WithBootMacAddress { /** * Specifies the bootMacAddress property: The MAC address of a NIC connected to the PXE network.. - * + * * @param bootMacAddress The MAC address of a NIC connected to the PXE network. * @return the next definition stage. */ WithMachineDetails withBootMacAddress(String bootMacAddress); } - /** The stage of the BareMetalMachine definition allowing to specify machineDetails. */ + /** + * The stage of the BareMetalMachine definition allowing to specify machineDetails. + */ interface WithMachineDetails { /** * Specifies the machineDetails property: The custom details provided by the customer.. - * + * * @param machineDetails The custom details provided by the customer. * @return the next definition stage. */ WithMachineName withMachineDetails(String machineDetails); } - /** The stage of the BareMetalMachine definition allowing to specify machineName. */ + /** + * The stage of the BareMetalMachine definition allowing to specify machineName. + */ interface WithMachineName { /** * Specifies the machineName property: The OS-level hostname assigned to this machine.. - * + * * @param machineName The OS-level hostname assigned to this machine. * @return the next definition stage. */ WithMachineSkuId withMachineName(String machineName); } - /** The stage of the BareMetalMachine definition allowing to specify machineSkuId. */ + /** + * The stage of the BareMetalMachine definition allowing to specify machineSkuId. + */ interface WithMachineSkuId { /** * Specifies the machineSkuId property: The unique internal identifier of the bare metal machine SKU.. - * + * * @param machineSkuId The unique internal identifier of the bare metal machine SKU. * @return the next definition stage. */ WithRackId withMachineSkuId(String machineSkuId); } - /** The stage of the BareMetalMachine definition allowing to specify rackId. */ + /** + * The stage of the BareMetalMachine definition allowing to specify rackId. + */ interface WithRackId { /** * Specifies the rackId property: The resource ID of the rack where this bare metal machine resides.. - * + * * @param rackId The resource ID of the rack where this bare metal machine resides. * @return the next definition stage. */ WithRackSlot withRackId(String rackId); } - /** The stage of the BareMetalMachine definition allowing to specify rackSlot. */ + /** + * The stage of the BareMetalMachine definition allowing to specify rackSlot. + */ interface WithRackSlot { /** * Specifies the rackSlot property: The rack slot in which this bare metal machine is located, ordered from * the bottom up i.e. the lowest slot is 1.. - * + * * @param rackSlot The rack slot in which this bare metal machine is located, ordered from the bottom up - * i.e. the lowest slot is 1. + * i.e. the lowest slot is 1. * @return the next definition stage. */ WithSerialNumber withRackSlot(long rackSlot); } - /** The stage of the BareMetalMachine definition allowing to specify serialNumber. */ + /** + * The stage of the BareMetalMachine definition allowing to specify serialNumber. + */ interface WithSerialNumber { /** * Specifies the serialNumber property: The serial number of the bare metal machine.. - * + * * @param serialNumber The serial number of the bare metal machine. * @return the next definition stage. */ @@ -492,81 +536,107 @@ interface WithSerialNumber { * The stage of the BareMetalMachine definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithMachineClusterVersion { /** * Executes the create request. - * + * * @return the created resource. */ BareMetalMachine create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ BareMetalMachine create(Context context); } - /** The stage of the BareMetalMachine definition allowing to specify tags. */ + /** + * The stage of the BareMetalMachine definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } + + /** + * The stage of the BareMetalMachine definition allowing to specify machineClusterVersion. + */ + interface WithMachineClusterVersion { + /** + * Specifies the machineClusterVersion property: The cluster version that has been applied to this machine + * during deployment or a version update.. + * + * @param machineClusterVersion The cluster version that has been applied to this machine during deployment + * or a version update. + * @return the next definition stage. + */ + WithCreate withMachineClusterVersion(String machineClusterVersion); + } } /** * Begins update for the BareMetalMachine resource. - * + * * @return the stage of resource update. */ BareMetalMachine.Update update(); - /** The template for BareMetalMachine update. */ + /** + * The template for BareMetalMachine update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithMachineDetails { /** * Executes the update request. - * + * * @return the updated resource. */ BareMetalMachine apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ BareMetalMachine apply(Context context); } - /** The BareMetalMachine update stages. */ + /** + * The BareMetalMachine update stages. + */ interface UpdateStages { - /** The stage of the BareMetalMachine update allowing to specify tags. */ + /** + * The stage of the BareMetalMachine update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the BareMetalMachine update allowing to specify machineDetails. */ + /** + * The stage of the BareMetalMachine update allowing to specify machineDetails. + */ interface WithMachineDetails { /** * Specifies the machineDetails property: The details provided by the customer during the creation of rack - * manifests that allows for custom data to be associated with this machine.. - * - * @param machineDetails The details provided by the customer during the creation of rack manifests that - * allows for custom data to be associated with this machine. + * manifests + * that allows for custom data to be associated with this machine.. + * + * @param machineDetails The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. * @return the next definition stage. */ Update withMachineDetails(String machineDetails); @@ -575,14 +645,14 @@ interface WithMachineDetails { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ BareMetalMachine refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -590,9 +660,9 @@ interface WithMachineDetails { /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @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 current status of an async operation. @@ -601,9 +671,9 @@ interface WithMachineDetails { /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param bareMetalMachineCordonParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -615,9 +685,9 @@ interface WithMachineDetails { /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @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 current status of an async operation. @@ -626,9 +696,9 @@ interface WithMachineDetails { /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param bareMetalMachinePowerOffParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -641,9 +711,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @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 current status of an async operation. @@ -652,9 +722,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -665,9 +735,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @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 current status of an async operation. @@ -676,9 +746,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param bareMetalMachineReplaceParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -690,9 +760,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @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 current status of an async operation. @@ -701,9 +771,9 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -714,10 +784,10 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param bareMetalMachineRunCommandParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -728,10 +798,10 @@ OperationStatusResult powerOff(BareMetalMachinePowerOffParameters bareMetalMachi /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param bareMetalMachineRunCommandParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -744,11 +814,10 @@ OperationStatusResult runCommand(BareMetalMachineRunCommandParameters bareMetalM /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param bareMetalMachineRunDataExtractsParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -760,11 +829,10 @@ OperationStatusResult runCommand(BareMetalMachineRunCommandParameters bareMetalM /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param bareMetalMachineRunDataExtractsParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -777,11 +845,11 @@ OperationStatusResult runDataExtracts( /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param bareMetalMachineRunReadCommandsParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -793,11 +861,11 @@ OperationStatusResult runDataExtracts( /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param bareMetalMachineRunReadCommandsParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -810,9 +878,9 @@ OperationStatusResult runReadCommands( /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @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 current status of an async operation. @@ -821,9 +889,9 @@ OperationStatusResult runReadCommands( /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -834,9 +902,9 @@ OperationStatusResult runReadCommands( /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @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 current status of an async operation. @@ -845,9 +913,9 @@ OperationStatusResult runReadCommands( /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @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. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java index 2bd059c107bb4..75789825cb722 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java @@ -6,7 +6,11 @@ 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; /** @@ -14,27 +18,28 @@ * machine. */ @Fluent -public final class BareMetalMachineCommandSpecification { +public final class BareMetalMachineCommandSpecification + implements JsonSerializable { /* * The list of string arguments that will be passed to the script in order as separate arguments. */ - @JsonProperty(value = "arguments") private List arguments; /* * The command to execute against the bare metal machine. */ - @JsonProperty(value = "command", required = true) private String command; - /** Creates an instance of BareMetalMachineCommandSpecification class. */ + /** + * Creates an instance of BareMetalMachineCommandSpecification class. + */ public BareMetalMachineCommandSpecification() { } /** * Get the arguments property: The list of string arguments that will be passed to the script in order as separate * arguments. - * + * * @return the arguments value. */ public List arguments() { @@ -44,7 +49,7 @@ public List arguments() { /** * Set the arguments property: The list of string arguments that will be passed to the script in order as separate * arguments. - * + * * @param arguments the arguments value to set. * @return the BareMetalMachineCommandSpecification object itself. */ @@ -55,7 +60,7 @@ public BareMetalMachineCommandSpecification withArguments(List arguments /** * Get the command property: The command to execute against the bare metal machine. - * + * * @return the command value. */ public String command() { @@ -64,7 +69,7 @@ public String command() { /** * Set the command property: The command to execute against the bare metal machine. - * + * * @param command the command value to set. * @return the BareMetalMachineCommandSpecification object itself. */ @@ -75,15 +80,58 @@ public BareMetalMachineCommandSpecification withCommand(String command) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (command() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property command in model BareMetalMachineCommandSpecification")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property command in model BareMetalMachineCommandSpecification")); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineCommandSpecification.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeArrayField("arguments", this.arguments, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineCommandSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineCommandSpecification 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 BareMetalMachineCommandSpecification. + */ + public static BareMetalMachineCommandSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineCommandSpecification deserializedBareMetalMachineCommandSpecification + = new BareMetalMachineCommandSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedBareMetalMachineCommandSpecification.command = reader.getString(); + } else if ("arguments".equals(fieldName)) { + List arguments = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineCommandSpecification.arguments = arguments; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineCommandSpecification; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java index c84df29a009fb..77f2f7f0b5932 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java @@ -6,71 +6,70 @@ 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; -/** BareMetalMachineConfigurationData represents configuration for the bare metal machine. */ +/** + * BareMetalMachineConfigurationData represents configuration for the bare metal machine. + */ @Fluent -public final class BareMetalMachineConfigurationData { +public final class BareMetalMachineConfigurationData implements JsonSerializable { /* * The connection string for the baseboard management controller including IP address and protocol. */ - @JsonProperty(value = "bmcConnectionString", access = JsonProperty.Access.WRITE_ONLY) private String bmcConnectionString; /* - * AdministrativeCredentials represents the admin credentials for the device requiring password-based - * authentication. - * - * The credentials of the baseboard management controller on this bare metal machine. + * The credentials of the baseboard management controller on this bare metal machine. The password field is expected + * to be an Azure Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the + * secret archive settings, the actual password value should be provided instead. */ - @JsonProperty(value = "bmcCredentials", required = true) private AdministrativeCredentials bmcCredentials; /* * The MAC address of the BMC for this machine. */ - @JsonProperty(value = "bmcMacAddress", required = true) private String bmcMacAddress; /* * The MAC address associated with the PXE NIC card. */ - @JsonProperty(value = "bootMacAddress", required = true) private String bootMacAddress; /* * The free-form additional information about the machine, e.g. an asset tag. */ - @JsonProperty(value = "machineDetails") private String machineDetails; /* * The user-provided name for the bare metal machine created from this specification. * If not provided, the machine name will be generated programmatically. */ - @JsonProperty(value = "machineName") private String machineName; /* * The slot the physical machine is in the rack based on the BOM configuration. */ - @JsonProperty(value = "rackSlot", required = true) private long rackSlot; /* * The serial number of the machine. Hardware suppliers may use an alternate value. For example, service tag. */ - @JsonProperty(value = "serialNumber", required = true) private String serialNumber; - /** Creates an instance of BareMetalMachineConfigurationData class. */ + /** + * Creates an instance of BareMetalMachineConfigurationData class. + */ public BareMetalMachineConfigurationData() { } /** * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP * address and protocol. - * + * * @return the bmcConnectionString value. */ public String bmcConnectionString() { @@ -78,11 +77,11 @@ public String bmcConnectionString() { } /** - * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Get the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. The password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to + * utilize managed identity by setting the secret archive settings, the actual password value should be provided + * instead. + * * @return the bmcCredentials value. */ public AdministrativeCredentials bmcCredentials() { @@ -90,11 +89,11 @@ public AdministrativeCredentials bmcCredentials() { } /** - * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Set the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. The password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to + * utilize managed identity by setting the secret archive settings, the actual password value should be provided + * instead. + * * @param bmcCredentials the bmcCredentials value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -105,7 +104,7 @@ public BareMetalMachineConfigurationData withBmcCredentials(AdministrativeCreden /** * Get the bmcMacAddress property: The MAC address of the BMC for this machine. - * + * * @return the bmcMacAddress value. */ public String bmcMacAddress() { @@ -114,7 +113,7 @@ public String bmcMacAddress() { /** * Set the bmcMacAddress property: The MAC address of the BMC for this machine. - * + * * @param bmcMacAddress the bmcMacAddress value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -125,7 +124,7 @@ public BareMetalMachineConfigurationData withBmcMacAddress(String bmcMacAddress) /** * Get the bootMacAddress property: The MAC address associated with the PXE NIC card. - * + * * @return the bootMacAddress value. */ public String bootMacAddress() { @@ -134,7 +133,7 @@ public String bootMacAddress() { /** * Set the bootMacAddress property: The MAC address associated with the PXE NIC card. - * + * * @param bootMacAddress the bootMacAddress value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -145,7 +144,7 @@ public BareMetalMachineConfigurationData withBootMacAddress(String bootMacAddres /** * Get the machineDetails property: The free-form additional information about the machine, e.g. an asset tag. - * + * * @return the machineDetails value. */ public String machineDetails() { @@ -154,7 +153,7 @@ public String machineDetails() { /** * Set the machineDetails property: The free-form additional information about the machine, e.g. an asset tag. - * + * * @param machineDetails the machineDetails value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -166,7 +165,7 @@ public BareMetalMachineConfigurationData withMachineDetails(String machineDetail /** * Get the machineName property: The user-provided name for the bare metal machine created from this specification. * If not provided, the machine name will be generated programmatically. - * + * * @return the machineName value. */ public String machineName() { @@ -176,7 +175,7 @@ public String machineName() { /** * Set the machineName property: The user-provided name for the bare metal machine created from this specification. * If not provided, the machine name will be generated programmatically. - * + * * @param machineName the machineName value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -187,7 +186,7 @@ public BareMetalMachineConfigurationData withMachineName(String machineName) { /** * Get the rackSlot property: The slot the physical machine is in the rack based on the BOM configuration. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -196,7 +195,7 @@ public long rackSlot() { /** * Set the rackSlot property: The slot the physical machine is in the rack based on the BOM configuration. - * + * * @param rackSlot the rackSlot value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -208,7 +207,7 @@ public BareMetalMachineConfigurationData withRackSlot(long rackSlot) { /** * Get the serialNumber property: The serial number of the machine. Hardware suppliers may use an alternate value. * For example, service tag. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -218,7 +217,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number of the machine. Hardware suppliers may use an alternate value. * For example, service tag. - * + * * @param serialNumber the serialNumber value to set. * @return the BareMetalMachineConfigurationData object itself. */ @@ -229,29 +228,92 @@ public BareMetalMachineConfigurationData withSerialNumber(String serialNumber) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (bmcCredentials() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bmcCredentials in model BareMetalMachineConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bmcCredentials in model BareMetalMachineConfigurationData")); } else { bmcCredentials().validate(); } if (bmcMacAddress() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bmcMacAddress in model BareMetalMachineConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bmcMacAddress in model BareMetalMachineConfigurationData")); } if (bootMacAddress() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property bootMacAddress in model BareMetalMachineConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bootMacAddress in model BareMetalMachineConfigurationData")); } if (serialNumber() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serialNumber in model BareMetalMachineConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serialNumber in model BareMetalMachineConfigurationData")); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineConfigurationData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bmcCredentials", this.bmcCredentials); + jsonWriter.writeStringField("bmcMacAddress", this.bmcMacAddress); + jsonWriter.writeStringField("bootMacAddress", this.bootMacAddress); + jsonWriter.writeLongField("rackSlot", this.rackSlot); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("machineDetails", this.machineDetails); + jsonWriter.writeStringField("machineName", this.machineName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineConfigurationData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineConfigurationData 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 BareMetalMachineConfigurationData. + */ + public static BareMetalMachineConfigurationData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineConfigurationData deserializedBareMetalMachineConfigurationData + = new BareMetalMachineConfigurationData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bmcCredentials".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.bmcCredentials + = AdministrativeCredentials.fromJson(reader); + } else if ("bmcMacAddress".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.bmcMacAddress = reader.getString(); + } else if ("bootMacAddress".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.bootMacAddress = reader.getString(); + } else if ("rackSlot".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.rackSlot = reader.getLong(); + } else if ("serialNumber".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.serialNumber = reader.getString(); + } else if ("bmcConnectionString".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.bmcConnectionString = reader.getString(); + } else if ("machineDetails".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.machineDetails = reader.getString(); + } else if ("machineName".equals(fieldName)) { + deserializedBareMetalMachineConfigurationData.machineName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineConfigurationData; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java index 02249eaf0d89c..163bd98f5c6f9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java @@ -5,28 +5,33 @@ package com.azure.resourcemanager.networkcloud.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; /** * BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal * machine. */ @Fluent -public final class BareMetalMachineCordonParameters { +public final class BareMetalMachineCordonParameters implements JsonSerializable { /* * The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. */ - @JsonProperty(value = "evacuate") private BareMetalMachineEvacuate evacuate; - /** Creates an instance of BareMetalMachineCordonParameters class. */ + /** + * Creates an instance of BareMetalMachineCordonParameters class. + */ public BareMetalMachineCordonParameters() { } /** * Get the evacuate property: The indicator of whether to evacuate the node workload when the bare metal machine is * cordoned. - * + * * @return the evacuate value. */ public BareMetalMachineEvacuate evacuate() { @@ -36,7 +41,7 @@ public BareMetalMachineEvacuate evacuate() { /** * Set the evacuate property: The indicator of whether to evacuate the node workload when the bare metal machine is * cordoned. - * + * * @param evacuate the evacuate value to set. * @return the BareMetalMachineCordonParameters object itself. */ @@ -47,9 +52,47 @@ public BareMetalMachineCordonParameters withEvacuate(BareMetalMachineEvacuate ev /** * 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("evacuate", this.evacuate == null ? null : this.evacuate.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineCordonParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineCordonParameters 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 BareMetalMachineCordonParameters. + */ + public static BareMetalMachineCordonParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineCordonParameters deserializedBareMetalMachineCordonParameters + = new BareMetalMachineCordonParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evacuate".equals(fieldName)) { + deserializedBareMetalMachineCordonParameters.evacuate + = BareMetalMachineEvacuate.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineCordonParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java index ba47f83edf6c1..4a77fbe91c386 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The cordon status of the bare metal machine. */ +/** + * The cordon status of the bare metal machine. + */ public final class BareMetalMachineCordonStatus extends ExpandableStringEnum { - /** Static value Cordoned for BareMetalMachineCordonStatus. */ + /** + * Static value Cordoned for BareMetalMachineCordonStatus. + */ public static final BareMetalMachineCordonStatus CORDONED = fromString("Cordoned"); - /** Static value Uncordoned for BareMetalMachineCordonStatus. */ + /** + * Static value Uncordoned for BareMetalMachineCordonStatus. + */ public static final BareMetalMachineCordonStatus UNCORDONED = fromString("Uncordoned"); /** * Creates a new instance of BareMetalMachineCordonStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BareMetalMachineCordonStatus() { /** * Creates or finds a BareMetalMachineCordonStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineCordonStatus. */ - @JsonCreator public static BareMetalMachineCordonStatus fromString(String name) { return fromString(name, BareMetalMachineCordonStatus.class); } /** * Gets known BareMetalMachineCordonStatus values. - * + * * @return known BareMetalMachineCordonStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java index 7946539c2a4ca..890d042dab5be 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the bare metal machine. */ +/** + * The more detailed status of the bare metal machine. + */ public final class BareMetalMachineDetailedStatus extends ExpandableStringEnum { - /** Static value Preparing for BareMetalMachineDetailedStatus. */ + /** + * Static value Preparing for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus PREPARING = fromString("Preparing"); - /** Static value Error for BareMetalMachineDetailedStatus. */ + /** + * Static value Error for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus ERROR = fromString("Error"); - /** Static value Available for BareMetalMachineDetailedStatus. */ + /** + * Static value Available for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for BareMetalMachineDetailedStatus. */ + /** + * Static value Provisioning for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus PROVISIONING = fromString("Provisioning"); - /** Static value Provisioned for BareMetalMachineDetailedStatus. */ + /** + * Static value Provisioned for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus PROVISIONED = fromString("Provisioned"); - /** Static value Deprovisioning for BareMetalMachineDetailedStatus. */ + /** + * Static value Deprovisioning for BareMetalMachineDetailedStatus. + */ public static final BareMetalMachineDetailedStatus DEPROVISIONING = fromString("Deprovisioning"); /** * Creates a new instance of BareMetalMachineDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public BareMetalMachineDetailedStatus() { /** * Creates or finds a BareMetalMachineDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineDetailedStatus. */ - @JsonCreator public static BareMetalMachineDetailedStatus fromString(String name) { return fromString(name, BareMetalMachineDetailedStatus.class); } /** * Gets known BareMetalMachineDetailedStatus values. - * + * * @return known BareMetalMachineDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java index a147cbddce18b..fa3b1f4cd16a0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. */ +/** + * The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. + */ public final class BareMetalMachineEvacuate extends ExpandableStringEnum { - /** Static value True for BareMetalMachineEvacuate. */ + /** + * Static value True for BareMetalMachineEvacuate. + */ public static final BareMetalMachineEvacuate TRUE = fromString("True"); - /** Static value False for BareMetalMachineEvacuate. */ + /** + * Static value False for BareMetalMachineEvacuate. + */ public static final BareMetalMachineEvacuate FALSE = fromString("False"); /** * Creates a new instance of BareMetalMachineEvacuate value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BareMetalMachineEvacuate() { /** * Creates or finds a BareMetalMachineEvacuate from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineEvacuate. */ - @JsonCreator public static BareMetalMachineEvacuate fromString(String name) { return fromString(name, BareMetalMachineEvacuate.class); } /** * Gets known BareMetalMachineEvacuate values. - * + * * @return known BareMetalMachineEvacuate values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java index 793edda4d041f..09226d4d752f2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The outcome of the hardware validation. */ +/** + * The outcome of the hardware validation. + */ public final class BareMetalMachineHardwareValidationResult extends ExpandableStringEnum { - /** Static value Pass for BareMetalMachineHardwareValidationResult. */ + /** + * Static value Pass for BareMetalMachineHardwareValidationResult. + */ public static final BareMetalMachineHardwareValidationResult PASS = fromString("Pass"); - /** Static value Fail for BareMetalMachineHardwareValidationResult. */ + /** + * Static value Fail for BareMetalMachineHardwareValidationResult. + */ public static final BareMetalMachineHardwareValidationResult FAIL = fromString("Fail"); /** * Creates a new instance of BareMetalMachineHardwareValidationResult value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public BareMetalMachineHardwareValidationResult() { /** * Creates or finds a BareMetalMachineHardwareValidationResult from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineHardwareValidationResult. */ - @JsonCreator public static BareMetalMachineHardwareValidationResult fromString(String name) { return fromString(name, BareMetalMachineHardwareValidationResult.class); } /** * Gets known BareMetalMachineHardwareValidationResult values. - * + * * @return known BareMetalMachineHardwareValidationResult values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java index 9172e5323bfd2..b44a976c5cdce 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java @@ -12,56 +12,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of BareMetalMachineKeySet. */ +/** + * An immutable client-side representation of BareMetalMachineKeySet. + */ public interface BareMetalMachineKeySet { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -69,21 +68,21 @@ public interface BareMetalMachineKeySet { /** * Gets the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ String azureGroupId(); /** * Gets the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ BareMetalMachineKeySetDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -91,7 +90,7 @@ public interface BareMetalMachineKeySet { /** * Gets the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @return the expiration value. */ OffsetDateTime expiration(); @@ -99,14 +98,14 @@ public interface BareMetalMachineKeySet { /** * Gets the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @return the jumpHostsAllowed value. */ List jumpHostsAllowed(); /** * Gets the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ OffsetDateTime lastValidation(); @@ -114,85 +113,93 @@ public interface BareMetalMachineKeySet { /** * Gets the osGroupName property: The name of the group that users will be assigned to on the operating system of * the machines. - * + * * @return the osGroupName value. */ String osGroupName(); /** * Gets the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ BareMetalMachineKeySetPrivilegeLevel privilegeLevel(); /** * Gets the provisioningState property: The provisioning state of the bare metal machine key set. - * + * * @return the provisioningState value. */ BareMetalMachineKeySetProvisioningState provisioningState(); /** * Gets the userList property: The unique list of permitted users. - * + * * @return the userList value. */ List userList(); /** * Gets the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ List userListStatus(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner object. - * + * * @return the inner object. */ BareMetalMachineKeySetInner innerModel(); - /** The entirety of the BareMetalMachineKeySet definition. */ + /** + * The entirety of the BareMetalMachineKeySet definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAzureGroupId, DefinitionStages.WithExpiration, DefinitionStages.WithJumpHostsAllowed, DefinitionStages.WithPrivilegeLevel, DefinitionStages.WithUserList, DefinitionStages.WithCreate { } - /** The BareMetalMachineKeySet definition stages. */ + /** + * The BareMetalMachineKeySet definition stages. + */ interface DefinitionStages { - /** The first stage of the BareMetalMachineKeySet definition. */ + /** + * The first stage of the BareMetalMachineKeySet definition. + */ interface Blank extends WithLocation { } - /** The stage of the BareMetalMachineKeySet definition allowing to specify location. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -200,18 +207,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify parent resource. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, clusterName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @return the next definition stage. @@ -219,77 +228,85 @@ interface WithParentResource { WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify extendedLocation. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithAzureGroupId withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify azureGroupId. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify azureGroupId. + */ interface WithAzureGroupId { /** * Specifies the azureGroupId property: The object ID of Azure Active Directory group that all users in the * list must be in for access to be granted. Users that are not in the group will not have access.. - * + * * @param azureGroupId The object ID of Azure Active Directory group that all users in the list must be in - * for access to be granted. Users that are not in the group will not have access. + * for access to be granted. Users that are not in the group will not have access. * @return the next definition stage. */ WithExpiration withAzureGroupId(String azureGroupId); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify expiration. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the users in this key set will be * removed from the bare metal machines.. - * + * * @param expiration The date and time after which the users in this key set will be removed from the bare - * metal machines. + * metal machines. * @return the next definition stage. */ WithJumpHostsAllowed withExpiration(OffsetDateTime expiration); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify jumpHostsAllowed. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify jumpHostsAllowed. + */ interface WithJumpHostsAllowed { /** * Specifies the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network * access from which a login will be allowed for the users.. - * + * * @param jumpHostsAllowed The list of IP addresses of jump hosts with management network access from which - * a login will be allowed for the users. + * a login will be allowed for the users. * @return the next definition stage. */ WithPrivilegeLevel withJumpHostsAllowed(List jumpHostsAllowed); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify privilegeLevel. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify privilegeLevel. + */ interface WithPrivilegeLevel { /** * Specifies the privilegeLevel property: The access level allowed for the users in this key set.. - * + * * @param privilegeLevel The access level allowed for the users in this key set. * @return the next definition stage. */ WithUserList withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel privilegeLevel); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify userList. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify userList. + */ interface WithUserList { /** * Specifies the userList property: The unique list of permitted users.. - * + * * @param userList The unique list of permitted users. * @return the next definition stage. */ @@ -303,39 +320,43 @@ interface WithUserList { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithOsGroupName { /** * Executes the create request. - * + * * @return the created resource. */ BareMetalMachineKeySet create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ BareMetalMachineKeySet create(Context context); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify tags. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the BareMetalMachineKeySet definition allowing to specify osGroupName. */ + /** + * The stage of the BareMetalMachineKeySet definition allowing to specify osGroupName. + */ interface WithOsGroupName { /** * Specifies the osGroupName property: The name of the group that users will be assigned to on the operating * system of the machines.. - * + * * @param osGroupName The name of the group that users will be assigned to on the operating system of the - * machines. + * machines. * @return the next definition stage. */ WithCreate withOsGroupName(String osGroupName); @@ -344,74 +365,86 @@ interface WithOsGroupName { /** * Begins update for the BareMetalMachineKeySet resource. - * + * * @return the stage of resource update. */ BareMetalMachineKeySet.Update update(); - /** The template for BareMetalMachineKeySet update. */ + /** + * The template for BareMetalMachineKeySet update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithExpiration, UpdateStages.WithJumpHostsAllowed, UpdateStages.WithUserList { /** * Executes the update request. - * + * * @return the updated resource. */ BareMetalMachineKeySet apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ BareMetalMachineKeySet apply(Context context); } - /** The BareMetalMachineKeySet update stages. */ + /** + * The BareMetalMachineKeySet update stages. + */ interface UpdateStages { - /** The stage of the BareMetalMachineKeySet update allowing to specify tags. */ + /** + * The stage of the BareMetalMachineKeySet update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the BareMetalMachineKeySet update allowing to specify expiration. */ + /** + * The stage of the BareMetalMachineKeySet update allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the users in this key set will be * removed from the bare metal machines.. - * + * * @param expiration The date and time after which the users in this key set will be removed from the bare - * metal machines. + * metal machines. * @return the next definition stage. */ Update withExpiration(OffsetDateTime expiration); } - /** The stage of the BareMetalMachineKeySet update allowing to specify jumpHostsAllowed. */ + /** + * The stage of the BareMetalMachineKeySet update allowing to specify jumpHostsAllowed. + */ interface WithJumpHostsAllowed { /** * Specifies the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network * access from which a login will be allowed for the users.. - * + * * @param jumpHostsAllowed The list of IP addresses of jump hosts with management network access from which - * a login will be allowed for the users. + * a login will be allowed for the users. * @return the next definition stage. */ Update withJumpHostsAllowed(List jumpHostsAllowed); } - /** The stage of the BareMetalMachineKeySet update allowing to specify userList. */ + /** + * The stage of the BareMetalMachineKeySet update allowing to specify userList. + */ interface WithUserList { /** * Specifies the userList property: The unique list of permitted users.. - * + * * @param userList The unique list of permitted users. * @return the next definition stage. */ @@ -421,14 +454,14 @@ interface WithUserList { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ BareMetalMachineKeySet refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java index ceb46be6531ab..5c816c0483b5c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the key set. */ +/** + * The more detailed status of the key set. + */ public final class BareMetalMachineKeySetDetailedStatus extends ExpandableStringEnum { - /** Static value AllActive for BareMetalMachineKeySetDetailedStatus. */ + /** + * Static value AllActive for BareMetalMachineKeySetDetailedStatus. + */ public static final BareMetalMachineKeySetDetailedStatus ALL_ACTIVE = fromString("AllActive"); - /** Static value SomeInvalid for BareMetalMachineKeySetDetailedStatus. */ + /** + * Static value SomeInvalid for BareMetalMachineKeySetDetailedStatus. + */ public static final BareMetalMachineKeySetDetailedStatus SOME_INVALID = fromString("SomeInvalid"); - /** Static value AllInvalid for BareMetalMachineKeySetDetailedStatus. */ + /** + * Static value AllInvalid for BareMetalMachineKeySetDetailedStatus. + */ public static final BareMetalMachineKeySetDetailedStatus ALL_INVALID = fromString("AllInvalid"); - /** Static value Validating for BareMetalMachineKeySetDetailedStatus. */ + /** + * Static value Validating for BareMetalMachineKeySetDetailedStatus. + */ public static final BareMetalMachineKeySetDetailedStatus VALIDATING = fromString("Validating"); /** * Creates a new instance of BareMetalMachineKeySetDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public BareMetalMachineKeySetDetailedStatus() { /** * Creates or finds a BareMetalMachineKeySetDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineKeySetDetailedStatus. */ - @JsonCreator public static BareMetalMachineKeySetDetailedStatus fromString(String name) { return fromString(name, BareMetalMachineKeySetDetailedStatus.class); } /** * Gets known BareMetalMachineKeySetDetailedStatus values. - * + * * @return known BareMetalMachineKeySetDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java index d497b6d53cea3..315661377b05d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BareMetalMachineKeySetInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** BareMetalMachineKeySetList represents a list of bare metal machine key sets. */ +/** + * BareMetalMachineKeySetList represents a list of bare metal machine key sets. + */ @Fluent -public final class BareMetalMachineKeySetList { +public final class BareMetalMachineKeySetList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of bare metal machine key sets. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of BareMetalMachineKeySetList class. */ + /** + * Creates an instance of BareMetalMachineKeySetList class. + */ public BareMetalMachineKeySetList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the BareMetalMachineKeySetList object itself. */ @@ -50,7 +56,7 @@ public BareMetalMachineKeySetList withNextLink(String nextLink) { /** * Get the value property: The list of bare metal machine key sets. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of bare metal machine key sets. - * + * * @param value the value value to set. * @return the BareMetalMachineKeySetList object itself. */ @@ -70,7 +76,7 @@ public BareMetalMachineKeySetList withValue(List va /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineKeySetList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineKeySetList 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 BareMetalMachineKeySetList. + */ + public static BareMetalMachineKeySetList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineKeySetList deserializedBareMetalMachineKeySetList = new BareMetalMachineKeySetList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedBareMetalMachineKeySetList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BareMetalMachineKeySetInner.fromJson(reader1)); + deserializedBareMetalMachineKeySetList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineKeySetList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java index d23bed6d155da..3101203dcc4ea 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BareMetalMachineKeySetPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. */ +/** + * BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + */ @Fluent -public final class BareMetalMachineKeySetPatchParameters { +public final class BareMetalMachineKeySetPatchParameters + implements JsonSerializable { /* - * BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be - * patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private BareMetalMachineKeySetPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of BareMetalMachineKeySetPatchParameters class. */ + /** + * Creates an instance of BareMetalMachineKeySetPatchParameters class. + */ public BareMetalMachineKeySetPatchParameters() { } /** - * Get the innerProperties property: BareMetalMachineKeySetPatchProperties represents the properties of bare metal - * machine key set that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BareMetalMachineKeySetPatchProperties innerProperties() { @@ -49,7 +48,7 @@ private BareMetalMachineKeySetPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -58,7 +57,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the BareMetalMachineKeySetPatchParameters object itself. */ @@ -70,7 +69,7 @@ public BareMetalMachineKeySetPatchParameters withTags(Map tags) /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -80,7 +79,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * bare metal machines. - * + * * @param expiration the expiration value to set. * @return the BareMetalMachineKeySetPatchParameters object itself. */ @@ -95,7 +94,7 @@ public BareMetalMachineKeySetPatchParameters withExpiration(OffsetDateTime expir /** * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @return the jumpHostsAllowed value. */ public List jumpHostsAllowed() { @@ -105,7 +104,7 @@ public List jumpHostsAllowed() { /** * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from * which a login will be allowed for the users. - * + * * @param jumpHostsAllowed the jumpHostsAllowed value to set. * @return the BareMetalMachineKeySetPatchParameters object itself. */ @@ -119,7 +118,7 @@ public BareMetalMachineKeySetPatchParameters withJumpHostsAllowed(List j /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -128,7 +127,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BareMetalMachineKeySetPatchParameters object itself. */ @@ -142,7 +141,7 @@ public BareMetalMachineKeySetPatchParameters withUserList(List userL /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -150,4 +149,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineKeySetPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineKeySetPatchParameters 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 BareMetalMachineKeySetPatchParameters. + */ + public static BareMetalMachineKeySetPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineKeySetPatchParameters deserializedBareMetalMachineKeySetPatchParameters + = new BareMetalMachineKeySetPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedBareMetalMachineKeySetPatchParameters.innerProperties + = BareMetalMachineKeySetPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBareMetalMachineKeySetPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineKeySetPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java index e749bc11e931c..4616ab3f3286f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The access level allowed for the users in this key set. */ +/** + * The access level allowed for the users in this key set. + */ public final class BareMetalMachineKeySetPrivilegeLevel extends ExpandableStringEnum { - /** Static value Standard for BareMetalMachineKeySetPrivilegeLevel. */ + /** + * Static value Standard for BareMetalMachineKeySetPrivilegeLevel. + */ public static final BareMetalMachineKeySetPrivilegeLevel STANDARD = fromString("Standard"); - /** Static value Superuser for BareMetalMachineKeySetPrivilegeLevel. */ + /** + * Static value Superuser for BareMetalMachineKeySetPrivilegeLevel. + */ public static final BareMetalMachineKeySetPrivilegeLevel SUPERUSER = fromString("Superuser"); /** * Creates a new instance of BareMetalMachineKeySetPrivilegeLevel value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public BareMetalMachineKeySetPrivilegeLevel() { /** * Creates or finds a BareMetalMachineKeySetPrivilegeLevel from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineKeySetPrivilegeLevel. */ - @JsonCreator public static BareMetalMachineKeySetPrivilegeLevel fromString(String name) { return fromString(name, BareMetalMachineKeySetPrivilegeLevel.class); } /** * Gets known BareMetalMachineKeySetPrivilegeLevel values. - * + * * @return known BareMetalMachineKeySetPrivilegeLevel values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java index 217b2bc5b7bd4..ad325c06daa56 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the bare metal machine key set. */ +/** + * The provisioning state of the bare metal machine key set. + */ public final class BareMetalMachineKeySetProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for BareMetalMachineKeySetProvisioningState. */ + /** + * Static value Succeeded for BareMetalMachineKeySetProvisioningState. + */ public static final BareMetalMachineKeySetProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for BareMetalMachineKeySetProvisioningState. */ + /** + * Static value Failed for BareMetalMachineKeySetProvisioningState. + */ public static final BareMetalMachineKeySetProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for BareMetalMachineKeySetProvisioningState. */ + /** + * Static value Canceled for BareMetalMachineKeySetProvisioningState. + */ public static final BareMetalMachineKeySetProvisioningState CANCELED = fromString("Canceled"); - /** Static value Accepted for BareMetalMachineKeySetProvisioningState. */ + /** + * Static value Accepted for BareMetalMachineKeySetProvisioningState. + */ public static final BareMetalMachineKeySetProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Provisioning for BareMetalMachineKeySetProvisioningState. */ + /** + * Static value Provisioning for BareMetalMachineKeySetProvisioningState. + */ public static final BareMetalMachineKeySetProvisioningState PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of BareMetalMachineKeySetProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public BareMetalMachineKeySetProvisioningState() { /** * Creates or finds a BareMetalMachineKeySetProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineKeySetProvisioningState. */ - @JsonCreator public static BareMetalMachineKeySetProvisioningState fromString(String name) { return fromString(name, BareMetalMachineKeySetProvisioningState.class); } /** * Gets known BareMetalMachineKeySetProvisioningState values. - * + * * @return known BareMetalMachineKeySetProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java index 618b3f1819528..6143cfb163f10 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the user is currently deployed for access. */ +/** + * The indicator of whether the user is currently deployed for access. + */ public final class BareMetalMachineKeySetUserSetupStatus extends ExpandableStringEnum { - /** Static value Active for BareMetalMachineKeySetUserSetupStatus. */ + /** + * Static value Active for BareMetalMachineKeySetUserSetupStatus. + */ public static final BareMetalMachineKeySetUserSetupStatus ACTIVE = fromString("Active"); - /** Static value Invalid for BareMetalMachineKeySetUserSetupStatus. */ + /** + * Static value Invalid for BareMetalMachineKeySetUserSetupStatus. + */ public static final BareMetalMachineKeySetUserSetupStatus INVALID = fromString("Invalid"); /** * Creates a new instance of BareMetalMachineKeySetUserSetupStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public BareMetalMachineKeySetUserSetupStatus() { /** * Creates or finds a BareMetalMachineKeySetUserSetupStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineKeySetUserSetupStatus. */ - @JsonCreator public static BareMetalMachineKeySetUserSetupStatus fromString(String name) { return fromString(name, BareMetalMachineKeySetUserSetupStatus.class); } /** * Gets known BareMetalMachineKeySetUserSetupStatus values. - * + * * @return known BareMetalMachineKeySetUserSetupStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java index 90a691449e6dc..cbf98f298af27 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java @@ -8,44 +8,46 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BareMetalMachineKeySets. */ +/** + * Resource collection API of BareMetalMachineKeySets. + */ public interface BareMetalMachineKeySets { /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List bare metal machine key sets of the cluster. - * - *

Get a list of bare metal machine key sets for the provided cluster. - * + * + * Get a list of bare metal machine key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machine key sets for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machine key sets for the provided cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -60,9 +62,9 @@ Response getWithResponse(String resourceGroupName, Strin /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -75,23 +77,24 @@ Response getWithResponse(String resourceGroupName, Strin /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + OperationStatusResult delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bareMetalMachineKeySetName The name of the bare metal machine key set. @@ -99,14 +102,16 @@ Response getWithResponse(String resourceGroupName, Strin * @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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + OperationStatusResult delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, + Context context); /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -117,9 +122,9 @@ Response getWithResponse(String resourceGroupName, Strin /** * Retrieve the bare metal machine key set of the cluster. - * - *

Get bare metal machine key set of the provided cluster. - * + * + * Get bare metal machine key set of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,32 +136,34 @@ Response getWithResponse(String resourceGroupName, Strin /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the bare metal machine key set of the cluster. - * - *

Delete the bare metal machine key set of the provided cluster. - * + * + * Delete the bare metal machine key set of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new BareMetalMachineKeySet resource. - * + * * @param name resource name. * @return the first stage of the new BareMetalMachineKeySet definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java index b9b0db1d91dec..4938d6a6296ac 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BareMetalMachineInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** BareMetalMachineList represents a list of bare metal machines. */ +/** + * BareMetalMachineList represents a list of bare metal machines. + */ @Fluent -public final class BareMetalMachineList { +public final class BareMetalMachineList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of bare metal machines. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of BareMetalMachineList class. */ + /** + * Creates an instance of BareMetalMachineList class. + */ public BareMetalMachineList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the BareMetalMachineList object itself. */ @@ -50,7 +56,7 @@ public BareMetalMachineList withNextLink(String nextLink) { /** * Get the value property: The list of bare metal machines. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of bare metal machines. - * + * * @param value the value value to set. * @return the BareMetalMachineList object itself. */ @@ -70,7 +76,7 @@ public BareMetalMachineList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineList 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 BareMetalMachineList. + */ + public static BareMetalMachineList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineList deserializedBareMetalMachineList = new BareMetalMachineList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedBareMetalMachineList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BareMetalMachineInner.fromJson(reader1)); + deserializedBareMetalMachineList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java index e0a85d08f8b6f..03d2a07335897 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java @@ -5,39 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BareMetalMachinePatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. */ +/** + * BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + */ @Fluent -public final class BareMetalMachinePatchParameters { +public final class BareMetalMachinePatchParameters implements JsonSerializable { /* - * BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private BareMetalMachinePatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of BareMetalMachinePatchParameters class. */ + /** + * Creates an instance of BareMetalMachinePatchParameters class. + */ public BareMetalMachinePatchParameters() { } /** - * Get the innerProperties property: BareMetalMachinePatchProperties represents the properties of the bare metal - * machine that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BareMetalMachinePatchProperties innerProperties() { @@ -46,7 +45,7 @@ private BareMetalMachinePatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the BareMetalMachinePatchParameters object itself. */ @@ -65,9 +64,9 @@ public BareMetalMachinePatchParameters withTags(Map tags) { } /** - * Get the machineDetails property: The details provided by the customer during the creation of rack manifests that - * allows for custom data to be associated with this machine. - * + * Get the machineDetails property: The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + * * @return the machineDetails value. */ public String machineDetails() { @@ -75,9 +74,9 @@ public String machineDetails() { } /** - * Set the machineDetails property: The details provided by the customer during the creation of rack manifests that - * allows for custom data to be associated with this machine. - * + * Set the machineDetails property: The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + * * @param machineDetails the machineDetails value to set. * @return the BareMetalMachinePatchParameters object itself. */ @@ -91,7 +90,7 @@ public BareMetalMachinePatchParameters withMachineDetails(String machineDetails) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -99,4 +98,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachinePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachinePatchParameters 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 BareMetalMachinePatchParameters. + */ + public static BareMetalMachinePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachinePatchParameters deserializedBareMetalMachinePatchParameters + = new BareMetalMachinePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedBareMetalMachinePatchParameters.innerProperties + = BareMetalMachinePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBareMetalMachinePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachinePatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java index da8123c312517..29afa40b99848 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. */ +/** + * BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. + */ @Fluent -public final class BareMetalMachinePowerOffParameters { +public final class BareMetalMachinePowerOffParameters implements JsonSerializable { /* * The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. */ - @JsonProperty(value = "skipShutdown") private BareMetalMachineSkipShutdown skipShutdown; - /** Creates an instance of BareMetalMachinePowerOffParameters class. */ + /** + * Creates an instance of BareMetalMachinePowerOffParameters class. + */ public BareMetalMachinePowerOffParameters() { } /** * Get the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the bare * metal machine immediately. - * + * * @return the skipShutdown value. */ public BareMetalMachineSkipShutdown skipShutdown() { @@ -33,7 +40,7 @@ public BareMetalMachineSkipShutdown skipShutdown() { /** * Set the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the bare * metal machine immediately. - * + * * @param skipShutdown the skipShutdown value to set. * @return the BareMetalMachinePowerOffParameters object itself. */ @@ -44,9 +51,47 @@ public BareMetalMachinePowerOffParameters withSkipShutdown(BareMetalMachineSkipS /** * 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("skipShutdown", this.skipShutdown == null ? null : this.skipShutdown.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachinePowerOffParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachinePowerOffParameters 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 BareMetalMachinePowerOffParameters. + */ + public static BareMetalMachinePowerOffParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachinePowerOffParameters deserializedBareMetalMachinePowerOffParameters + = new BareMetalMachinePowerOffParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skipShutdown".equals(fieldName)) { + deserializedBareMetalMachinePowerOffParameters.skipShutdown + = BareMetalMachineSkipShutdown.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachinePowerOffParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java index eaeecffed4e17..9e7d4f3abfc0e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The power state derived from the baseboard management controller. */ +/** + * The power state derived from the baseboard management controller. + */ public final class BareMetalMachinePowerState extends ExpandableStringEnum { - /** Static value On for BareMetalMachinePowerState. */ + /** + * Static value On for BareMetalMachinePowerState. + */ public static final BareMetalMachinePowerState ON = fromString("On"); - /** Static value Off for BareMetalMachinePowerState. */ + /** + * Static value Off for BareMetalMachinePowerState. + */ public static final BareMetalMachinePowerState OFF = fromString("Off"); /** * Creates a new instance of BareMetalMachinePowerState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BareMetalMachinePowerState() { /** * Creates or finds a BareMetalMachinePowerState from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachinePowerState. */ - @JsonCreator public static BareMetalMachinePowerState fromString(String name) { return fromString(name, BareMetalMachinePowerState.class); } /** * Gets known BareMetalMachinePowerState values. - * + * * @return known BareMetalMachinePowerState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java index ccbd521e81451..55a16c1bbceb8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the bare metal machine. */ +/** + * The provisioning state of the bare metal machine. + */ public final class BareMetalMachineProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for BareMetalMachineProvisioningState. */ + /** + * Static value Succeeded for BareMetalMachineProvisioningState. + */ public static final BareMetalMachineProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for BareMetalMachineProvisioningState. */ + /** + * Static value Failed for BareMetalMachineProvisioningState. + */ public static final BareMetalMachineProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for BareMetalMachineProvisioningState. */ + /** + * Static value Canceled for BareMetalMachineProvisioningState. + */ public static final BareMetalMachineProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for BareMetalMachineProvisioningState. */ + /** + * Static value Provisioning for BareMetalMachineProvisioningState. + */ public static final BareMetalMachineProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for BareMetalMachineProvisioningState. */ + /** + * Static value Accepted for BareMetalMachineProvisioningState. + */ public static final BareMetalMachineProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of BareMetalMachineProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public BareMetalMachineProvisioningState() { /** * Creates or finds a BareMetalMachineProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineProvisioningState. */ - @JsonCreator public static BareMetalMachineProvisioningState fromString(String name) { return fromString(name, BareMetalMachineProvisioningState.class); } /** * Gets known BareMetalMachineProvisioningState values. - * + * * @return known BareMetalMachineProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java index 4916dbf762367..1acbfe881d370 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the bare metal machine is ready to receive workloads. */ +/** + * The indicator of whether the bare metal machine is ready to receive workloads. + */ public final class BareMetalMachineReadyState extends ExpandableStringEnum { - /** Static value True for BareMetalMachineReadyState. */ + /** + * Static value True for BareMetalMachineReadyState. + */ public static final BareMetalMachineReadyState TRUE = fromString("True"); - /** Static value False for BareMetalMachineReadyState. */ + /** + * Static value False for BareMetalMachineReadyState. + */ public static final BareMetalMachineReadyState FALSE = fromString("False"); /** * Creates a new instance of BareMetalMachineReadyState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BareMetalMachineReadyState() { /** * Creates or finds a BareMetalMachineReadyState from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineReadyState. */ - @JsonCreator public static BareMetalMachineReadyState fromString(String name) { return fromString(name, BareMetalMachineReadyState.class); } /** * Gets known BareMetalMachineReadyState values. - * + * * @return known BareMetalMachineReadyState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java index a64f4cdbca9dd..c88b6f4e6f85d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java @@ -5,57 +5,57 @@ package com.azure.resourcemanager.networkcloud.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; /** * BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for * another. */ @Fluent -public final class BareMetalMachineReplaceParameters { +public final class BareMetalMachineReplaceParameters implements JsonSerializable { /* - * AdministrativeCredentials represents the admin credentials for the device requiring password-based - * authentication. - * - * The credentials of the baseboard management controller on this bare metal machine. + * The credentials of the baseboard management controller on this bare metal machine. The password field is expected + * to be an Azure Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the + * secret archive settings, the actual password value should be provided instead. */ - @JsonProperty(value = "bmcCredentials") private AdministrativeCredentials bmcCredentials; /* * The MAC address of the BMC device. */ - @JsonProperty(value = "bmcMacAddress") private String bmcMacAddress; /* * The MAC address of a NIC connected to the PXE network. */ - @JsonProperty(value = "bootMacAddress") private String bootMacAddress; /* * The OS-level hostname assigned to this machine. */ - @JsonProperty(value = "machineName") private String machineName; /* * The serial number of the bare metal machine. */ - @JsonProperty(value = "serialNumber") private String serialNumber; - /** Creates an instance of BareMetalMachineReplaceParameters class. */ + /** + * Creates an instance of BareMetalMachineReplaceParameters class. + */ public BareMetalMachineReplaceParameters() { } /** - * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Get the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. The password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to + * utilize managed identity by setting the secret archive settings, the actual password value should be provided + * instead. + * * @return the bmcCredentials value. */ public AdministrativeCredentials bmcCredentials() { @@ -63,11 +63,11 @@ public AdministrativeCredentials bmcCredentials() { } /** - * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the baseboard management controller on this bare metal machine. - * + * Set the bmcCredentials property: The credentials of the baseboard management controller on this bare metal + * machine. The password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to + * utilize managed identity by setting the secret archive settings, the actual password value should be provided + * instead. + * * @param bmcCredentials the bmcCredentials value to set. * @return the BareMetalMachineReplaceParameters object itself. */ @@ -78,7 +78,7 @@ public BareMetalMachineReplaceParameters withBmcCredentials(AdministrativeCreden /** * Get the bmcMacAddress property: The MAC address of the BMC device. - * + * * @return the bmcMacAddress value. */ public String bmcMacAddress() { @@ -87,7 +87,7 @@ public String bmcMacAddress() { /** * Set the bmcMacAddress property: The MAC address of the BMC device. - * + * * @param bmcMacAddress the bmcMacAddress value to set. * @return the BareMetalMachineReplaceParameters object itself. */ @@ -98,7 +98,7 @@ public BareMetalMachineReplaceParameters withBmcMacAddress(String bmcMacAddress) /** * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @return the bootMacAddress value. */ public String bootMacAddress() { @@ -107,7 +107,7 @@ public String bootMacAddress() { /** * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. - * + * * @param bootMacAddress the bootMacAddress value to set. * @return the BareMetalMachineReplaceParameters object itself. */ @@ -118,7 +118,7 @@ public BareMetalMachineReplaceParameters withBootMacAddress(String bootMacAddres /** * Get the machineName property: The OS-level hostname assigned to this machine. - * + * * @return the machineName value. */ public String machineName() { @@ -127,7 +127,7 @@ public String machineName() { /** * Set the machineName property: The OS-level hostname assigned to this machine. - * + * * @param machineName the machineName value to set. * @return the BareMetalMachineReplaceParameters object itself. */ @@ -138,7 +138,7 @@ public BareMetalMachineReplaceParameters withMachineName(String machineName) { /** * Get the serialNumber property: The serial number of the bare metal machine. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -147,7 +147,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number of the bare metal machine. - * + * * @param serialNumber the serialNumber value to set. * @return the BareMetalMachineReplaceParameters object itself. */ @@ -158,7 +158,7 @@ public BareMetalMachineReplaceParameters withSerialNumber(String serialNumber) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -166,4 +166,54 @@ public void validate() { bmcCredentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bmcCredentials", this.bmcCredentials); + jsonWriter.writeStringField("bmcMacAddress", this.bmcMacAddress); + jsonWriter.writeStringField("bootMacAddress", this.bootMacAddress); + jsonWriter.writeStringField("machineName", this.machineName); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineReplaceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineReplaceParameters 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 BareMetalMachineReplaceParameters. + */ + public static BareMetalMachineReplaceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineReplaceParameters deserializedBareMetalMachineReplaceParameters + = new BareMetalMachineReplaceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bmcCredentials".equals(fieldName)) { + deserializedBareMetalMachineReplaceParameters.bmcCredentials + = AdministrativeCredentials.fromJson(reader); + } else if ("bmcMacAddress".equals(fieldName)) { + deserializedBareMetalMachineReplaceParameters.bmcMacAddress = reader.getString(); + } else if ("bootMacAddress".equals(fieldName)) { + deserializedBareMetalMachineReplaceParameters.bootMacAddress = reader.getString(); + } else if ("machineName".equals(fieldName)) { + deserializedBareMetalMachineReplaceParameters.machineName = reader.getString(); + } else if ("serialNumber".equals(fieldName)) { + deserializedBareMetalMachineReplaceParameters.serialNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineReplaceParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java index e15a07f2a930e..a88976c2f4721 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java @@ -6,7 +6,11 @@ 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; /** @@ -14,11 +18,11 @@ * machine. */ @Fluent -public final class BareMetalMachineRunCommandParameters { +public final class BareMetalMachineRunCommandParameters + implements JsonSerializable { /* * The list of string arguments that will be passed to the script in order as separate arguments. */ - @JsonProperty(value = "arguments") private List arguments; /* @@ -26,23 +30,23 @@ public final class BareMetalMachineRunCommandParameters { * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be * captured, and the exit code matching a timeout will be returned (252). */ - @JsonProperty(value = "limitTimeSeconds", required = true) private long limitTimeSeconds; /* * The base64 encoded script to execute on the bare metal machine. */ - @JsonProperty(value = "script", required = true) private String script; - /** Creates an instance of BareMetalMachineRunCommandParameters class. */ + /** + * Creates an instance of BareMetalMachineRunCommandParameters class. + */ public BareMetalMachineRunCommandParameters() { } /** * Get the arguments property: The list of string arguments that will be passed to the script in order as separate * arguments. - * + * * @return the arguments value. */ public List arguments() { @@ -52,7 +56,7 @@ public List arguments() { /** * Set the arguments property: The list of string arguments that will be passed to the script in order as separate * arguments. - * + * * @param arguments the arguments value to set. * @return the BareMetalMachineRunCommandParameters object itself. */ @@ -62,10 +66,10 @@ public BareMetalMachineRunCommandParameters withArguments(List arguments } /** - * Get the limitTimeSeconds property: The maximum time the script is allowed to run. If the execution time exceeds - * the maximum, the script will be stopped, any output produced until then will be captured, and the exit code - * matching a timeout will be returned (252). - * + * Get the limitTimeSeconds property: The maximum time the script is allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + * * @return the limitTimeSeconds value. */ public long limitTimeSeconds() { @@ -73,10 +77,10 @@ public long limitTimeSeconds() { } /** - * Set the limitTimeSeconds property: The maximum time the script is allowed to run. If the execution time exceeds - * the maximum, the script will be stopped, any output produced until then will be captured, and the exit code - * matching a timeout will be returned (252). - * + * Set the limitTimeSeconds property: The maximum time the script is allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + * * @param limitTimeSeconds the limitTimeSeconds value to set. * @return the BareMetalMachineRunCommandParameters object itself. */ @@ -87,7 +91,7 @@ public BareMetalMachineRunCommandParameters withLimitTimeSeconds(long limitTimeS /** * Get the script property: The base64 encoded script to execute on the bare metal machine. - * + * * @return the script value. */ public String script() { @@ -96,7 +100,7 @@ public String script() { /** * Set the script property: The base64 encoded script to execute on the bare metal machine. - * + * * @param script the script value to set. * @return the BareMetalMachineRunCommandParameters object itself. */ @@ -107,15 +111,61 @@ public BareMetalMachineRunCommandParameters withScript(String script) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (script() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property script in model BareMetalMachineRunCommandParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property script in model BareMetalMachineRunCommandParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunCommandParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("limitTimeSeconds", this.limitTimeSeconds); + jsonWriter.writeStringField("script", this.script); + jsonWriter.writeArrayField("arguments", this.arguments, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineRunCommandParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineRunCommandParameters 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 BareMetalMachineRunCommandParameters. + */ + public static BareMetalMachineRunCommandParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineRunCommandParameters deserializedBareMetalMachineRunCommandParameters + = new BareMetalMachineRunCommandParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limitTimeSeconds".equals(fieldName)) { + deserializedBareMetalMachineRunCommandParameters.limitTimeSeconds = reader.getLong(); + } else if ("script".equals(fieldName)) { + deserializedBareMetalMachineRunCommandParameters.script = reader.getString(); + } else if ("arguments".equals(fieldName)) { + List arguments = reader.readArray(reader1 -> reader1.getString()); + deserializedBareMetalMachineRunCommandParameters.arguments = arguments; + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineRunCommandParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java index 11b520bc979a1..f50305d2b6555 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java @@ -6,7 +6,11 @@ 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; /** @@ -14,11 +18,11 @@ * commands to run on the bare metal machine. */ @Fluent -public final class BareMetalMachineRunDataExtractsParameters { +public final class BareMetalMachineRunDataExtractsParameters + implements JsonSerializable { /* * The list of curated data extraction commands to be executed directly against the target machine. */ - @JsonProperty(value = "commands", required = true) private List commands; /* @@ -26,17 +30,18 @@ public final class BareMetalMachineRunDataExtractsParameters { * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be * captured, and the exit code matching a timeout will be returned (252). */ - @JsonProperty(value = "limitTimeSeconds", required = true) private long limitTimeSeconds; - /** Creates an instance of BareMetalMachineRunDataExtractsParameters class. */ + /** + * Creates an instance of BareMetalMachineRunDataExtractsParameters class. + */ public BareMetalMachineRunDataExtractsParameters() { } /** * Get the commands property: The list of curated data extraction commands to be executed directly against the * target machine. - * + * * @return the commands value. */ public List commands() { @@ -46,7 +51,7 @@ public List commands() { /** * Set the commands property: The list of curated data extraction commands to be executed directly against the * target machine. - * + * * @param commands the commands value to set. * @return the BareMetalMachineRunDataExtractsParameters object itself. */ @@ -56,10 +61,10 @@ public BareMetalMachineRunDataExtractsParameters withCommands(List e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunDataExtractsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("commands", this.commands, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("limitTimeSeconds", this.limitTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineRunDataExtractsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineRunDataExtractsParameters 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 BareMetalMachineRunDataExtractsParameters. + */ + public static BareMetalMachineRunDataExtractsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineRunDataExtractsParameters deserializedBareMetalMachineRunDataExtractsParameters + = new BareMetalMachineRunDataExtractsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> BareMetalMachineCommandSpecification.fromJson(reader1)); + deserializedBareMetalMachineRunDataExtractsParameters.commands = commands; + } else if ("limitTimeSeconds".equals(fieldName)) { + deserializedBareMetalMachineRunDataExtractsParameters.limitTimeSeconds = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineRunDataExtractsParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java index 99988704155b9..48aaaf30fb1f0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java @@ -6,7 +6,11 @@ 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; /** @@ -14,11 +18,11 @@ * on the bare metal machine. */ @Fluent -public final class BareMetalMachineRunReadCommandsParameters { +public final class BareMetalMachineRunReadCommandsParameters + implements JsonSerializable { /* * The list of read-only commands to be executed directly against the target machine. */ - @JsonProperty(value = "commands", required = true) private List commands; /* @@ -26,16 +30,17 @@ public final class BareMetalMachineRunReadCommandsParameters { * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be * captured, and the exit code matching a timeout will be returned (252). */ - @JsonProperty(value = "limitTimeSeconds", required = true) private long limitTimeSeconds; - /** Creates an instance of BareMetalMachineRunReadCommandsParameters class. */ + /** + * Creates an instance of BareMetalMachineRunReadCommandsParameters class. + */ public BareMetalMachineRunReadCommandsParameters() { } /** * Get the commands property: The list of read-only commands to be executed directly against the target machine. - * + * * @return the commands value. */ public List commands() { @@ -44,7 +49,7 @@ public List commands() { /** * Set the commands property: The list of read-only commands to be executed directly against the target machine. - * + * * @param commands the commands value to set. * @return the BareMetalMachineRunReadCommandsParameters object itself. */ @@ -54,10 +59,10 @@ public BareMetalMachineRunReadCommandsParameters withCommands(List e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunReadCommandsParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("commands", this.commands, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("limitTimeSeconds", this.limitTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BareMetalMachineRunReadCommandsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BareMetalMachineRunReadCommandsParameters 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 BareMetalMachineRunReadCommandsParameters. + */ + public static BareMetalMachineRunReadCommandsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BareMetalMachineRunReadCommandsParameters deserializedBareMetalMachineRunReadCommandsParameters + = new BareMetalMachineRunReadCommandsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> BareMetalMachineCommandSpecification.fromJson(reader1)); + deserializedBareMetalMachineRunReadCommandsParameters.commands = commands; + } else if ("limitTimeSeconds".equals(fieldName)) { + deserializedBareMetalMachineRunReadCommandsParameters.limitTimeSeconds = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedBareMetalMachineRunReadCommandsParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java index fd04e88a89592..8d5a04052b8eb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. */ +/** + * The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. + */ public final class BareMetalMachineSkipShutdown extends ExpandableStringEnum { - /** Static value True for BareMetalMachineSkipShutdown. */ + /** + * Static value True for BareMetalMachineSkipShutdown. + */ public static final BareMetalMachineSkipShutdown TRUE = fromString("True"); - /** Static value False for BareMetalMachineSkipShutdown. */ + /** + * Static value False for BareMetalMachineSkipShutdown. + */ public static final BareMetalMachineSkipShutdown FALSE = fromString("False"); /** * Creates a new instance of BareMetalMachineSkipShutdown value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BareMetalMachineSkipShutdown() { /** * Creates or finds a BareMetalMachineSkipShutdown from its string representation. - * + * * @param name a name to look for. * @return the corresponding BareMetalMachineSkipShutdown. */ - @JsonCreator public static BareMetalMachineSkipShutdown fromString(String name) { return fromString(name, BareMetalMachineSkipShutdown.class); } /** * Gets known BareMetalMachineSkipShutdown values. - * + * * @return known BareMetalMachineSkipShutdown values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java index 428dabf48d6a0..7fb39f5878abc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BareMetalMachines. */ +/** + * Resource collection API of BareMetalMachines. + */ public interface BareMetalMachines { /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List bare metal machines in the subscription. - * - *

Get a list of bare metal machines in the provided subscription. - * + * + * Get a list of bare metal machines in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List bare metal machines in the resource group. - * - *

Get a list of bare metal machines in the provided resource group. - * + * + * Get a list of bare metal machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of bare metal machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of bare metal machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -83,9 +85,9 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,38 +99,40 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName); /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void delete(String resourceGroupName, String bareMetalMachineName, Context context); + OperationStatusResult delete(String resourceGroupName, String bareMetalMachineName, Context context); /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,9 +144,9 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Cordon the bare metal machine. - * - *

Cordon the provided bare metal machine's Kubernetes node. - * + * + * Cordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineCordonParameters The request body. @@ -157,9 +161,9 @@ OperationStatusResult cordon(String resourceGroupName, String bareMetalMachineNa /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -171,9 +175,9 @@ OperationStatusResult cordon(String resourceGroupName, String bareMetalMachineNa /** * Power off the bare metal machine. - * - *

Power off the provided bare metal machine. - * + * + * Power off the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachinePowerOffParameters The request body. @@ -188,9 +192,9 @@ OperationStatusResult powerOff(String resourceGroupName, String bareMetalMachine /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,9 +206,9 @@ OperationStatusResult powerOff(String resourceGroupName, String bareMetalMachine /** * Reimage the bare metal machine. - * - *

Reimage the provided bare metal machine. - * + * + * Reimage the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -217,9 +221,9 @@ OperationStatusResult powerOff(String resourceGroupName, String bareMetalMachine /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -231,9 +235,9 @@ OperationStatusResult powerOff(String resourceGroupName, String bareMetalMachine /** * Replace (service) the bare metal machine. - * - *

Replace the provided bare metal machine. - * + * + * Replace the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineReplaceParameters The request body. @@ -248,9 +252,9 @@ OperationStatusResult replace(String resourceGroupName, String bareMetalMachineN /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -262,9 +266,9 @@ OperationStatusResult replace(String resourceGroupName, String bareMetalMachineN /** * Restart the bare metal machine. - * - *

Restart the provided bare metal machine. - * + * + * Restart the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -277,10 +281,10 @@ OperationStatusResult replace(String resourceGroupName, String bareMetalMachineN /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -294,10 +298,10 @@ OperationStatusResult runCommand(String resourceGroupName, String bareMetalMachi /** * Run the command on the bare metal machine. - * - *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * + * Run the command or the script on the provided bare metal machine. The URL to storage account with the command * execution results and the command exit code can be retrieved from the operation status API once available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunCommandParameters The request body. @@ -312,11 +316,10 @@ OperationStatusResult runCommand(String resourceGroupName, String bareMetalMachi /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -330,11 +333,10 @@ OperationStatusResult runDataExtracts(String resourceGroupName, String bareMetal /** * Run data extraction for a bare metal machine. - * - *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the - * command execution results and the command exit code can be retrieved from the operation status API once - * available. - * + * + * Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunDataExtractsParameters The request body. @@ -349,11 +351,11 @@ OperationStatusResult runDataExtracts(String resourceGroupName, String bareMetal /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -367,11 +369,11 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Run read-only commands against a bare metal machine. - * - *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * + * Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the * command execution results and the command exit code can be retrieved from the operation status API once * available. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param bareMetalMachineRunReadCommandsParameters The request body. @@ -386,9 +388,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -400,9 +402,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Start the bare metal machine. - * - *

Start the provided bare metal machine. - * + * + * Start the provided bare metal machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -415,9 +417,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -429,9 +431,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Uncordon the bare metal machine. - * - *

Uncordon the provided bare metal machine's Kubernetes node. - * + * + * Uncordon the provided bare metal machine's Kubernetes node. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param bareMetalMachineName The name of the bare metal machine. * @param context The context to associate with this operation. @@ -444,9 +446,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -457,9 +459,9 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Retrieve the bare metal machine. - * - *

Get properties of the provided bare metal machine. - * + * + * Get properties of the provided bare metal machine. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -471,34 +473,36 @@ OperationStatusResult runReadCommands(String resourceGroupName, String bareMetal /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the bare metal machine. - * - *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided bare metal machine. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new BareMetalMachine resource. - * + * * @param name resource name. * @return the first stage of the new BareMetalMachine definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BfdEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BfdEnabled.java index b99976b1c62e5..6b2f662f1bbf9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BfdEnabled.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BfdEnabled.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator to determine if automatic allocation from the pool should occur. */ +/** + * The indicator to determine if automatic allocation from the pool should occur. + */ public final class BfdEnabled extends ExpandableStringEnum { - /** Static value True for BfdEnabled. */ + /** + * Static value True for BfdEnabled. + */ public static final BfdEnabled TRUE = fromString("True"); - /** Static value False for BfdEnabled. */ + /** + * Static value False for BfdEnabled. + */ public static final BfdEnabled FALSE = fromString("False"); /** * Creates a new instance of BfdEnabled value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BfdEnabled() { /** * Creates or finds a BfdEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding BfdEnabled. */ - @JsonCreator public static BfdEnabled fromString(String name) { return fromString(name, BfdEnabled.class); } /** * Gets known BfdEnabled values. - * + * * @return known BfdEnabled values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpAdvertisement.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpAdvertisement.java index 6e5ada16f60a5..492bc5d8e004a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpAdvertisement.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpAdvertisement.java @@ -6,47 +6,51 @@ 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; -/** BgpAdvertisement represents the association of IP address pools to the communities and peers. */ +/** + * BgpAdvertisement represents the association of IP address pools to the communities and peers. + */ @Fluent -public final class BgpAdvertisement { +public final class BgpAdvertisement implements JsonSerializable { /* * The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud * Cluster. This field is ignored if fabricPeeringEnabled is set to False. */ - @JsonProperty(value = "advertiseToFabric") private AdvertiseToFabric advertiseToFabric; /* * The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in * 1234:1234 format. */ - @JsonProperty(value = "communities") private List communities; /* * The names of the IP address pools associated with this announcement. */ - @JsonProperty(value = "ipAddressPools", required = true) private List ipAddressPools; /* - * The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will - * receive this advertisement. + * The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive + * this advertisement. */ - @JsonProperty(value = "peers") private List peers; - /** Creates an instance of BgpAdvertisement class. */ + /** + * Creates an instance of BgpAdvertisement class. + */ public BgpAdvertisement() { } /** * Get the advertiseToFabric property: The indicator of if this advertisement is also made to the network fabric * associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - * + * * @return the advertiseToFabric value. */ public AdvertiseToFabric advertiseToFabric() { @@ -56,7 +60,7 @@ public AdvertiseToFabric advertiseToFabric() { /** * Set the advertiseToFabric property: The indicator of if this advertisement is also made to the network fabric * associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - * + * * @param advertiseToFabric the advertiseToFabric value to set. * @return the BgpAdvertisement object itself. */ @@ -68,7 +72,7 @@ public BgpAdvertisement withAdvertiseToFabric(AdvertiseToFabric advertiseToFabri /** * Get the communities property: The names of the BGP communities to be associated with the announcement, utilizing * a BGP community string in 1234:1234 format. - * + * * @return the communities value. */ public List communities() { @@ -78,7 +82,7 @@ public List communities() { /** * Set the communities property: The names of the BGP communities to be associated with the announcement, utilizing * a BGP community string in 1234:1234 format. - * + * * @param communities the communities value to set. * @return the BgpAdvertisement object itself. */ @@ -89,7 +93,7 @@ public BgpAdvertisement withCommunities(List communities) { /** * Get the ipAddressPools property: The names of the IP address pools associated with this announcement. - * + * * @return the ipAddressPools value. */ public List ipAddressPools() { @@ -98,7 +102,7 @@ public List ipAddressPools() { /** * Set the ipAddressPools property: The names of the IP address pools associated with this announcement. - * + * * @param ipAddressPools the ipAddressPools value to set. * @return the BgpAdvertisement object itself. */ @@ -110,7 +114,7 @@ public BgpAdvertisement withIpAddressPools(List ipAddressPools) { /** * Get the peers property: The names of the BGP peers to limit this advertisement to. If no values are specified, * all BGP peers will receive this advertisement. - * + * * @return the peers value. */ public List peers() { @@ -120,7 +124,7 @@ public List peers() { /** * Set the peers property: The names of the BGP peers to limit this advertisement to. If no values are specified, * all BGP peers will receive this advertisement. - * + * * @param peers the peers value to set. * @return the BgpAdvertisement object itself. */ @@ -131,15 +135,67 @@ public BgpAdvertisement withPeers(List peers) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (ipAddressPools() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ipAddressPools in model BgpAdvertisement")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property ipAddressPools in model BgpAdvertisement")); } } private static final ClientLogger LOGGER = new ClientLogger(BgpAdvertisement.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipAddressPools", this.ipAddressPools, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("advertiseToFabric", + this.advertiseToFabric == null ? null : this.advertiseToFabric.toString()); + jsonWriter.writeArrayField("communities", this.communities, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("peers", this.peers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpAdvertisement from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpAdvertisement 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 BgpAdvertisement. + */ + public static BgpAdvertisement fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpAdvertisement deserializedBgpAdvertisement = new BgpAdvertisement(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddressPools".equals(fieldName)) { + List ipAddressPools = reader.readArray(reader1 -> reader1.getString()); + deserializedBgpAdvertisement.ipAddressPools = ipAddressPools; + } else if ("advertiseToFabric".equals(fieldName)) { + deserializedBgpAdvertisement.advertiseToFabric = AdvertiseToFabric.fromString(reader.getString()); + } else if ("communities".equals(fieldName)) { + List communities = reader.readArray(reader1 -> reader1.getString()); + deserializedBgpAdvertisement.communities = communities; + } else if ("peers".equals(fieldName)) { + List peers = reader.readArray(reader1 -> reader1.getString()); + deserializedBgpAdvertisement.peers = peers; + } else { + reader.skipChildren(); + } + } + + return deserializedBgpAdvertisement; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpMultiHop.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpMultiHop.java index 77253ce61a8b5..0340daa0dca00 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpMultiHop.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpMultiHop.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator to enable multi-hop peering support. */ +/** + * The indicator to enable multi-hop peering support. + */ public final class BgpMultiHop extends ExpandableStringEnum { - /** Static value True for BgpMultiHop. */ + /** + * Static value True for BgpMultiHop. + */ public static final BgpMultiHop TRUE = fromString("True"); - /** Static value False for BgpMultiHop. */ + /** + * Static value False for BgpMultiHop. + */ public static final BgpMultiHop FALSE = fromString("False"); /** * Creates a new instance of BgpMultiHop value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BgpMultiHop() { /** * Creates or finds a BgpMultiHop from its string representation. - * + * * @param name a name to look for. * @return the corresponding BgpMultiHop. */ - @JsonCreator public static BgpMultiHop fromString(String name) { return fromString(name, BgpMultiHop.class); } /** * Gets known BgpMultiHop values. - * + * * @return known BgpMultiHop values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpServiceLoadBalancerConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpServiceLoadBalancerConfiguration.java index 07e6198a74e10..7802c71ec8c31 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpServiceLoadBalancerConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpServiceLoadBalancerConfiguration.java @@ -5,45 +5,50 @@ package com.azure.resourcemanager.networkcloud.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; -/** BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. */ +/** + * BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + */ @Fluent -public final class BgpServiceLoadBalancerConfiguration { +public final class BgpServiceLoadBalancerConfiguration + implements JsonSerializable { /* * The association of IP address pools to the communities and peers, allowing for announcement of IPs. */ - @JsonProperty(value = "bgpAdvertisements") private List bgpAdvertisements; /* * The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be * explicitly defined. */ - @JsonProperty(value = "bgpPeers") private List bgpPeers; /* * The indicator to specify if the load balancer peers with the network fabric. */ - @JsonProperty(value = "fabricPeeringEnabled") private FabricPeeringEnabled fabricPeeringEnabled; /* - * The list of pools of IP addresses that can be allocated to Load Balancer services. + * The list of pools of IP addresses that can be allocated to load balancer services. */ - @JsonProperty(value = "ipAddressPools") private List ipAddressPools; - /** Creates an instance of BgpServiceLoadBalancerConfiguration class. */ + /** + * Creates an instance of BgpServiceLoadBalancerConfiguration class. + */ public BgpServiceLoadBalancerConfiguration() { } /** * Get the bgpAdvertisements property: The association of IP address pools to the communities and peers, allowing * for announcement of IPs. - * + * * @return the bgpAdvertisements value. */ public List bgpAdvertisements() { @@ -53,7 +58,7 @@ public List bgpAdvertisements() { /** * Set the bgpAdvertisements property: The association of IP address pools to the communities and peers, allowing * for announcement of IPs. - * + * * @param bgpAdvertisements the bgpAdvertisements value to set. * @return the BgpServiceLoadBalancerConfiguration object itself. */ @@ -65,7 +70,7 @@ public BgpServiceLoadBalancerConfiguration withBgpAdvertisements(List bgpPeers() { @@ -75,7 +80,7 @@ public List bgpPeers() { /** * Set the bgpPeers property: The list of additional BgpPeer entities that the Kubernetes cluster will peer with. * All peering must be explicitly defined. - * + * * @param bgpPeers the bgpPeers value to set. * @return the BgpServiceLoadBalancerConfiguration object itself. */ @@ -87,7 +92,7 @@ public BgpServiceLoadBalancerConfiguration withBgpPeers(List ipAddressPools() { @@ -117,9 +122,9 @@ public List ipAddressPools() { } /** - * Set the ipAddressPools property: The list of pools of IP addresses that can be allocated to Load Balancer + * Set the ipAddressPools property: The list of pools of IP addresses that can be allocated to load balancer * services. - * + * * @param ipAddressPools the ipAddressPools value to set. * @return the BgpServiceLoadBalancerConfiguration object itself. */ @@ -130,7 +135,7 @@ public BgpServiceLoadBalancerConfiguration withIpAddressPools(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("bgpAdvertisements", this.bgpAdvertisements, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("bgpPeers", this.bgpPeers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("fabricPeeringEnabled", + this.fabricPeeringEnabled == null ? null : this.fabricPeeringEnabled.toString()); + jsonWriter.writeArrayField("ipAddressPools", this.ipAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpServiceLoadBalancerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpServiceLoadBalancerConfiguration 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 BgpServiceLoadBalancerConfiguration. + */ + public static BgpServiceLoadBalancerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpServiceLoadBalancerConfiguration deserializedBgpServiceLoadBalancerConfiguration + = new BgpServiceLoadBalancerConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bgpAdvertisements".equals(fieldName)) { + List bgpAdvertisements + = reader.readArray(reader1 -> BgpAdvertisement.fromJson(reader1)); + deserializedBgpServiceLoadBalancerConfiguration.bgpAdvertisements = bgpAdvertisements; + } else if ("bgpPeers".equals(fieldName)) { + List bgpPeers + = reader.readArray(reader1 -> ServiceLoadBalancerBgpPeer.fromJson(reader1)); + deserializedBgpServiceLoadBalancerConfiguration.bgpPeers = bgpPeers; + } else if ("fabricPeeringEnabled".equals(fieldName)) { + deserializedBgpServiceLoadBalancerConfiguration.fabricPeeringEnabled + = FabricPeeringEnabled.fromString(reader.getString()); + } else if ("ipAddressPools".equals(fieldName)) { + List ipAddressPools = reader.readArray(reader1 -> IpAddressPool.fromJson(reader1)); + deserializedBgpServiceLoadBalancerConfiguration.ipAddressPools = ipAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedBgpServiceLoadBalancerConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java index ee664cf192328..7c6261548aa44 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java @@ -12,56 +12,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of BmcKeySet. */ +/** + * An immutable client-side representation of BmcKeySet. + */ public interface BmcKeySet { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -69,21 +68,21 @@ public interface BmcKeySet { /** * Gets the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be * in for access to be granted. Users that are not in the group will not have access. - * + * * @return the azureGroupId value. */ String azureGroupId(); /** * Gets the detailedStatus property: The more detailed status of the key set. - * + * * @return the detailedStatus value. */ BmcKeySetDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -91,92 +90,100 @@ public interface BmcKeySet { /** * Gets the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @return the expiration value. */ OffsetDateTime expiration(); /** * Gets the lastValidation property: The last time this key set was validated. - * + * * @return the lastValidation value. */ OffsetDateTime lastValidation(); /** * Gets the privilegeLevel property: The access level allowed for the users in this key set. - * + * * @return the privilegeLevel value. */ BmcKeySetPrivilegeLevel privilegeLevel(); /** * Gets the provisioningState property: The provisioning state of the baseboard management controller key set. - * + * * @return the provisioningState value. */ BmcKeySetProvisioningState provisioningState(); /** * Gets the userList property: The unique list of permitted users. - * + * * @return the userList value. */ List userList(); /** * Gets the userListStatus property: The status evaluation of each user. - * + * * @return the userListStatus value. */ List userListStatus(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner object. - * + * * @return the inner object. */ BmcKeySetInner innerModel(); - /** The entirety of the BmcKeySet definition. */ + /** + * The entirety of the BmcKeySet definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAzureGroupId, DefinitionStages.WithExpiration, DefinitionStages.WithPrivilegeLevel, DefinitionStages.WithUserList, DefinitionStages.WithCreate { } - /** The BmcKeySet definition stages. */ + /** + * The BmcKeySet definition stages. + */ interface DefinitionStages { - /** The first stage of the BmcKeySet definition. */ + /** + * The first stage of the BmcKeySet definition. + */ interface Blank extends WithLocation { } - /** The stage of the BmcKeySet definition allowing to specify location. */ + /** + * The stage of the BmcKeySet definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -184,18 +191,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the BmcKeySet definition allowing to specify parent resource. */ + /** + * The stage of the BmcKeySet definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, clusterName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @return the next definition stage. @@ -203,64 +212,70 @@ interface WithParentResource { WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); } - /** The stage of the BmcKeySet definition allowing to specify extendedLocation. */ + /** + * The stage of the BmcKeySet definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithAzureGroupId withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the BmcKeySet definition allowing to specify azureGroupId. */ + /** + * The stage of the BmcKeySet definition allowing to specify azureGroupId. + */ interface WithAzureGroupId { /** * Specifies the azureGroupId property: The object ID of Azure Active Directory group that all users in the * list must be in for access to be granted. Users that are not in the group will not have access.. - * + * * @param azureGroupId The object ID of Azure Active Directory group that all users in the list must be in - * for access to be granted. Users that are not in the group will not have access. + * for access to be granted. Users that are not in the group will not have access. * @return the next definition stage. */ WithExpiration withAzureGroupId(String azureGroupId); } - /** The stage of the BmcKeySet definition allowing to specify expiration. */ + /** + * The stage of the BmcKeySet definition allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the users in this key set will be * removed from the baseboard management controllers.. - * + * * @param expiration The date and time after which the users in this key set will be removed from the - * baseboard management controllers. + * baseboard management controllers. * @return the next definition stage. */ WithPrivilegeLevel withExpiration(OffsetDateTime expiration); } - /** The stage of the BmcKeySet definition allowing to specify privilegeLevel. */ + /** + * The stage of the BmcKeySet definition allowing to specify privilegeLevel. + */ interface WithPrivilegeLevel { /** * Specifies the privilegeLevel property: The access level allowed for the users in this key set.. - * + * * @param privilegeLevel The access level allowed for the users in this key set. * @return the next definition stage. */ WithUserList withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel); } - /** The stage of the BmcKeySet definition allowing to specify userList. */ + /** + * The stage of the BmcKeySet definition allowing to specify userList. + */ interface WithUserList { /** * Specifies the userList property: The unique list of permitted users.. - * + * * @param userList The unique list of permitted users. * @return the next definition stage. */ @@ -274,25 +289,27 @@ interface WithUserList { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ BmcKeySet create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ BmcKeySet create(Context context); } - /** The stage of the BmcKeySet definition allowing to specify tags. */ + /** + * The stage of the BmcKeySet definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -302,60 +319,70 @@ interface WithTags { /** * Begins update for the BmcKeySet resource. - * + * * @return the stage of resource update. */ BmcKeySet.Update update(); - /** The template for BmcKeySet update. */ + /** + * The template for BmcKeySet update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithExpiration, UpdateStages.WithUserList { /** * Executes the update request. - * + * * @return the updated resource. */ BmcKeySet apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ BmcKeySet apply(Context context); } - /** The BmcKeySet update stages. */ + /** + * The BmcKeySet update stages. + */ interface UpdateStages { - /** The stage of the BmcKeySet update allowing to specify tags. */ + /** + * The stage of the BmcKeySet update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the BmcKeySet update allowing to specify expiration. */ + /** + * The stage of the BmcKeySet update allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the users in this key set will be * removed from the baseboard management controllers.. - * + * * @param expiration The date and time after which the users in this key set will be removed from the - * baseboard management controllers. + * baseboard management controllers. * @return the next definition stage. */ Update withExpiration(OffsetDateTime expiration); } - /** The stage of the BmcKeySet update allowing to specify userList. */ + /** + * The stage of the BmcKeySet update allowing to specify userList. + */ interface WithUserList { /** * Specifies the userList property: The unique list of permitted users.. - * + * * @param userList The unique list of permitted users. * @return the next definition stage. */ @@ -365,14 +392,14 @@ interface WithUserList { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ BmcKeySet refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java index 662f01e29b724..6456e3b1415ef 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the key set. */ +/** + * The more detailed status of the key set. + */ public final class BmcKeySetDetailedStatus extends ExpandableStringEnum { - /** Static value AllActive for BmcKeySetDetailedStatus. */ + /** + * Static value AllActive for BmcKeySetDetailedStatus. + */ public static final BmcKeySetDetailedStatus ALL_ACTIVE = fromString("AllActive"); - /** Static value SomeInvalid for BmcKeySetDetailedStatus. */ + /** + * Static value SomeInvalid for BmcKeySetDetailedStatus. + */ public static final BmcKeySetDetailedStatus SOME_INVALID = fromString("SomeInvalid"); - /** Static value AllInvalid for BmcKeySetDetailedStatus. */ + /** + * Static value AllInvalid for BmcKeySetDetailedStatus. + */ public static final BmcKeySetDetailedStatus ALL_INVALID = fromString("AllInvalid"); - /** Static value Validating for BmcKeySetDetailedStatus. */ + /** + * Static value Validating for BmcKeySetDetailedStatus. + */ public static final BmcKeySetDetailedStatus VALIDATING = fromString("Validating"); /** * Creates a new instance of BmcKeySetDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public BmcKeySetDetailedStatus() { /** * Creates or finds a BmcKeySetDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding BmcKeySetDetailedStatus. */ - @JsonCreator public static BmcKeySetDetailedStatus fromString(String name) { return fromString(name, BmcKeySetDetailedStatus.class); } /** * Gets known BmcKeySetDetailedStatus values. - * + * * @return known BmcKeySetDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java index dbbc7b7a783bd..8ce172cec6377 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BmcKeySetInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** BmcKeySetList represents a list of baseboard management controller key sets. */ +/** + * BmcKeySetList represents a list of baseboard management controller key sets. + */ @Fluent -public final class BmcKeySetList { +public final class BmcKeySetList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of baseboard management controller key sets. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of BmcKeySetList class. */ + /** + * Creates an instance of BmcKeySetList class. + */ public BmcKeySetList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the BmcKeySetList object itself. */ @@ -50,7 +56,7 @@ public BmcKeySetList withNextLink(String nextLink) { /** * Get the value property: The list of baseboard management controller key sets. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of baseboard management controller key sets. - * + * * @param value the value value to set. * @return the BmcKeySetList object itself. */ @@ -70,7 +76,7 @@ public BmcKeySetList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BmcKeySetList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BmcKeySetList 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 BmcKeySetList. + */ + public static BmcKeySetList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BmcKeySetList deserializedBmcKeySetList = new BmcKeySetList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedBmcKeySetList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BmcKeySetInner.fromJson(reader1)); + deserializedBmcKeySetList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBmcKeySetList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java index 7c561e00261fc..1362f1cd6f90d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java @@ -5,42 +5,40 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.BmcKeySetPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. */ +/** + * BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + */ @Fluent -public final class BmcKeySetPatchParameters { +public final class BmcKeySetPatchParameters implements JsonSerializable { /* - * BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are - * patchable. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private BmcKeySetPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of BmcKeySetPatchParameters class. */ + /** + * Creates an instance of BmcKeySetPatchParameters class. + */ public BmcKeySetPatchParameters() { } /** - * Get the innerProperties property: BmcKeySetPatchProperties represents the properties of baseboard management - * controller key set that are patchable. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private BmcKeySetPatchProperties innerProperties() { @@ -49,7 +47,7 @@ private BmcKeySetPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -58,7 +56,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the BmcKeySetPatchParameters object itself. */ @@ -70,7 +68,7 @@ public BmcKeySetPatchParameters withTags(Map tags) { /** * Get the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -80,7 +78,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the users in this key set will be removed from the * baseboard management controllers. - * + * * @param expiration the expiration value to set. * @return the BmcKeySetPatchParameters object itself. */ @@ -94,7 +92,7 @@ public BmcKeySetPatchParameters withExpiration(OffsetDateTime expiration) { /** * Get the userList property: The unique list of permitted users. - * + * * @return the userList value. */ public List userList() { @@ -103,7 +101,7 @@ public List userList() { /** * Set the userList property: The unique list of permitted users. - * + * * @param userList the userList value to set. * @return the BmcKeySetPatchParameters object itself. */ @@ -117,7 +115,7 @@ public BmcKeySetPatchParameters withUserList(List userList) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -125,4 +123,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BmcKeySetPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BmcKeySetPatchParameters 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 BmcKeySetPatchParameters. + */ + public static BmcKeySetPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BmcKeySetPatchParameters deserializedBmcKeySetPatchParameters = new BmcKeySetPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedBmcKeySetPatchParameters.innerProperties = BmcKeySetPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBmcKeySetPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedBmcKeySetPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java index 9efb3142b1489..aff7bb047c5d6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The access level allowed for the users in this key set. */ +/** + * The access level allowed for the users in this key set. + */ public final class BmcKeySetPrivilegeLevel extends ExpandableStringEnum { - /** Static value ReadOnly for BmcKeySetPrivilegeLevel. */ + /** + * Static value ReadOnly for BmcKeySetPrivilegeLevel. + */ public static final BmcKeySetPrivilegeLevel READ_ONLY = fromString("ReadOnly"); - /** Static value Administrator for BmcKeySetPrivilegeLevel. */ + /** + * Static value Administrator for BmcKeySetPrivilegeLevel. + */ public static final BmcKeySetPrivilegeLevel ADMINISTRATOR = fromString("Administrator"); /** * Creates a new instance of BmcKeySetPrivilegeLevel value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BmcKeySetPrivilegeLevel() { /** * Creates or finds a BmcKeySetPrivilegeLevel from its string representation. - * + * * @param name a name to look for. * @return the corresponding BmcKeySetPrivilegeLevel. */ - @JsonCreator public static BmcKeySetPrivilegeLevel fromString(String name) { return fromString(name, BmcKeySetPrivilegeLevel.class); } /** * Gets known BmcKeySetPrivilegeLevel values. - * + * * @return known BmcKeySetPrivilegeLevel values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java index 0078c11cd9b22..7802a79b761dd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the baseboard management controller key set. */ +/** + * The provisioning state of the baseboard management controller key set. + */ public final class BmcKeySetProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for BmcKeySetProvisioningState. */ + /** + * Static value Succeeded for BmcKeySetProvisioningState. + */ public static final BmcKeySetProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for BmcKeySetProvisioningState. */ + /** + * Static value Failed for BmcKeySetProvisioningState. + */ public static final BmcKeySetProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for BmcKeySetProvisioningState. */ + /** + * Static value Canceled for BmcKeySetProvisioningState. + */ public static final BmcKeySetProvisioningState CANCELED = fromString("Canceled"); - /** Static value Accepted for BmcKeySetProvisioningState. */ + /** + * Static value Accepted for BmcKeySetProvisioningState. + */ public static final BmcKeySetProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Provisioning for BmcKeySetProvisioningState. */ + /** + * Static value Provisioning for BmcKeySetProvisioningState. + */ public static final BmcKeySetProvisioningState PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of BmcKeySetProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public BmcKeySetProvisioningState() { /** * Creates or finds a BmcKeySetProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding BmcKeySetProvisioningState. */ - @JsonCreator public static BmcKeySetProvisioningState fromString(String name) { return fromString(name, BmcKeySetProvisioningState.class); } /** * Gets known BmcKeySetProvisioningState values. - * + * * @return known BmcKeySetProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java index 67931afe990f0..53205ddcf9b38 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java @@ -8,28 +8,30 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BmcKeySets. */ +/** + * Resource collection API of BmcKeySets. + */ public interface BmcKeySets { /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List baseboard management controller key sets of the cluster. - * - *

Get a list of baseboard management controller key sets for the provided cluster. - * + * + * Get a list of baseboard management controller key sets for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -37,15 +39,15 @@ public interface BmcKeySets { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of baseboard management controller key sets for the provided cluster as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -60,9 +62,9 @@ Response getWithResponse(String resourceGroupName, String clusterName /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -75,23 +77,24 @@ Response getWithResponse(String resourceGroupName, String clusterName /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String bmcKeySetName); + OperationStatusResult delete(String resourceGroupName, String clusterName, String bmcKeySetName); /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param bmcKeySetName The name of the baseboard management controller key set. @@ -99,14 +102,15 @@ Response getWithResponse(String resourceGroupName, String clusterName * @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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + OperationStatusResult delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context); /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -117,9 +121,9 @@ Response getWithResponse(String resourceGroupName, String clusterName /** * Retrieve the baseboard management controller key set of the cluster. - * - *

Get baseboard management controller key set of the provided cluster. - * + * + * Get baseboard management controller key set of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,32 +135,34 @@ Response getWithResponse(String resourceGroupName, String clusterName /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the baseboard management controller key set of the cluster. - * - *

Delete the baseboard management controller key set of the provided cluster. - * + * + * Delete the baseboard management controller key set of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new BmcKeySet resource. - * + * * @param name resource name. * @return the first stage of the new BmcKeySet definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java index 09f083d3f9af2..67d72c15e3080 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of bootstrap protocol used. */ +/** + * The type of bootstrap protocol used. + */ public final class BootstrapProtocol extends ExpandableStringEnum { - /** Static value PXE for BootstrapProtocol. */ + /** + * Static value PXE for BootstrapProtocol. + */ public static final BootstrapProtocol PXE = fromString("PXE"); /** * Creates a new instance of BootstrapProtocol value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public BootstrapProtocol() { /** * Creates or finds a BootstrapProtocol from its string representation. - * + * * @param name a name to look for. * @return the corresponding BootstrapProtocol. */ - @JsonCreator public static BootstrapProtocol fromString(String name) { return fromString(name, BootstrapProtocol.class); } /** * Gets known BootstrapProtocol values. - * + * * @return known BootstrapProtocol values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java index 8c4f83a6eac3d..f9be3b93abe49 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of CloudServicesNetwork. */ +/** + * An immutable client-side representation of CloudServicesNetwork. + */ public interface CloudServicesNetwork { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,7 +67,7 @@ public interface CloudServicesNetwork { /** * Gets the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @return the additionalEgressEndpoints value. */ List additionalEgressEndpoints(); @@ -76,7 +75,7 @@ public interface CloudServicesNetwork { /** * Gets the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ List associatedResourceIds(); @@ -84,21 +83,21 @@ public interface CloudServicesNetwork { /** * Gets the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is * associated with. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The more detailed status of the cloud services network. - * + * * @return the detailedStatus value. */ CloudServicesNetworkDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -106,7 +105,7 @@ public interface CloudServicesNetwork { /** * Gets the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @return the enableDefaultEgressEndpoints value. */ CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints(); @@ -114,7 +113,7 @@ public interface CloudServicesNetwork { /** * Gets the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are * currently enabled. - * + * * @return the enabledEgressEndpoints value. */ List enabledEgressEndpoints(); @@ -122,7 +121,7 @@ public interface CloudServicesNetwork { /** * Gets the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this cloud services network. - * + * * @return the hybridAksClustersAssociatedIds value. */ List hybridAksClustersAssociatedIds(); @@ -130,14 +129,14 @@ public interface CloudServicesNetwork { /** * Gets the interfaceName property: The name of the interface that will be present in the virtual machine to * represent this network. - * + * * @return the interfaceName value. */ String interfaceName(); /** * Gets the provisioningState property: The provisioning state of the cloud services network. - * + * * @return the provisioningState value. */ CloudServicesNetworkProvisioningState provisioningState(); @@ -146,55 +145,63 @@ public interface CloudServicesNetwork { * Gets the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud * services network. - * + * * @return the virtualMachinesAssociatedIds value. */ List virtualMachinesAssociatedIds(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner object. - * + * * @return the inner object. */ CloudServicesNetworkInner innerModel(); - /** The entirety of the CloudServicesNetwork definition. */ + /** + * The entirety of the CloudServicesNetwork definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The CloudServicesNetwork definition stages. */ + /** + * The CloudServicesNetwork definition stages. + */ interface DefinitionStages { - /** The first stage of the CloudServicesNetwork definition. */ + /** + * The first stage of the CloudServicesNetwork definition. + */ interface Blank extends WithLocation { } - /** The stage of the CloudServicesNetwork definition allowing to specify location. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -202,35 +209,35 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the CloudServicesNetwork definition allowing to specify parent resource. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the CloudServicesNetwork definition allowing to specify extendedLocation. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); @@ -244,52 +251,58 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAdd DefinitionStages.WithEnableDefaultEgressEndpoints { /** * Executes the create request. - * + * * @return the created resource. */ CloudServicesNetwork create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ CloudServicesNetwork create(Context context); } - /** The stage of the CloudServicesNetwork definition allowing to specify tags. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the CloudServicesNetwork definition allowing to specify additionalEgressEndpoints. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify additionalEgressEndpoints. + */ interface WithAdditionalEgressEndpoints { /** * Specifies the additionalEgressEndpoints property: The list of egress endpoints. This allows for * connection from a Hybrid AKS cluster to the specified endpoint.. - * + * * @param additionalEgressEndpoints The list of egress endpoints. This allows for connection from a Hybrid - * AKS cluster to the specified endpoint. + * AKS cluster to the specified endpoint. * @return the next definition stage. */ WithCreate withAdditionalEgressEndpoints(List additionalEgressEndpoints); } - /** The stage of the CloudServicesNetwork definition allowing to specify enableDefaultEgressEndpoints. */ + /** + * The stage of the CloudServicesNetwork definition allowing to specify enableDefaultEgressEndpoints. + */ interface WithEnableDefaultEgressEndpoints { /** * Specifies the enableDefaultEgressEndpoints property: The indicator of whether the platform default * endpoints are allowed for the egress traffic.. - * + * * @param enableDefaultEgressEndpoints The indicator of whether the platform default endpoints are allowed - * for the egress traffic. + * for the egress traffic. * @return the next definition stage. */ WithCreate withEnableDefaultEgressEndpoints( @@ -299,64 +312,74 @@ WithCreate withEnableDefaultEgressEndpoints( /** * Begins update for the CloudServicesNetwork resource. - * + * * @return the stage of resource update. */ CloudServicesNetwork.Update update(); - /** The template for CloudServicesNetwork update. */ + /** + * The template for CloudServicesNetwork update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithAdditionalEgressEndpoints, UpdateStages.WithEnableDefaultEgressEndpoints { /** * Executes the update request. - * + * * @return the updated resource. */ CloudServicesNetwork apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ CloudServicesNetwork apply(Context context); } - /** The CloudServicesNetwork update stages. */ + /** + * The CloudServicesNetwork update stages. + */ interface UpdateStages { - /** The stage of the CloudServicesNetwork update allowing to specify tags. */ + /** + * The stage of the CloudServicesNetwork update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the CloudServicesNetwork update allowing to specify additionalEgressEndpoints. */ + /** + * The stage of the CloudServicesNetwork update allowing to specify additionalEgressEndpoints. + */ interface WithAdditionalEgressEndpoints { /** * Specifies the additionalEgressEndpoints property: The list of egress endpoints. This allows for * connection from a Hybrid AKS cluster to the specified endpoint.. - * + * * @param additionalEgressEndpoints The list of egress endpoints. This allows for connection from a Hybrid - * AKS cluster to the specified endpoint. + * AKS cluster to the specified endpoint. * @return the next definition stage. */ Update withAdditionalEgressEndpoints(List additionalEgressEndpoints); } - /** The stage of the CloudServicesNetwork update allowing to specify enableDefaultEgressEndpoints. */ + /** + * The stage of the CloudServicesNetwork update allowing to specify enableDefaultEgressEndpoints. + */ interface WithEnableDefaultEgressEndpoints { /** * Specifies the enableDefaultEgressEndpoints property: The indicator of whether the platform default * endpoints are allowed for the egress traffic.. - * + * * @param enableDefaultEgressEndpoints The indicator of whether the platform default endpoints are allowed - * for the egress traffic. + * for the egress traffic. * @return the next definition stage. */ Update withEnableDefaultEgressEndpoints( @@ -366,14 +389,14 @@ Update withEnableDefaultEgressEndpoints( /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ CloudServicesNetwork refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java index a7c51a968e0c1..62d068d1fe048 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the cloud services network. */ +/** + * The more detailed status of the cloud services network. + */ public final class CloudServicesNetworkDetailedStatus extends ExpandableStringEnum { - /** Static value Error for CloudServicesNetworkDetailedStatus. */ + /** + * Static value Error for CloudServicesNetworkDetailedStatus. + */ public static final CloudServicesNetworkDetailedStatus ERROR = fromString("Error"); - /** Static value Available for CloudServicesNetworkDetailedStatus. */ + /** + * Static value Available for CloudServicesNetworkDetailedStatus. + */ public static final CloudServicesNetworkDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for CloudServicesNetworkDetailedStatus. */ + /** + * Static value Provisioning for CloudServicesNetworkDetailedStatus. + */ public static final CloudServicesNetworkDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of CloudServicesNetworkDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public CloudServicesNetworkDetailedStatus() { /** * Creates or finds a CloudServicesNetworkDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding CloudServicesNetworkDetailedStatus. */ - @JsonCreator public static CloudServicesNetworkDetailedStatus fromString(String name) { return fromString(name, CloudServicesNetworkDetailedStatus.class); } /** * Gets known CloudServicesNetworkDetailedStatus values. - * + * * @return known CloudServicesNetworkDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java index fb22fd0447587..cb90db45111d6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the platform default endpoints are allowed for the egress traffic. */ +/** + * The indicator of whether the platform default endpoints are allowed for the egress traffic. + */ public final class CloudServicesNetworkEnableDefaultEgressEndpoints extends ExpandableStringEnum { - /** Static value True for CloudServicesNetworkEnableDefaultEgressEndpoints. */ + /** + * Static value True for CloudServicesNetworkEnableDefaultEgressEndpoints. + */ public static final CloudServicesNetworkEnableDefaultEgressEndpoints TRUE = fromString("True"); - /** Static value False for CloudServicesNetworkEnableDefaultEgressEndpoints. */ + /** + * Static value False for CloudServicesNetworkEnableDefaultEgressEndpoints. + */ public static final CloudServicesNetworkEnableDefaultEgressEndpoints FALSE = fromString("False"); /** * Creates a new instance of CloudServicesNetworkEnableDefaultEgressEndpoints value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public CloudServicesNetworkEnableDefaultEgressEndpoints() { /** * Creates or finds a CloudServicesNetworkEnableDefaultEgressEndpoints from its string representation. - * + * * @param name a name to look for. * @return the corresponding CloudServicesNetworkEnableDefaultEgressEndpoints. */ - @JsonCreator public static CloudServicesNetworkEnableDefaultEgressEndpoints fromString(String name) { return fromString(name, CloudServicesNetworkEnableDefaultEgressEndpoints.class); } /** * Gets known CloudServicesNetworkEnableDefaultEgressEndpoints values. - * + * * @return known CloudServicesNetworkEnableDefaultEgressEndpoints values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java index 1b5c64b4f4e17..e43ac2627bded 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.CloudServicesNetworkInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** CloudServicesNetworkList represents a list of cloud services networks. */ +/** + * CloudServicesNetworkList represents a list of cloud services networks. + */ @Fluent -public final class CloudServicesNetworkList { +public final class CloudServicesNetworkList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of cloud services networks. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of CloudServicesNetworkList class. */ + /** + * Creates an instance of CloudServicesNetworkList class. + */ public CloudServicesNetworkList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the CloudServicesNetworkList object itself. */ @@ -50,7 +56,7 @@ public CloudServicesNetworkList withNextLink(String nextLink) { /** * Get the value property: The list of cloud services networks. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of cloud services networks. - * + * * @param value the value value to set. * @return the CloudServicesNetworkList object itself. */ @@ -70,7 +76,7 @@ public CloudServicesNetworkList withValue(List value) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudServicesNetworkList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudServicesNetworkList 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 CloudServicesNetworkList. + */ + public static CloudServicesNetworkList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudServicesNetworkList deserializedCloudServicesNetworkList = new CloudServicesNetworkList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedCloudServicesNetworkList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudServicesNetworkInner.fromJson(reader1)); + deserializedCloudServicesNetworkList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudServicesNetworkList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java index b91ac9995cebc..44efc3f993e2b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.CloudServicesNetworkPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. */ +/** + * CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + */ @Fluent -public final class CloudServicesNetworkPatchParameters { +public final class CloudServicesNetworkPatchParameters + implements JsonSerializable { /* - * CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated - * using a patch request. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private CloudServicesNetworkPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of CloudServicesNetworkPatchParameters class. */ + /** + * Creates an instance of CloudServicesNetworkPatchParameters class. + */ public CloudServicesNetworkPatchParameters() { } /** - * Get the innerProperties property: CloudServicesNetworkPatchProperties represents the properties of the cloud - * services network that can be updated using a patch request. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private CloudServicesNetworkPatchProperties innerProperties() { @@ -48,7 +47,7 @@ private CloudServicesNetworkPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -57,7 +56,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the CloudServicesNetworkPatchParameters object itself. */ @@ -69,7 +68,7 @@ public CloudServicesNetworkPatchParameters withTags(Map tags) { /** * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @return the additionalEgressEndpoints value. */ public List additionalEgressEndpoints() { @@ -79,7 +78,7 @@ public List additionalEgressEndpoints() { /** * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a * Hybrid AKS cluster to the specified endpoint. - * + * * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. * @return the CloudServicesNetworkPatchParameters object itself. */ @@ -95,7 +94,7 @@ public List additionalEgressEndpoints() { /** * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @return the enableDefaultEgressEndpoints value. */ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { @@ -105,7 +104,7 @@ public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpo /** * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are * allowed for the egress traffic. - * + * * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. * @return the CloudServicesNetworkPatchParameters object itself. */ @@ -120,7 +119,7 @@ public CloudServicesNetworkPatchParameters withEnableDefaultEgressEndpoints( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -128,4 +127,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudServicesNetworkPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudServicesNetworkPatchParameters 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 CloudServicesNetworkPatchParameters. + */ + public static CloudServicesNetworkPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudServicesNetworkPatchParameters deserializedCloudServicesNetworkPatchParameters + = new CloudServicesNetworkPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedCloudServicesNetworkPatchParameters.innerProperties + = CloudServicesNetworkPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudServicesNetworkPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudServicesNetworkPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java index b5b601d60d337..30ac919efd194 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the cloud services network. */ +/** + * The provisioning state of the cloud services network. + */ public final class CloudServicesNetworkProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for CloudServicesNetworkProvisioningState. */ + /** + * Static value Succeeded for CloudServicesNetworkProvisioningState. + */ public static final CloudServicesNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for CloudServicesNetworkProvisioningState. */ + /** + * Static value Failed for CloudServicesNetworkProvisioningState. + */ public static final CloudServicesNetworkProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for CloudServicesNetworkProvisioningState. */ + /** + * Static value Canceled for CloudServicesNetworkProvisioningState. + */ public static final CloudServicesNetworkProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for CloudServicesNetworkProvisioningState. */ + /** + * Static value Provisioning for CloudServicesNetworkProvisioningState. + */ public static final CloudServicesNetworkProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for CloudServicesNetworkProvisioningState. */ + /** + * Static value Accepted for CloudServicesNetworkProvisioningState. + */ public static final CloudServicesNetworkProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of CloudServicesNetworkProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public CloudServicesNetworkProvisioningState() { /** * Creates or finds a CloudServicesNetworkProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding CloudServicesNetworkProvisioningState. */ - @JsonCreator public static CloudServicesNetworkProvisioningState fromString(String name) { return fromString(name, CloudServicesNetworkProvisioningState.class); } /** * Gets known CloudServicesNetworkProvisioningState values. - * + * * @return known CloudServicesNetworkProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java index 1faf539e197ac..a528e835c6b3c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of CloudServicesNetworks. */ +/** + * Resource collection API of CloudServicesNetworks. + */ public interface CloudServicesNetworks { /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List cloud services networks in the subscription. - * - *

Get a list of cloud services networks in the provided subscription. - * + * + * Get a list of cloud services networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List cloud services networks in the resource group. - * - *

Get a list of cloud services networks in the provided resource group. - * + * + * Get a list of cloud services networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cloud services networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cloud services networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @param context The context to associate with this operation. @@ -83,9 +85,9 @@ Response getByResourceGroupWithResponse(String resourceGro /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,36 +99,38 @@ Response getByResourceGroupWithResponse(String resourceGro /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName); /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudServicesNetworkName The name of the cloud services network. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String cloudServicesNetworkName, Context context); + OperationStatusResult delete(String resourceGroupName, String cloudServicesNetworkName, Context context); /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -137,9 +141,9 @@ Response getByResourceGroupWithResponse(String resourceGro /** * Retrieve the cloud services network. - * - *

Get properties of the provided cloud services network. - * + * + * Get properties of the provided cloud services network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,32 +155,34 @@ Response getByResourceGroupWithResponse(String resourceGro /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the cloud services network. - * - *

Delete the provided cloud services network. - * + * + * Delete the provided cloud services network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new CloudServicesNetwork resource. - * + * * @param name resource name. * @return the first stage of the new CloudServicesNetwork definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java index c89ae6d439df1..2c71901a8b010 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java @@ -11,74 +11,86 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of Cluster. */ +/** + * An immutable client-side representation of Cluster. + */ public interface Cluster { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster. - * + * Gets the extendedLocation property: The extended location of the cluster manager associated with the cluster. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); + /** + * Gets the identity property: The identity for the resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** - * Gets the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Gets the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @return the aggregatorOrSingleRackDefinition value. */ RackDefinition aggregatorOrSingleRackDefinition(); /** - * Gets the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for - * storing relevant logs. - * + * Gets the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @return the analyticsOutputSettings value. + */ + AnalyticsOutputSettings analyticsOutputSettings(); + + /** + * Gets the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics Workspace that + * will be used for storing relevant logs. + * * @return the analyticsWorkspaceId value. */ String analyticsWorkspaceId(); @@ -86,16 +98,14 @@ public interface Cluster { /** * Gets the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this * cluster. - * + * * @return the availableUpgradeVersions value. */ List availableUpgradeVersions(); /** - * Gets the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. - * - *

The capacity supported by this cluster. - * + * Gets the clusterCapacity property: The capacity supported by this cluster. + * * @return the clusterCapacity value. */ ClusterCapacity clusterCapacity(); @@ -103,18 +113,16 @@ public interface Cluster { /** * Gets the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the * cluster. - * + * * @return the clusterConnectionStatus value. */ ClusterConnectionStatus clusterConnectionStatus(); /** - * Gets the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster's control plane location. This extended - * location is used to route the requests of child objects of the cluster that are handled by the platform operator. - * + * Gets the clusterExtendedLocation property: The extended location (custom location) that represents the cluster's + * control plane location. This extended location is used to route the requests of child objects of the cluster that + * are handled by the platform operator. + * * @return the clusterExtendedLocation value. */ ExtendedLocation clusterExtendedLocation(); @@ -122,7 +130,7 @@ public interface Cluster { /** * Gets the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @return the clusterLocation value. */ String clusterLocation(); @@ -130,7 +138,7 @@ public interface Cluster { /** * Gets the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the * cluster. - * + * * @return the clusterManagerConnectionStatus value. */ ClusterManagerConnectionStatus clusterManagerConnectionStatus(); @@ -138,42 +146,45 @@ public interface Cluster { /** * Gets the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set * by the Cluster Manager when the cluster is created. - * + * * @return the clusterManagerId value. */ String clusterManagerId(); /** - * Gets the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Gets the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @return the clusterServicePrincipal value. */ ServicePrincipalInformation clusterServicePrincipal(); /** * Gets the clusterType property: The type of rack configuration for the cluster. - * + * * @return the clusterType value. */ ClusterType clusterType(); /** * Gets the clusterVersion property: The current runtime version of the cluster. - * + * * @return the clusterVersion value. */ String clusterVersion(); /** - * Gets the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Gets the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal + * machine run read only commands and data extracts. + * + * @return the commandOutputSettings value. + */ + CommandOutputSettings commandOutputSettings(); + + /** + * Gets the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @return the computeDeploymentThreshold value. */ ValidationThreshold computeDeploymentThreshold(); @@ -181,128 +192,169 @@ public interface Cluster { /** * Gets the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @return the computeRackDefinitions value. */ List computeRackDefinitions(); /** * Gets the detailedStatus property: The current detailed status of the cluster. - * + * * @return the detailedStatus value. */ ClusterDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** - * Gets the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom - * location) that represents the Hybrid AKS control plane location. This extended location is used when creating - * provisioned clusters (Hybrid AKS clusters). - * + * Gets the hybridAksExtendedLocation property: Field Deprecated. This field will not be populated in an upcoming + * version. The extended location (custom location) that represents the Hybrid AKS control plane location. This + * extended location is used when creating provisioned clusters (Hybrid AKS clusters). + * * @return the hybridAksExtendedLocation value. */ ExtendedLocation hybridAksExtendedLocation(); /** - * Gets the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Gets the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ ManagedResourceGroupConfiguration managedResourceGroupConfiguration(); /** * Gets the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. - * + * * @return the manualActionCount value. */ Long manualActionCount(); /** * Gets the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. - * + * * @return the networkFabricId value. */ String networkFabricId(); /** * Gets the provisioningState property: The provisioning state of the cluster. - * + * * @return the provisioningState value. */ ClusterProvisioningState provisioningState(); + /** + * Gets the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @return the runtimeProtectionConfiguration value. + */ + RuntimeProtectionConfiguration runtimeProtectionConfiguration(); + + /** + * Gets the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @return the secretArchive value. + */ + ClusterSecretArchive secretArchive(); + + /** + * Gets the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @return the secretArchiveSettings value. + */ + SecretArchiveSettings secretArchiveSettings(); + /** * Gets the supportExpiryDate property: The support end date of the runtime version of the cluster. - * + * * @return the supportExpiryDate value. */ String supportExpiryDate(); + /** + * Gets the updateStrategy property: The strategy for updating the cluster. + * + * @return the updateStrategy value. + */ + ClusterUpdateStrategy updateStrategy(); + + /** + * Gets the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @return the vulnerabilityScanningSettings value. + */ + VulnerabilityScanningSettings vulnerabilityScanningSettings(); + /** * Gets the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. - * + * * @return the workloadResourceIds value. */ List workloadResourceIds(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner object. - * + * * @return the inner object. */ ClusterInner innerModel(); - /** The entirety of the Cluster definition. */ + /** + * The entirety of the Cluster definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAggregatorOrSingleRackDefinition, DefinitionStages.WithClusterType, DefinitionStages.WithClusterVersion, DefinitionStages.WithNetworkFabricId, DefinitionStages.WithCreate { } - /** The Cluster definition stages. */ + /** + * The Cluster definition stages. + */ interface DefinitionStages { - /** The first stage of the Cluster definition. */ + /** + * The first stage of the Cluster definition. + */ interface Blank extends WithLocation { } - /** The stage of the Cluster definition allowing to specify location. */ + /** + * The stage of the Cluster definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -310,85 +362,89 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Cluster definition allowing to specify parent resource. */ + /** + * The stage of the Cluster definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the Cluster definition allowing to specify extendedLocation. */ + /** + * The stage of the Cluster definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster manager associated with the cluster.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster manager associated with the cluster. + * Specifies the extendedLocation property: The extended location of the cluster manager associated with the + * cluster.. + * + * @param extendedLocation The extended location of the cluster manager associated with the cluster. * @return the next definition stage. */ WithAggregatorOrSingleRackDefinition withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the Cluster definition allowing to specify aggregatorOrSingleRackDefinition. */ + /** + * The stage of the Cluster definition allowing to specify aggregatorOrSingleRackDefinition. + */ interface WithAggregatorOrSingleRackDefinition { /** - * Specifies the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the - * rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an - * aggregator rack in a multi-rack cluster.. - * - * @param aggregatorOrSingleRackDefinition RackDefinition represents details regarding the rack. - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an - * aggregator rack in a multi-rack cluster. + * Specifies the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect + * only a single rack in a single rack cluster, or an aggregator rack in a multi-rack cluster.. + * + * @param aggregatorOrSingleRackDefinition The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. * @return the next definition stage. */ WithClusterType withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition); } - /** The stage of the Cluster definition allowing to specify clusterType. */ + /** + * The stage of the Cluster definition allowing to specify clusterType. + */ interface WithClusterType { /** * Specifies the clusterType property: The type of rack configuration for the cluster.. - * + * * @param clusterType The type of rack configuration for the cluster. * @return the next definition stage. */ WithClusterVersion withClusterType(ClusterType clusterType); } - /** The stage of the Cluster definition allowing to specify clusterVersion. */ + /** + * The stage of the Cluster definition allowing to specify clusterVersion. + */ interface WithClusterVersion { /** * Specifies the clusterVersion property: The current runtime version of the cluster.. - * + * * @param clusterVersion The current runtime version of the cluster. * @return the next definition stage. */ WithNetworkFabricId withClusterVersion(String clusterVersion); } - /** The stage of the Cluster definition allowing to specify networkFabricId. */ + /** + * The stage of the Cluster definition allowing to specify networkFabricId. + */ interface WithNetworkFabricId { /** * Specifies the networkFabricId property: The resource ID of the Network Fabric associated with the * cluster.. - * + * * @param networkFabricId The resource ID of the Network Fabric associated with the cluster. * @return the next definition stage. */ @@ -399,264 +455,541 @@ interface WithNetworkFabricId { * The stage of the Cluster definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAnalyticsWorkspaceId, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithAnalyticsOutputSettings, DefinitionStages.WithAnalyticsWorkspaceId, DefinitionStages.WithClusterLocation, DefinitionStages.WithClusterServicePrincipal, - DefinitionStages.WithComputeDeploymentThreshold, DefinitionStages.WithComputeRackDefinitions, - DefinitionStages.WithManagedResourceGroupConfiguration { + DefinitionStages.WithCommandOutputSettings, DefinitionStages.WithComputeDeploymentThreshold, + DefinitionStages.WithComputeRackDefinitions, DefinitionStages.WithManagedResourceGroupConfiguration, + DefinitionStages.WithRuntimeProtectionConfiguration, DefinitionStages.WithSecretArchive, + DefinitionStages.WithSecretArchiveSettings, DefinitionStages.WithUpdateStrategy, + DefinitionStages.WithVulnerabilityScanningSettings { /** * Executes the create request. - * + * * @return the created resource. */ Cluster create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Cluster create(Context context); } - /** The stage of the Cluster definition allowing to specify tags. */ + /** + * The stage of the Cluster definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Cluster definition allowing to specify analyticsWorkspaceId. */ + /** + * The stage of the Cluster definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity for the resource.. + * + * @param identity The identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Cluster definition allowing to specify analyticsOutputSettings. + */ + interface WithAnalyticsOutputSettings { + /** + * Specifies the analyticsOutputSettings property: The settings for the log analytics workspace used for + * output of logs from this cluster.. + * + * @param analyticsOutputSettings The settings for the log analytics workspace used for output of logs from + * this cluster. + * @return the next definition stage. + */ + WithCreate withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings); + } + + /** + * The stage of the Cluster definition allowing to specify analyticsWorkspaceId. + */ interface WithAnalyticsWorkspaceId { /** - * Specifies the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be - * used for storing relevant logs.. - * - * @param analyticsWorkspaceId The resource ID of the Log Analytics Workspace that will be used for storing - * relevant logs. + * Specifies the analyticsWorkspaceId property: Field Deprecated. The resource ID of the Log Analytics + * Workspace that will be used for storing relevant logs.. + * + * @param analyticsWorkspaceId Field Deprecated. The resource ID of the Log Analytics Workspace that will be + * used for storing relevant logs. * @return the next definition stage. */ WithCreate withAnalyticsWorkspaceId(String analyticsWorkspaceId); } - /** The stage of the Cluster definition allowing to specify clusterLocation. */ + /** + * The stage of the Cluster definition allowing to specify clusterLocation. + */ interface WithClusterLocation { /** * Specifies the clusterLocation property: The customer-provided location information to identify where the * cluster resides.. - * + * * @param clusterLocation The customer-provided location information to identify where the cluster resides. * @return the next definition stage. */ WithCreate withClusterLocation(String clusterLocation); } - /** The stage of the Cluster definition allowing to specify clusterServicePrincipal. */ + /** + * The stage of the Cluster definition allowing to specify clusterServicePrincipal. + */ interface WithClusterServicePrincipal { /** - * Specifies the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the - * service principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation.. - * - * @param clusterServicePrincipal ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - *

The service principal to be used by the cluster during Arc Appliance installation. + * Specifies the clusterServicePrincipal property: The service principal to be used by the cluster during + * Arc Appliance installation.. + * + * @param clusterServicePrincipal The service principal to be used by the cluster during Arc Appliance + * installation. * @return the next definition stage. */ WithCreate withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal); } - /** The stage of the Cluster definition allowing to specify computeDeploymentThreshold. */ + /** + * The stage of the Cluster definition allowing to specify commandOutputSettings. + */ + interface WithCommandOutputSettings { + /** + * Specifies the commandOutputSettings property: The settings for commands run in this cluster, such as bare + * metal machine run read only commands and data extracts.. + * + * @param commandOutputSettings The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * @return the next definition stage. + */ + WithCreate withCommandOutputSettings(CommandOutputSettings commandOutputSettings); + } + + /** + * The stage of the Cluster definition allowing to specify computeDeploymentThreshold. + */ interface WithComputeDeploymentThreshold { /** - * Specifies the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node - * hardware and deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment - * validation and deployment.. - * - * @param computeDeploymentThreshold ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - *

The validation threshold indicating the allowable failures of compute machines during environment - * validation and deployment. + * Specifies the computeDeploymentThreshold property: The validation threshold indicating the allowable + * failures of compute machines during environment validation and deployment.. + * + * @param computeDeploymentThreshold The validation threshold indicating the allowable failures of compute + * machines during environment validation and deployment. * @return the next definition stage. */ WithCreate withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold); } - /** The stage of the Cluster definition allowing to specify computeRackDefinitions. */ + /** + * The stage of the Cluster definition allowing to specify computeRackDefinitions. + */ interface WithComputeRackDefinitions { /** * Specifies the computeRackDefinitions property: The list of rack definitions for the compute racks in a - * multi-rack cluster, or an empty list in a single-rack cluster.. - * - * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack cluster, - * or an empty list in a single-rack cluster. + * multi-rack + * cluster, or an empty list in a single-rack cluster.. + * + * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. * @return the next definition stage. */ WithCreate withComputeRackDefinitions(List computeRackDefinitions); } - /** The stage of the Cluster definition allowing to specify managedResourceGroupConfiguration. */ + /** + * The stage of the Cluster definition allowing to specify managedResourceGroupConfiguration. + */ interface WithManagedResourceGroupConfiguration { /** - * Specifies the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents - * the configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource.. - * - * @param managedResourceGroupConfiguration ManagedResourceGroupConfiguration represents the configuration - * of the resource group managed by Azure. - *

The configuration of the managed resource group associated with the resource. + * Specifies the managedResourceGroupConfiguration property: The configuration of the managed resource group + * associated with the resource.. + * + * @param managedResourceGroupConfiguration The configuration of the managed resource group associated with + * the resource. * @return the next definition stage. */ WithCreate withManagedResourceGroupConfiguration( ManagedResourceGroupConfiguration managedResourceGroupConfiguration); } + + /** + * The stage of the Cluster definition allowing to specify runtimeProtectionConfiguration. + */ + interface WithRuntimeProtectionConfiguration { + /** + * Specifies the runtimeProtectionConfiguration property: The settings for cluster runtime protection.. + * + * @param runtimeProtectionConfiguration The settings for cluster runtime protection. + * @return the next definition stage. + */ + WithCreate + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration); + } + + /** + * The stage of the Cluster definition allowing to specify secretArchive. + */ + interface WithSecretArchive { + /** + * Specifies the secretArchive property: The configuration for use of a key vault to store secrets for later + * retrieval by the operator.. + * + * @param secretArchive The configuration for use of a key vault to store secrets for later retrieval by the + * operator. + * @return the next definition stage. + */ + WithCreate withSecretArchive(ClusterSecretArchive secretArchive); + } + + /** + * The stage of the Cluster definition allowing to specify secretArchiveSettings. + */ + interface WithSecretArchiveSettings { + /** + * Specifies the secretArchiveSettings property: The settings for the secret archive used to hold + * credentials for the cluster.. + * + * @param secretArchiveSettings The settings for the secret archive used to hold credentials for the + * cluster. + * @return the next definition stage. + */ + WithCreate withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings); + } + + /** + * The stage of the Cluster definition allowing to specify updateStrategy. + */ + interface WithUpdateStrategy { + /** + * Specifies the updateStrategy property: The strategy for updating the cluster.. + * + * @param updateStrategy The strategy for updating the cluster. + * @return the next definition stage. + */ + WithCreate withUpdateStrategy(ClusterUpdateStrategy updateStrategy); + } + + /** + * The stage of the Cluster definition allowing to specify vulnerabilityScanningSettings. + */ + interface WithVulnerabilityScanningSettings { + /** + * Specifies the vulnerabilityScanningSettings property: The settings for how security vulnerability + * scanning is applied to the cluster.. + * + * @param vulnerabilityScanningSettings The settings for how security vulnerability scanning is applied to + * the cluster. + * @return the next definition stage. + */ + WithCreate withVulnerabilityScanningSettings(VulnerabilityScanningSettings vulnerabilityScanningSettings); + } } /** * Begins update for the Cluster resource. - * + * * @return the stage of resource update. */ Cluster.Update update(); - /** The template for Cluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithAggregatorOrSingleRackDefinition, + /** + * The template for Cluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, + UpdateStages.WithAggregatorOrSingleRackDefinition, UpdateStages.WithAnalyticsOutputSettings, UpdateStages.WithClusterLocation, UpdateStages.WithClusterServicePrincipal, - UpdateStages.WithComputeDeploymentThreshold, UpdateStages.WithComputeRackDefinitions { + UpdateStages.WithCommandOutputSettings, UpdateStages.WithComputeDeploymentThreshold, + UpdateStages.WithComputeRackDefinitions, UpdateStages.WithRuntimeProtectionConfiguration, + UpdateStages.WithSecretArchive, UpdateStages.WithSecretArchiveSettings, UpdateStages.WithUpdateStrategy, + UpdateStages.WithVulnerabilityScanningSettings { /** * Executes the update request. - * + * * @return the updated resource. */ Cluster apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Cluster apply(Context context); } - /** The Cluster update stages. */ + /** + * The Cluster update stages. + */ interface UpdateStages { - /** The stage of the Cluster update allowing to specify tags. */ + /** + * The stage of the Cluster update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Cluster update allowing to specify aggregatorOrSingleRackDefinition. */ + /** + * The stage of the Cluster update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity for the resource.. + * + * @param identity The identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Cluster update allowing to specify aggregatorOrSingleRackDefinition. + */ interface WithAggregatorOrSingleRackDefinition { /** - * Specifies the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the - * rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an - * aggregator rack in a multi-rack cluster.. - * - * @param aggregatorOrSingleRackDefinition RackDefinition represents details regarding the rack. - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an - * aggregator rack in a multi-rack cluster. + * Specifies the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect + * only a single rack in a single rack cluster, or an aggregator rack in a multi-rack cluster.. + * + * @param aggregatorOrSingleRackDefinition The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. * @return the next definition stage. */ Update withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition); } - /** The stage of the Cluster update allowing to specify clusterLocation. */ + /** + * The stage of the Cluster update allowing to specify analyticsOutputSettings. + */ + interface WithAnalyticsOutputSettings { + /** + * Specifies the analyticsOutputSettings property: The settings for the log analytics workspace used for + * output of logs from this cluster.. + * + * @param analyticsOutputSettings The settings for the log analytics workspace used for output of logs from + * this cluster. + * @return the next definition stage. + */ + Update withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings); + } + + /** + * The stage of the Cluster update allowing to specify clusterLocation. + */ interface WithClusterLocation { /** * Specifies the clusterLocation property: The customer-provided location information to identify where the * cluster resides.. - * + * * @param clusterLocation The customer-provided location information to identify where the cluster resides. * @return the next definition stage. */ Update withClusterLocation(String clusterLocation); } - /** The stage of the Cluster update allowing to specify clusterServicePrincipal. */ + /** + * The stage of the Cluster update allowing to specify clusterServicePrincipal. + */ interface WithClusterServicePrincipal { /** - * Specifies the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the - * service principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation.. - * - * @param clusterServicePrincipal ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - *

The service principal to be used by the cluster during Arc Appliance installation. + * Specifies the clusterServicePrincipal property: The service principal to be used by the cluster during + * Arc Appliance installation.. + * + * @param clusterServicePrincipal The service principal to be used by the cluster during Arc Appliance + * installation. * @return the next definition stage. */ Update withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal); } - /** The stage of the Cluster update allowing to specify computeDeploymentThreshold. */ + /** + * The stage of the Cluster update allowing to specify commandOutputSettings. + */ + interface WithCommandOutputSettings { + /** + * Specifies the commandOutputSettings property: The settings for commands run in this cluster, such as bare + * metal machine run read only commands and data extracts.. + * + * @param commandOutputSettings The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * @return the next definition stage. + */ + Update withCommandOutputSettings(CommandOutputSettings commandOutputSettings); + } + + /** + * The stage of the Cluster update allowing to specify computeDeploymentThreshold. + */ interface WithComputeDeploymentThreshold { /** - * Specifies the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node - * hardware and deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment - * validation and deployment.. - * - * @param computeDeploymentThreshold ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - *

The validation threshold indicating the allowable failures of compute machines during environment - * validation and deployment. + * Specifies the computeDeploymentThreshold property: The validation threshold indicating the allowable + * failures of compute machines during environment validation and deployment.. + * + * @param computeDeploymentThreshold The validation threshold indicating the allowable failures of compute + * machines during environment validation and deployment. * @return the next definition stage. */ Update withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold); } - /** The stage of the Cluster update allowing to specify computeRackDefinitions. */ + /** + * The stage of the Cluster update allowing to specify computeRackDefinitions. + */ interface WithComputeRackDefinitions { /** * Specifies the computeRackDefinitions property: The list of rack definitions for the compute racks in a - * multi-rack cluster, or an empty list in a single-rack cluster.. - * - * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack cluster, - * or an empty list in a single-rack cluster. + * multi-rack + * cluster, or an empty list in a single-rack cluster.. + * + * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. * @return the next definition stage. */ Update withComputeRackDefinitions(List computeRackDefinitions); } + + /** + * The stage of the Cluster update allowing to specify runtimeProtectionConfiguration. + */ + interface WithRuntimeProtectionConfiguration { + /** + * Specifies the runtimeProtectionConfiguration property: The settings for cluster runtime protection.. + * + * @param runtimeProtectionConfiguration The settings for cluster runtime protection. + * @return the next definition stage. + */ + Update withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration); + } + + /** + * The stage of the Cluster update allowing to specify secretArchive. + */ + interface WithSecretArchive { + /** + * Specifies the secretArchive property: The configuration for use of a key vault to store secrets for later + * retrieval by the operator.. + * + * @param secretArchive The configuration for use of a key vault to store secrets for later retrieval by the + * operator. + * @return the next definition stage. + */ + Update withSecretArchive(ClusterSecretArchive secretArchive); + } + + /** + * The stage of the Cluster update allowing to specify secretArchiveSettings. + */ + interface WithSecretArchiveSettings { + /** + * Specifies the secretArchiveSettings property: The settings for the secret archive used to hold + * credentials for the cluster.. + * + * @param secretArchiveSettings The settings for the secret archive used to hold credentials for the + * cluster. + * @return the next definition stage. + */ + Update withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings); + } + + /** + * The stage of the Cluster update allowing to specify updateStrategy. + */ + interface WithUpdateStrategy { + /** + * Specifies the updateStrategy property: The strategy for updating the cluster.. + * + * @param updateStrategy The strategy for updating the cluster. + * @return the next definition stage. + */ + Update withUpdateStrategy(ClusterUpdateStrategy updateStrategy); + } + + /** + * The stage of the Cluster update allowing to specify vulnerabilityScanningSettings. + */ + interface WithVulnerabilityScanningSettings { + /** + * Specifies the vulnerabilityScanningSettings property: The settings for how security vulnerability + * scanning is applied to the cluster.. + * + * @param vulnerabilityScanningSettings The settings for how security vulnerability scanning is applied to + * the cluster. + * @return the next definition stage. + */ + Update withVulnerabilityScanningSettings(VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings); + } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Cluster refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ Cluster refresh(Context context); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + OperationStatusResult + continueUpdateVersion(ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + OperationStatusResult continueUpdateVersion( + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context); + + /** + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @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 current status of an async operation. @@ -664,10 +997,10 @@ interface WithComputeRackDefinitions { OperationStatusResult deploy(); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param clusterDeployParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -677,11 +1010,38 @@ interface WithComputeRackDefinitions { */ OperationStatusResult deploy(ClusterDeployParameters clusterDeployParameters, Context context); + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @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 current status of an async operation. + */ + OperationStatusResult scanRuntime(); + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + OperationStatusResult scanRuntime(ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context); + /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param clusterUpdateVersionParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -692,9 +1052,9 @@ interface WithComputeRackDefinitions { /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param clusterUpdateVersionParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java index ef45a2b49f29f..3fa3393b9a81a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java @@ -5,54 +5,56 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. + */ @Immutable -public final class ClusterAvailableUpgradeVersion { +public final class ClusterAvailableUpgradeVersion implements JsonSerializable { /* * The indicator of whether the control plane will be impacted during the upgrade. */ - @JsonProperty(value = "controlImpact", access = JsonProperty.Access.WRITE_ONLY) private ControlImpact controlImpact; /* * The expected duration needed for this upgrade. */ - @JsonProperty(value = "expectedDuration", access = JsonProperty.Access.WRITE_ONLY) private String expectedDuration; /* * The impact description including the specific details and release notes. */ - @JsonProperty(value = "impactDescription", access = JsonProperty.Access.WRITE_ONLY) private String impactDescription; /* * The last date the version of the platform is supported. */ - @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) private String supportExpiryDate; /* * The target version this cluster will be upgraded to. */ - @JsonProperty(value = "targetClusterVersion", access = JsonProperty.Access.WRITE_ONLY) private String targetClusterVersion; /* * The indicator of whether the workload will be impacted during the upgrade. */ - @JsonProperty(value = "workloadImpact", access = JsonProperty.Access.WRITE_ONLY) private WorkloadImpact workloadImpact; - /** Creates an instance of ClusterAvailableUpgradeVersion class. */ + /** + * Creates an instance of ClusterAvailableUpgradeVersion class. + */ public ClusterAvailableUpgradeVersion() { } /** * Get the controlImpact property: The indicator of whether the control plane will be impacted during the upgrade. - * + * * @return the controlImpact value. */ public ControlImpact controlImpact() { @@ -61,7 +63,7 @@ public ControlImpact controlImpact() { /** * Get the expectedDuration property: The expected duration needed for this upgrade. - * + * * @return the expectedDuration value. */ public String expectedDuration() { @@ -70,7 +72,7 @@ public String expectedDuration() { /** * Get the impactDescription property: The impact description including the specific details and release notes. - * + * * @return the impactDescription value. */ public String impactDescription() { @@ -79,7 +81,7 @@ public String impactDescription() { /** * Get the supportExpiryDate property: The last date the version of the platform is supported. - * + * * @return the supportExpiryDate value. */ public String supportExpiryDate() { @@ -88,7 +90,7 @@ public String supportExpiryDate() { /** * Get the targetClusterVersion property: The target version this cluster will be upgraded to. - * + * * @return the targetClusterVersion value. */ public String targetClusterVersion() { @@ -97,7 +99,7 @@ public String targetClusterVersion() { /** * Get the workloadImpact property: The indicator of whether the workload will be impacted during the upgrade. - * + * * @return the workloadImpact value. */ public WorkloadImpact workloadImpact() { @@ -106,9 +108,57 @@ public WorkloadImpact workloadImpact() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableUpgradeVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableUpgradeVersion 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 ClusterAvailableUpgradeVersion. + */ + public static ClusterAvailableUpgradeVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableUpgradeVersion deserializedClusterAvailableUpgradeVersion + = new ClusterAvailableUpgradeVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("controlImpact".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.controlImpact + = ControlImpact.fromString(reader.getString()); + } else if ("expectedDuration".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.expectedDuration = reader.getString(); + } else if ("impactDescription".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.impactDescription = reader.getString(); + } else if ("supportExpiryDate".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.supportExpiryDate = reader.getString(); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.targetClusterVersion = reader.getString(); + } else if ("workloadImpact".equals(fieldName)) { + deserializedClusterAvailableUpgradeVersion.workloadImpact + = WorkloadImpact.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableUpgradeVersion; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java index 24ecfc585a7d5..16784f01a26fb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java @@ -5,32 +5,36 @@ package com.azure.resourcemanager.networkcloud.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; /** * ClusterAvailableVersion represents the cluster version that the cluster manager can be asked to create and manage. */ @Immutable -public final class ClusterAvailableVersion { +public final class ClusterAvailableVersion implements JsonSerializable { /* * The last date the version of the platform is supported. */ - @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) private String supportExpiryDate; /* * The version of the cluster to be deployed. */ - @JsonProperty(value = "targetClusterVersion", access = JsonProperty.Access.WRITE_ONLY) private String targetClusterVersion; - /** Creates an instance of ClusterAvailableVersion class. */ + /** + * Creates an instance of ClusterAvailableVersion class. + */ public ClusterAvailableVersion() { } /** * Get the supportExpiryDate property: The last date the version of the platform is supported. - * + * * @return the supportExpiryDate value. */ public String supportExpiryDate() { @@ -39,7 +43,7 @@ public String supportExpiryDate() { /** * Get the targetClusterVersion property: The version of the cluster to be deployed. - * + * * @return the targetClusterVersion value. */ public String targetClusterVersion() { @@ -48,9 +52,46 @@ public String targetClusterVersion() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAvailableVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAvailableVersion 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 ClusterAvailableVersion. + */ + public static ClusterAvailableVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAvailableVersion deserializedClusterAvailableVersion = new ClusterAvailableVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportExpiryDate".equals(fieldName)) { + deserializedClusterAvailableVersion.supportExpiryDate = reader.getString(); + } else if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterAvailableVersion.targetClusterVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAvailableVersion; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java index 9b5c709ead36a..734449c4ad7da 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java @@ -5,67 +5,67 @@ package com.azure.resourcemanager.networkcloud.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; -/** ClusterCapacity represents various details regarding compute capacity. */ +/** + * ClusterCapacity represents various details regarding compute capacity. + */ @Fluent -public final class ClusterCapacity { +public final class ClusterCapacity implements JsonSerializable { /* - * The remaining appliance-based storage in GB available for workload use. + * The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. */ - @JsonProperty(value = "availableApplianceStorageGB") private Long availableApplianceStorageGB; /* * The remaining number of cores that are available in this cluster for workload use. */ - @JsonProperty(value = "availableCoreCount") private Long availableCoreCount; /* - * The remaining machine or host-based storage in GB available for workload use. + * The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. */ - @JsonProperty(value = "availableHostStorageGB") private Long availableHostStorageGB; /* - * The remaining memory in GB that are available in this cluster for workload use. + * The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. */ - @JsonProperty(value = "availableMemoryGB") private Long availableMemoryGB; /* - * The total appliance-based storage in GB supported by this cluster for workload use. + * The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. */ - @JsonProperty(value = "totalApplianceStorageGB") private Long totalApplianceStorageGB; /* * The total number of cores that are supported by this cluster for workload use. */ - @JsonProperty(value = "totalCoreCount") private Long totalCoreCount; /* - * The total machine or host-based storage in GB supported by this cluster for workload use. + * The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. */ - @JsonProperty(value = "totalHostStorageGB") private Long totalHostStorageGB; /* - * The total memory supported by this cluster for workload use. + * The total memory supported by this cluster for workload use. Measured in gibibytes. */ - @JsonProperty(value = "totalMemoryGB") private Long totalMemoryGB; - /** Creates an instance of ClusterCapacity class. */ + /** + * Creates an instance of ClusterCapacity class. + */ public ClusterCapacity() { } /** * Get the availableApplianceStorageGB property: The remaining appliance-based storage in GB available for workload - * use. - * + * use. Measured in gibibytes. + * * @return the availableApplianceStorageGB value. */ public Long availableApplianceStorageGB() { @@ -74,8 +74,8 @@ public Long availableApplianceStorageGB() { /** * Set the availableApplianceStorageGB property: The remaining appliance-based storage in GB available for workload - * use. - * + * use. Measured in gibibytes. + * * @param availableApplianceStorageGB the availableApplianceStorageGB value to set. * @return the ClusterCapacity object itself. */ @@ -87,7 +87,7 @@ public ClusterCapacity withAvailableApplianceStorageGB(Long availableApplianceSt /** * Get the availableCoreCount property: The remaining number of cores that are available in this cluster for * workload use. - * + * * @return the availableCoreCount value. */ public Long availableCoreCount() { @@ -97,7 +97,7 @@ public Long availableCoreCount() { /** * Set the availableCoreCount property: The remaining number of cores that are available in this cluster for * workload use. - * + * * @param availableCoreCount the availableCoreCount value to set. * @return the ClusterCapacity object itself. */ @@ -108,8 +108,8 @@ public ClusterCapacity withAvailableCoreCount(Long availableCoreCount) { /** * Get the availableHostStorageGB property: The remaining machine or host-based storage in GB available for workload - * use. - * + * use. Measured in gibibytes. + * * @return the availableHostStorageGB value. */ public Long availableHostStorageGB() { @@ -118,8 +118,8 @@ public Long availableHostStorageGB() { /** * Set the availableHostStorageGB property: The remaining machine or host-based storage in GB available for workload - * use. - * + * use. Measured in gibibytes. + * * @param availableHostStorageGB the availableHostStorageGB value to set. * @return the ClusterCapacity object itself. */ @@ -130,8 +130,8 @@ public ClusterCapacity withAvailableHostStorageGB(Long availableHostStorageGB) { /** * Get the availableMemoryGB property: The remaining memory in GB that are available in this cluster for workload - * use. - * + * use. Measured in gibibytes. + * * @return the availableMemoryGB value. */ public Long availableMemoryGB() { @@ -140,8 +140,8 @@ public Long availableMemoryGB() { /** * Set the availableMemoryGB property: The remaining memory in GB that are available in this cluster for workload - * use. - * + * use. Measured in gibibytes. + * * @param availableMemoryGB the availableMemoryGB value to set. * @return the ClusterCapacity object itself. */ @@ -152,8 +152,8 @@ public ClusterCapacity withAvailableMemoryGB(Long availableMemoryGB) { /** * Get the totalApplianceStorageGB property: The total appliance-based storage in GB supported by this cluster for - * workload use. - * + * workload use. Measured in gibibytes. + * * @return the totalApplianceStorageGB value. */ public Long totalApplianceStorageGB() { @@ -162,8 +162,8 @@ public Long totalApplianceStorageGB() { /** * Set the totalApplianceStorageGB property: The total appliance-based storage in GB supported by this cluster for - * workload use. - * + * workload use. Measured in gibibytes. + * * @param totalApplianceStorageGB the totalApplianceStorageGB value to set. * @return the ClusterCapacity object itself. */ @@ -174,7 +174,7 @@ public ClusterCapacity withTotalApplianceStorageGB(Long totalApplianceStorageGB) /** * Get the totalCoreCount property: The total number of cores that are supported by this cluster for workload use. - * + * * @return the totalCoreCount value. */ public Long totalCoreCount() { @@ -183,7 +183,7 @@ public Long totalCoreCount() { /** * Set the totalCoreCount property: The total number of cores that are supported by this cluster for workload use. - * + * * @param totalCoreCount the totalCoreCount value to set. * @return the ClusterCapacity object itself. */ @@ -194,8 +194,8 @@ public ClusterCapacity withTotalCoreCount(Long totalCoreCount) { /** * Get the totalHostStorageGB property: The total machine or host-based storage in GB supported by this cluster for - * workload use. - * + * workload use. Measured in gibibytes. + * * @return the totalHostStorageGB value. */ public Long totalHostStorageGB() { @@ -204,8 +204,8 @@ public Long totalHostStorageGB() { /** * Set the totalHostStorageGB property: The total machine or host-based storage in GB supported by this cluster for - * workload use. - * + * workload use. Measured in gibibytes. + * * @param totalHostStorageGB the totalHostStorageGB value to set. * @return the ClusterCapacity object itself. */ @@ -215,8 +215,9 @@ public ClusterCapacity withTotalHostStorageGB(Long totalHostStorageGB) { } /** - * Get the totalMemoryGB property: The total memory supported by this cluster for workload use. - * + * Get the totalMemoryGB property: The total memory supported by this cluster for workload use. Measured in + * gibibytes. + * * @return the totalMemoryGB value. */ public Long totalMemoryGB() { @@ -224,8 +225,9 @@ public Long totalMemoryGB() { } /** - * Set the totalMemoryGB property: The total memory supported by this cluster for workload use. - * + * Set the totalMemoryGB property: The total memory supported by this cluster for workload use. Measured in + * gibibytes. + * * @param totalMemoryGB the totalMemoryGB value to set. * @return the ClusterCapacity object itself. */ @@ -236,9 +238,66 @@ public ClusterCapacity withTotalMemoryGB(Long totalMemoryGB) { /** * 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.writeNumberField("availableApplianceStorageGB", this.availableApplianceStorageGB); + jsonWriter.writeNumberField("availableCoreCount", this.availableCoreCount); + jsonWriter.writeNumberField("availableHostStorageGB", this.availableHostStorageGB); + jsonWriter.writeNumberField("availableMemoryGB", this.availableMemoryGB); + jsonWriter.writeNumberField("totalApplianceStorageGB", this.totalApplianceStorageGB); + jsonWriter.writeNumberField("totalCoreCount", this.totalCoreCount); + jsonWriter.writeNumberField("totalHostStorageGB", this.totalHostStorageGB); + jsonWriter.writeNumberField("totalMemoryGB", this.totalMemoryGB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterCapacity 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 ClusterCapacity. + */ + public static ClusterCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterCapacity deserializedClusterCapacity = new ClusterCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availableApplianceStorageGB".equals(fieldName)) { + deserializedClusterCapacity.availableApplianceStorageGB = reader.getNullable(JsonReader::getLong); + } else if ("availableCoreCount".equals(fieldName)) { + deserializedClusterCapacity.availableCoreCount = reader.getNullable(JsonReader::getLong); + } else if ("availableHostStorageGB".equals(fieldName)) { + deserializedClusterCapacity.availableHostStorageGB = reader.getNullable(JsonReader::getLong); + } else if ("availableMemoryGB".equals(fieldName)) { + deserializedClusterCapacity.availableMemoryGB = reader.getNullable(JsonReader::getLong); + } else if ("totalApplianceStorageGB".equals(fieldName)) { + deserializedClusterCapacity.totalApplianceStorageGB = reader.getNullable(JsonReader::getLong); + } else if ("totalCoreCount".equals(fieldName)) { + deserializedClusterCapacity.totalCoreCount = reader.getNullable(JsonReader::getLong); + } else if ("totalHostStorageGB".equals(fieldName)) { + deserializedClusterCapacity.totalHostStorageGB = reader.getNullable(JsonReader::getLong); + } else if ("totalMemoryGB".equals(fieldName)) { + deserializedClusterCapacity.totalMemoryGB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterCapacity; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java index ef5ca2ebecfed..b4ce918016260 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java @@ -5,23 +5,35 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The latest heartbeat status between the cluster manager and the cluster. */ +/** + * The latest heartbeat status between the cluster manager and the cluster. + */ public final class ClusterConnectionStatus extends ExpandableStringEnum { - /** Static value Connected for ClusterConnectionStatus. */ + /** + * Static value Connected for ClusterConnectionStatus. + */ public static final ClusterConnectionStatus CONNECTED = fromString("Connected"); - /** Static value Timeout for ClusterConnectionStatus. */ + /** + * Static value Disconnected for ClusterConnectionStatus. + */ + public static final ClusterConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Static value Timeout for ClusterConnectionStatus. + */ public static final ClusterConnectionStatus TIMEOUT = fromString("Timeout"); - /** Static value Undefined for ClusterConnectionStatus. */ + /** + * Static value Undefined for ClusterConnectionStatus. + */ public static final ClusterConnectionStatus UNDEFINED = fromString("Undefined"); /** * Creates a new instance of ClusterConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +42,17 @@ public ClusterConnectionStatus() { /** * Creates or finds a ClusterConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterConnectionStatus. */ - @JsonCreator public static ClusterConnectionStatus fromString(String name) { return fromString(name, ClusterConnectionStatus.class); } /** * Gets known ClusterConnectionStatus values. - * + * * @return known ClusterConnectionStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionMachineGroupTargetingMode.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionMachineGroupTargetingMode.java new file mode 100644 index 0000000000000..b4cd2efb1f764 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionMachineGroupTargetingMode.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode by which the cluster will target the next grouping of servers to continue the update. + */ +public final class ClusterContinueUpdateVersionMachineGroupTargetingMode + extends ExpandableStringEnum { + /** + * Static value AlphaByRack for ClusterContinueUpdateVersionMachineGroupTargetingMode. + */ + public static final ClusterContinueUpdateVersionMachineGroupTargetingMode ALPHA_BY_RACK = fromString("AlphaByRack"); + + /** + * Creates a new instance of ClusterContinueUpdateVersionMachineGroupTargetingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterContinueUpdateVersionMachineGroupTargetingMode() { + } + + /** + * Creates or finds a ClusterContinueUpdateVersionMachineGroupTargetingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterContinueUpdateVersionMachineGroupTargetingMode. + */ + public static ClusterContinueUpdateVersionMachineGroupTargetingMode fromString(String name) { + return fromString(name, ClusterContinueUpdateVersionMachineGroupTargetingMode.class); + } + + /** + * Gets known ClusterContinueUpdateVersionMachineGroupTargetingMode values. + * + * @return known ClusterContinueUpdateVersionMachineGroupTargetingMode values. + */ + public static Collection values() { + return values(ClusterContinueUpdateVersionMachineGroupTargetingMode.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionParameters.java new file mode 100644 index 0000000000000..146f51948e158 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterContinueUpdateVersionParameters.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster + * version. + */ +@Fluent +public final class ClusterContinueUpdateVersionParameters + implements JsonSerializable { + /* + * The mode by which the cluster will target the next grouping of servers to continue the update. + */ + private ClusterContinueUpdateVersionMachineGroupTargetingMode machineGroupTargetingMode; + + /** + * Creates an instance of ClusterContinueUpdateVersionParameters class. + */ + public ClusterContinueUpdateVersionParameters() { + } + + /** + * Get the machineGroupTargetingMode property: The mode by which the cluster will target the next grouping of + * servers to continue the update. + * + * @return the machineGroupTargetingMode value. + */ + public ClusterContinueUpdateVersionMachineGroupTargetingMode machineGroupTargetingMode() { + return this.machineGroupTargetingMode; + } + + /** + * Set the machineGroupTargetingMode property: The mode by which the cluster will target the next grouping of + * servers to continue the update. + * + * @param machineGroupTargetingMode the machineGroupTargetingMode value to set. + * @return the ClusterContinueUpdateVersionParameters object itself. + */ + public ClusterContinueUpdateVersionParameters + withMachineGroupTargetingMode(ClusterContinueUpdateVersionMachineGroupTargetingMode machineGroupTargetingMode) { + this.machineGroupTargetingMode = machineGroupTargetingMode; + 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("machineGroupTargetingMode", + this.machineGroupTargetingMode == null ? null : this.machineGroupTargetingMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterContinueUpdateVersionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterContinueUpdateVersionParameters 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 ClusterContinueUpdateVersionParameters. + */ + public static ClusterContinueUpdateVersionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterContinueUpdateVersionParameters deserializedClusterContinueUpdateVersionParameters + = new ClusterContinueUpdateVersionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("machineGroupTargetingMode".equals(fieldName)) { + deserializedClusterContinueUpdateVersionParameters.machineGroupTargetingMode + = ClusterContinueUpdateVersionMachineGroupTargetingMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterContinueUpdateVersionParameters; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java index 9d81e763644eb..6de1851575dd4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.networkcloud.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; -/** ClusterDeployParameters represents the body of the request to deploy cluster. */ +/** + * ClusterDeployParameters represents the body of the request to deploy cluster. + */ @Fluent -public final class ClusterDeployParameters { +public final class ClusterDeployParameters implements JsonSerializable { /* * The names of bare metal machines in the cluster that should be skipped during environment validation. */ - @JsonProperty(value = "skipValidationsForMachines") private List skipValidationsForMachines; - /** Creates an instance of ClusterDeployParameters class. */ + /** + * Creates an instance of ClusterDeployParameters class. + */ public ClusterDeployParameters() { } /** * Get the skipValidationsForMachines property: The names of bare metal machines in the cluster that should be * skipped during environment validation. - * + * * @return the skipValidationsForMachines value. */ public List skipValidationsForMachines() { @@ -34,7 +41,7 @@ public List skipValidationsForMachines() { /** * Set the skipValidationsForMachines property: The names of bare metal machines in the cluster that should be * skipped during environment validation. - * + * * @param skipValidationsForMachines the skipValidationsForMachines value to set. * @return the ClusterDeployParameters object itself. */ @@ -45,9 +52,47 @@ public ClusterDeployParameters withSkipValidationsForMachines(List skipV /** * 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.writeArrayField("skipValidationsForMachines", this.skipValidationsForMachines, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterDeployParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterDeployParameters 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 ClusterDeployParameters. + */ + public static ClusterDeployParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterDeployParameters deserializedClusterDeployParameters = new ClusterDeployParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skipValidationsForMachines".equals(fieldName)) { + List skipValidationsForMachines = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterDeployParameters.skipValidationsForMachines = skipValidationsForMachines; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterDeployParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java index 784dbdd6ce9c4..7328a86d237e1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java @@ -5,38 +5,60 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current detailed status of the cluster. */ +/** + * The current detailed status of the cluster. + */ public final class ClusterDetailedStatus extends ExpandableStringEnum { - /** Static value PendingDeployment for ClusterDetailedStatus. */ + /** + * Static value PendingDeployment for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus PENDING_DEPLOYMENT = fromString("PendingDeployment"); - /** Static value Deploying for ClusterDetailedStatus. */ + /** + * Static value Deploying for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus DEPLOYING = fromString("Deploying"); - /** Static value Running for ClusterDetailedStatus. */ + /** + * Static value Running for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus RUNNING = fromString("Running"); - /** Static value Updating for ClusterDetailedStatus. */ + /** + * Static value Updating for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus UPDATING = fromString("Updating"); - /** Static value Degraded for ClusterDetailedStatus. */ + /** + * Static value UpdatePaused for ClusterDetailedStatus. + */ + public static final ClusterDetailedStatus UPDATE_PAUSED = fromString("UpdatePaused"); + + /** + * Static value Degraded for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus DEGRADED = fromString("Degraded"); - /** Static value Deleting for ClusterDetailedStatus. */ + /** + * Static value Deleting for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus DELETING = fromString("Deleting"); - /** Static value Disconnected for ClusterDetailedStatus. */ + /** + * Static value Disconnected for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus DISCONNECTED = fromString("Disconnected"); - /** Static value Failed for ClusterDetailedStatus. */ + /** + * Static value Failed for ClusterDetailedStatus. + */ public static final ClusterDetailedStatus FAILED = fromString("Failed"); /** * Creates a new instance of ClusterDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +67,17 @@ public ClusterDetailedStatus() { /** * Creates or finds a ClusterDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterDetailedStatus. */ - @JsonCreator public static ClusterDetailedStatus fromString(String name) { return fromString(name, ClusterDetailedStatus.class); } /** * Gets known ClusterDetailedStatus values. - * + * * @return known ClusterDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java index 422d39b351df4..ef7d63f5b1884 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ClusterList represents a list of clusters. */ +/** + * ClusterList represents a list of clusters. + */ @Fluent -public final class ClusterList { +public final class ClusterList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of clusters. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ClusterList class. */ + /** + * Creates an instance of ClusterList class. + */ public ClusterList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the ClusterList object itself. */ @@ -50,7 +56,7 @@ public ClusterList withNextLink(String nextLink) { /** * Get the value property: The list of clusters. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of clusters. - * + * * @param value the value value to set. * @return the ClusterList object itself. */ @@ -70,7 +76,7 @@ public ClusterList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterList 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 ClusterList. + */ + public static ClusterList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterList deserializedClusterList = new ClusterList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedClusterList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterInner.fromJson(reader1)); + deserializedClusterList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java index 82e00f7cae673..445595c9c0b15 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java @@ -11,46 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of ClusterManager. */ +/** + * An immutable client-side representation of ClusterManager. + */ public interface ClusterManager { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); + /** + * Gets the identity property: The identity of the cluster manager. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -58,7 +67,7 @@ public interface ClusterManager { /** * Gets the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs * collection. - * + * * @return the analyticsWorkspaceId value. */ String analyticsWorkspaceId(); @@ -67,7 +76,7 @@ public interface ClusterManager { * Gets the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The Azure availability zones within the region that * will be used to support the cluster manager resource. - * + * * @return the availabilityZones value. */ List availabilityZones(); @@ -75,7 +84,7 @@ public interface ClusterManager { /** * Gets the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in * clusterVersion property of a cluster resource. - * + * * @return the clusterVersions value. */ List clusterVersions(); @@ -83,14 +92,14 @@ public interface ClusterManager { /** * Gets the detailedStatus property: The detailed status that provides additional information about the cluster * manager. - * + * * @return the detailedStatus value. */ ClusterManagerDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -98,35 +107,31 @@ public interface ClusterManager { /** * Gets the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with * the cluster manager. - * + * * @return the fabricControllerId value. */ String fabricControllerId(); /** - * Gets the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Gets the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ ManagedResourceGroupConfiguration managedResourceGroupConfiguration(); /** - * Gets the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location (custom location) that represents the cluster manager's control plane location. This - * extended location is used when creating cluster and rack manifest resources. - * + * Gets the managerExtendedLocation property: The extended location (custom location) that represents the cluster + * manager's control plane location. This extended location is used when creating cluster and rack manifest + * resources. + * * @return the managerExtendedLocation value. */ ExtendedLocation managerExtendedLocation(); /** * Gets the provisioningState property: The provisioning state of the cluster manager. - * + * * @return the provisioningState value. */ ClusterManagerProvisioningState provisioningState(); @@ -135,55 +140,63 @@ public interface ClusterManager { * Gets the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the * cluster manager resource. - * + * * @return the vmSize value. */ String vmSize(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner object. - * + * * @return the inner object. */ ClusterManagerInner innerModel(); - /** The entirety of the ClusterManager definition. */ + /** + * The entirety of the ClusterManager definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithFabricControllerId, DefinitionStages.WithCreate { } - /** The ClusterManager definition stages. */ + /** + * The ClusterManager definition stages. + */ interface DefinitionStages { - /** The first stage of the ClusterManager definition. */ + /** + * The first stage of the ClusterManager definition. + */ interface Blank extends WithLocation { } - /** The stage of the ClusterManager definition allowing to specify location. */ + /** + * The stage of the ClusterManager definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -191,32 +204,36 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the ClusterManager definition allowing to specify parent resource. */ + /** + * The stage of the ClusterManager definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithFabricControllerId withExistingResourceGroup(String resourceGroupName); } - /** The stage of the ClusterManager definition allowing to specify fabricControllerId. */ + /** + * The stage of the ClusterManager definition allowing to specify fabricControllerId. + */ interface WithFabricControllerId { /** * Specifies the fabricControllerId property: The resource ID of the fabric controller that has one to one * mapping with the cluster manager.. - * + * * @param fabricControllerId The resource ID of the fabric controller that has one to one mapping with the - * cluster manager. + * cluster manager. * @return the next definition stage. */ WithCreate withFabricControllerId(String fabricControllerId); @@ -226,91 +243,111 @@ interface WithFabricControllerId { * The stage of the ClusterManager definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAnalyticsWorkspaceId, - DefinitionStages.WithAvailabilityZones, DefinitionStages.WithManagedResourceGroupConfiguration, - DefinitionStages.WithVmSize { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithAnalyticsWorkspaceId, DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithManagedResourceGroupConfiguration, DefinitionStages.WithVmSize { /** * Executes the create request. - * + * * @return the created resource. */ ClusterManager create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ClusterManager create(Context context); } - /** The stage of the ClusterManager definition allowing to specify tags. */ + /** + * The stage of the ClusterManager definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ClusterManager definition allowing to specify analyticsWorkspaceId. */ + /** + * The stage of the ClusterManager definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the cluster manager.. + * + * @param identity The identity of the cluster manager. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the ClusterManager definition allowing to specify analyticsWorkspaceId. + */ interface WithAnalyticsWorkspaceId { /** * Specifies the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used * for the logs collection.. - * + * * @param analyticsWorkspaceId The resource ID of the Log Analytics workspace that is used for the logs - * collection. + * collection. * @return the next definition stage. */ WithCreate withAnalyticsWorkspaceId(String analyticsWorkspaceId); } - /** The stage of the ClusterManager definition allowing to specify availabilityZones. */ + /** + * The stage of the ClusterManager definition allowing to specify availabilityZones. + */ interface WithAvailabilityZones { /** * Specifies the availabilityZones property: Field deprecated, this value will no longer influence the * cluster manager allocation process and will be removed in a future version. The Azure availability zones * within the region that will be used to support the cluster manager resource.. - * + * * @param availabilityZones Field deprecated, this value will no longer influence the cluster manager - * allocation process and will be removed in a future version. The Azure availability zones within the - * region that will be used to support the cluster manager resource. + * allocation process and will be removed in a future version. The Azure availability zones within the + * region that will be used to support the cluster manager resource. * @return the next definition stage. */ WithCreate withAvailabilityZones(List availabilityZones); } - /** The stage of the ClusterManager definition allowing to specify managedResourceGroupConfiguration. */ + /** + * The stage of the ClusterManager definition allowing to specify managedResourceGroupConfiguration. + */ interface WithManagedResourceGroupConfiguration { /** - * Specifies the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents - * the configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource.. - * - * @param managedResourceGroupConfiguration ManagedResourceGroupConfiguration represents the configuration - * of the resource group managed by Azure. - *

The configuration of the managed resource group associated with the resource. + * Specifies the managedResourceGroupConfiguration property: The configuration of the managed resource group + * associated with the resource.. + * + * @param managedResourceGroupConfiguration The configuration of the managed resource group associated with + * the resource. * @return the next definition stage. */ WithCreate withManagedResourceGroupConfiguration( ManagedResourceGroupConfiguration managedResourceGroupConfiguration); } - /** The stage of the ClusterManager definition allowing to specify vmSize. */ + /** + * The stage of the ClusterManager definition allowing to specify vmSize. + */ interface WithVmSize { /** * Specifies the vmSize property: Field deprecated, this value will no longer influence the cluster manager * allocation process and will be removed in a future version. The size of the Azure virtual machines to use * for hosting the cluster manager resource.. - * + * * @param vmSize Field deprecated, this value will no longer influence the cluster manager allocation - * process and will be removed in a future version. The size of the Azure virtual machines to use for - * hosting the cluster manager resource. + * process and will be removed in a future version. The size of the Azure virtual machines to use for + * hosting the cluster manager resource. * @return the next definition stage. */ WithCreate withVmSize(String vmSize); @@ -319,53 +356,72 @@ interface WithVmSize { /** * Begins update for the ClusterManager resource. - * + * * @return the stage of resource update. */ ClusterManager.Update update(); - /** The template for ClusterManager update. */ - interface Update extends UpdateStages.WithTags { + /** + * The template for ClusterManager update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. - * + * * @return the updated resource. */ ClusterManager apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ClusterManager apply(Context context); } - /** The ClusterManager update stages. */ + /** + * The ClusterManager update stages. + */ interface UpdateStages { - /** The stage of the ClusterManager update allowing to specify tags. */ + /** + * The stage of the ClusterManager update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } + + /** + * The stage of the ClusterManager update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity for the resource.. + * + * @param identity The identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ClusterManager refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java index ca0ae8686e85a..aa9492cdf5de8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The latest connectivity status between cluster manager and the cluster. */ +/** + * The latest connectivity status between cluster manager and the cluster. + */ public final class ClusterManagerConnectionStatus extends ExpandableStringEnum { - /** Static value Connected for ClusterManagerConnectionStatus. */ + /** + * Static value Connected for ClusterManagerConnectionStatus. + */ public static final ClusterManagerConnectionStatus CONNECTED = fromString("Connected"); - /** Static value Unreachable for ClusterManagerConnectionStatus. */ + /** + * Static value Unreachable for ClusterManagerConnectionStatus. + */ public static final ClusterManagerConnectionStatus UNREACHABLE = fromString("Unreachable"); /** * Creates a new instance of ClusterManagerConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ClusterManagerConnectionStatus() { /** * Creates or finds a ClusterManagerConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterManagerConnectionStatus. */ - @JsonCreator public static ClusterManagerConnectionStatus fromString(String name) { return fromString(name, ClusterManagerConnectionStatus.class); } /** * Gets known ClusterManagerConnectionStatus values. - * + * * @return known ClusterManagerConnectionStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java index da7035976e3b0..31868c474ac72 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The detailed status that provides additional information about the cluster manager. */ +/** + * The detailed status that provides additional information about the cluster manager. + */ public final class ClusterManagerDetailedStatus extends ExpandableStringEnum { - /** Static value Error for ClusterManagerDetailedStatus. */ + /** + * Static value Error for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus ERROR = fromString("Error"); - /** Static value Available for ClusterManagerDetailedStatus. */ + /** + * Static value Available for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for ClusterManagerDetailedStatus. */ + /** + * Static value Provisioning for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus PROVISIONING = fromString("Provisioning"); - /** Static value ProvisioningFailed for ClusterManagerDetailedStatus. */ + /** + * Static value ProvisioningFailed for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus PROVISIONING_FAILED = fromString("ProvisioningFailed"); - /** Static value Updating for ClusterManagerDetailedStatus. */ + /** + * Static value Updating for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus UPDATING = fromString("Updating"); - /** Static value UpdateFailed for ClusterManagerDetailedStatus. */ + /** + * Static value UpdateFailed for ClusterManagerDetailedStatus. + */ public static final ClusterManagerDetailedStatus UPDATE_FAILED = fromString("UpdateFailed"); /** * Creates a new instance of ClusterManagerDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public ClusterManagerDetailedStatus() { /** * Creates or finds a ClusterManagerDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterManagerDetailedStatus. */ - @JsonCreator public static ClusterManagerDetailedStatus fromString(String name) { return fromString(name, ClusterManagerDetailedStatus.class); } /** * Gets known ClusterManagerDetailedStatus values. - * + * * @return known ClusterManagerDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java index 43391369cc548..0e5c75dd77e99 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ClusterManagerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ClusterManagerList represents a list of cluster manager objects. */ +/** + * ClusterManagerList represents a list of cluster manager objects. + */ @Fluent -public final class ClusterManagerList { +public final class ClusterManagerList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of cluster managers. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ClusterManagerList class. */ + /** + * Creates an instance of ClusterManagerList class. + */ public ClusterManagerList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the ClusterManagerList object itself. */ @@ -50,7 +56,7 @@ public ClusterManagerList withNextLink(String nextLink) { /** * Get the value property: The list of cluster managers. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of cluster managers. - * + * * @param value the value value to set. * @return the ClusterManagerList object itself. */ @@ -70,7 +76,7 @@ public ClusterManagerList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterManagerList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterManagerList 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 ClusterManagerList. + */ + public static ClusterManagerList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterManagerList deserializedClusterManagerList = new ClusterManagerList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedClusterManagerList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterManagerInner.fromJson(reader1)); + deserializedClusterManagerList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterManagerList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java index 301e4afb633df..08e10bcf757bc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java @@ -5,27 +5,57 @@ package com.azure.resourcemanager.networkcloud.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; -/** ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. */ +/** + * ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + */ @Fluent -public final class ClusterManagerPatchParameters { +public final class ClusterManagerPatchParameters implements JsonSerializable { + /* + * The identity for the resource. + */ + private ManagedServiceIdentity identity; + /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ClusterManagerPatchParameters class. */ + /** + * Creates an instance of ClusterManagerPatchParameters class. + */ public ClusterManagerPatchParameters() { } + /** + * Get the identity property: The identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity for the resource. + * + * @param identity the identity value to set. + * @return the ClusterManagerPatchParameters object itself. + */ + public ClusterManagerPatchParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +64,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the ClusterManagerPatchParameters object itself. */ @@ -45,9 +75,53 @@ public ClusterManagerPatchParameters withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterManagerPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterManagerPatchParameters 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 ClusterManagerPatchParameters. + */ + public static ClusterManagerPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterManagerPatchParameters deserializedClusterManagerPatchParameters + = new ClusterManagerPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedClusterManagerPatchParameters.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterManagerPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterManagerPatchParameters; + }); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java index dcc182b593c67..cc2eb1f88796a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the cluster manager. */ +/** + * The provisioning state of the cluster manager. + */ public final class ClusterManagerProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ClusterManagerProvisioningState. */ + /** + * Static value Succeeded for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ClusterManagerProvisioningState. */ + /** + * Static value Failed for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ClusterManagerProvisioningState. */ + /** + * Static value Canceled for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for ClusterManagerProvisioningState. */ + /** + * Static value Provisioning for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for ClusterManagerProvisioningState. */ + /** + * Static value Accepted for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Updating for ClusterManagerProvisioningState. */ + /** + * Static value Updating for ClusterManagerProvisioningState. + */ public static final ClusterManagerProvisioningState UPDATING = fromString("Updating"); /** * Creates a new instance of ClusterManagerProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public ClusterManagerProvisioningState() { /** * Creates or finds a ClusterManagerProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterManagerProvisioningState. */ - @JsonCreator public static ClusterManagerProvisioningState fromString(String name) { return fromString(name, ClusterManagerProvisioningState.class); } /** * Gets known ClusterManagerProvisioningState values. - * + * * @return known ClusterManagerProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java index 4a62bb7e565b4..780a3d41e0ade 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ClusterManagers. */ +/** + * Resource collection API of ClusterManagers. + */ public interface ClusterManagers { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface ClusterManagers { /** * List cluster managers in the subscription. - * - *

Get a list of cluster managers in the provided subscription. - * + * + * Get a list of cluster managers in the provided subscription. + * * @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. @@ -36,38 +38,38 @@ public interface ClusterManagers { /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List cluster managers in the resource group. - * - *

Get a list of cluster managers in the provided resource group. - * + * + * Get a list of cluster managers in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of cluster managers in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of cluster managers in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @param context The context to associate with this operation. @@ -81,9 +83,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,36 +97,38 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String clusterManagerName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String clusterManagerName); /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterManagerName The name of the cluster manager. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterManagerName, Context context); + OperationStatusResult delete(String resourceGroupName, String clusterManagerName, Context context); /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -135,9 +139,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the cluster manager. - * - *

Get the properties of the provided cluster manager. - * + * + * Get the properties of the provided cluster manager. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -149,32 +153,34 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the cluster manager. - * - *

Delete the provided cluster manager. - * + * + * Delete the provided cluster manager. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new ClusterManager resource. - * + * * @param name resource name. * @return the first stage of the new ClusterManager definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java index 4c271bdf0c57d..575c8fd242623 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java @@ -11,77 +11,76 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of ClusterMetricsConfiguration. */ +/** + * An immutable client-side representation of ClusterMetricsConfiguration. + */ public interface ClusterMetricsConfiguration { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @return the collectionInterval value. */ long collectionInterval(); /** * Gets the detailedStatus property: The more detailed status of the metrics configuration. - * + * * @return the detailedStatus value. */ ClusterMetricsConfigurationDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -89,7 +88,7 @@ public interface ClusterMetricsConfiguration { /** * Gets the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the * moment. - * + * * @return the disabledMetrics value. */ List disabledMetrics(); @@ -97,63 +96,71 @@ public interface ClusterMetricsConfiguration { /** * Gets the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @return the enabledMetrics value. */ List enabledMetrics(); /** * Gets the provisioningState property: The provisioning state of the metrics configuration. - * + * * @return the provisioningState value. */ ClusterMetricsConfigurationProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner object. - * + * * @return the inner object. */ ClusterMetricsConfigurationInner innerModel(); - /** The entirety of the ClusterMetricsConfiguration definition. */ + /** + * The entirety of the ClusterMetricsConfiguration definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCollectionInterval, DefinitionStages.WithCreate { } - /** The ClusterMetricsConfiguration definition stages. */ + /** + * The ClusterMetricsConfiguration definition stages. + */ interface DefinitionStages { - /** The first stage of the ClusterMetricsConfiguration definition. */ + /** + * The first stage of the ClusterMetricsConfiguration definition. + */ interface Blank extends WithLocation { } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify location. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -161,18 +168,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify parent resource. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, clusterName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @return the next definition stage. @@ -180,27 +189,27 @@ interface WithParentResource { WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify extendedLocation. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithCollectionInterval withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify collectionInterval. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify collectionInterval. + */ interface WithCollectionInterval { /** * Specifies the collectionInterval property: The interval in minutes by which metrics will be collected.. - * + * * @param collectionInterval The interval in minutes by which metrics will be collected. * @return the next definition stage. */ @@ -214,39 +223,43 @@ interface WithCollectionInterval { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithEnabledMetrics { /** * Executes the create request. - * + * * @return the created resource. */ ClusterMetricsConfiguration create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ClusterMetricsConfiguration create(Context context); } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify tags. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ClusterMetricsConfiguration definition allowing to specify enabledMetrics. */ + /** + * The stage of the ClusterMetricsConfiguration definition allowing to specify enabledMetrics. + */ interface WithEnabledMetrics { /** * Specifies the enabledMetrics property: The list of metric names that have been chosen to be enabled in * addition to the core set of enabled metrics.. - * + * * @param enabledMetrics The list of metric names that have been chosen to be enabled in addition to the - * core set of enabled metrics. + * core set of enabled metrics. * @return the next definition stage. */ WithCreate withEnabledMetrics(List enabledMetrics); @@ -255,62 +268,72 @@ interface WithEnabledMetrics { /** * Begins update for the ClusterMetricsConfiguration resource. - * + * * @return the stage of resource update. */ ClusterMetricsConfiguration.Update update(); - /** The template for ClusterMetricsConfiguration update. */ + /** + * The template for ClusterMetricsConfiguration update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithCollectionInterval, UpdateStages.WithEnabledMetrics { /** * Executes the update request. - * + * * @return the updated resource. */ ClusterMetricsConfiguration apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ClusterMetricsConfiguration apply(Context context); } - /** The ClusterMetricsConfiguration update stages. */ + /** + * The ClusterMetricsConfiguration update stages. + */ interface UpdateStages { - /** The stage of the ClusterMetricsConfiguration update allowing to specify tags. */ + /** + * The stage of the ClusterMetricsConfiguration update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ClusterMetricsConfiguration update allowing to specify collectionInterval. */ + /** + * The stage of the ClusterMetricsConfiguration update allowing to specify collectionInterval. + */ interface WithCollectionInterval { /** * Specifies the collectionInterval property: The interval in minutes by which metrics will be collected.. - * + * * @param collectionInterval The interval in minutes by which metrics will be collected. * @return the next definition stage. */ Update withCollectionInterval(Long collectionInterval); } - /** The stage of the ClusterMetricsConfiguration update allowing to specify enabledMetrics. */ + /** + * The stage of the ClusterMetricsConfiguration update allowing to specify enabledMetrics. + */ interface WithEnabledMetrics { /** * Specifies the enabledMetrics property: The list of metric names that have been chosen to be enabled in * addition to the core set of enabled metrics.. - * + * * @param enabledMetrics The list of metric names that have been chosen to be enabled in addition to the - * core set of enabled metrics. + * core set of enabled metrics. * @return the next definition stage. */ Update withEnabledMetrics(List enabledMetrics); @@ -319,14 +342,14 @@ interface WithEnabledMetrics { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ClusterMetricsConfiguration refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java index 609ffdacec597..75133b69083f8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the metrics configuration. */ +/** + * The more detailed status of the metrics configuration. + */ public final class ClusterMetricsConfigurationDetailedStatus extends ExpandableStringEnum { - /** Static value Processing for ClusterMetricsConfigurationDetailedStatus. */ + /** + * Static value Processing for ClusterMetricsConfigurationDetailedStatus. + */ public static final ClusterMetricsConfigurationDetailedStatus PROCESSING = fromString("Processing"); - /** Static value Applied for ClusterMetricsConfigurationDetailedStatus. */ + /** + * Static value Applied for ClusterMetricsConfigurationDetailedStatus. + */ public static final ClusterMetricsConfigurationDetailedStatus APPLIED = fromString("Applied"); - /** Static value Error for ClusterMetricsConfigurationDetailedStatus. */ + /** + * Static value Error for ClusterMetricsConfigurationDetailedStatus. + */ public static final ClusterMetricsConfigurationDetailedStatus ERROR = fromString("Error"); /** * Creates a new instance of ClusterMetricsConfigurationDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public ClusterMetricsConfigurationDetailedStatus() { /** * Creates or finds a ClusterMetricsConfigurationDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterMetricsConfigurationDetailedStatus. */ - @JsonCreator public static ClusterMetricsConfigurationDetailedStatus fromString(String name) { return fromString(name, ClusterMetricsConfigurationDetailedStatus.class); } /** * Gets known ClusterMetricsConfigurationDetailedStatus values. - * + * * @return known ClusterMetricsConfigurationDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java index b10e0e279bb35..8acce8d852fec 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ClusterMetricsConfigurationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. */ +/** + * ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. + */ @Fluent -public final class ClusterMetricsConfigurationList { +public final class ClusterMetricsConfigurationList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of metrics configurations. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ClusterMetricsConfigurationList class. */ + /** + * Creates an instance of ClusterMetricsConfigurationList class. + */ public ClusterMetricsConfigurationList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the ClusterMetricsConfigurationList object itself. */ @@ -50,7 +56,7 @@ public ClusterMetricsConfigurationList withNextLink(String nextLink) { /** * Get the value property: The list of metrics configurations. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of metrics configurations. - * + * * @param value the value value to set. * @return the ClusterMetricsConfigurationList object itself. */ @@ -70,7 +76,7 @@ public ClusterMetricsConfigurationList withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMetricsConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMetricsConfigurationList 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 ClusterMetricsConfigurationList. + */ + public static ClusterMetricsConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMetricsConfigurationList deserializedClusterMetricsConfigurationList + = new ClusterMetricsConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedClusterMetricsConfigurationList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClusterMetricsConfigurationInner.fromJson(reader1)); + deserializedClusterMetricsConfigurationList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMetricsConfigurationList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java index 97f8a29fb74a2..8469955a32820 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java @@ -5,9 +5,12 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ClusterMetricsConfigurationPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -16,33 +19,27 @@ * cluster. */ @Fluent -public final class ClusterMetricsConfigurationPatchParameters { +public final class ClusterMetricsConfigurationPatchParameters + implements JsonSerializable { /* - * ClusterMetricsConfigurationPatchProperties represents the properties of metrics configuration for the cluster - * for patching. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private ClusterMetricsConfigurationPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ClusterMetricsConfigurationPatchParameters class. */ + /** + * Creates an instance of ClusterMetricsConfigurationPatchParameters class. + */ public ClusterMetricsConfigurationPatchParameters() { } /** - * Get the innerProperties property: ClusterMetricsConfigurationPatchProperties represents the properties of metrics - * configuration for the cluster for patching. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ClusterMetricsConfigurationPatchProperties innerProperties() { @@ -51,7 +48,7 @@ private ClusterMetricsConfigurationPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -60,7 +57,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the ClusterMetricsConfigurationPatchParameters object itself. */ @@ -71,7 +68,7 @@ public ClusterMetricsConfigurationPatchParameters withTags(Map t /** * Get the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @return the collectionInterval value. */ public Long collectionInterval() { @@ -80,7 +77,7 @@ public Long collectionInterval() { /** * Set the collectionInterval property: The interval in minutes by which metrics will be collected. - * + * * @param collectionInterval the collectionInterval value to set. * @return the ClusterMetricsConfigurationPatchParameters object itself. */ @@ -95,7 +92,7 @@ public ClusterMetricsConfigurationPatchParameters withCollectionInterval(Long co /** * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @return the enabledMetrics value. */ public List enabledMetrics() { @@ -105,7 +102,7 @@ public List enabledMetrics() { /** * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the * core set of enabled metrics. - * + * * @param enabledMetrics the enabledMetrics value to set. * @return the ClusterMetricsConfigurationPatchParameters object itself. */ @@ -119,7 +116,7 @@ public ClusterMetricsConfigurationPatchParameters withEnabledMetrics(List writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMetricsConfigurationPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMetricsConfigurationPatchParameters 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 ClusterMetricsConfigurationPatchParameters. + */ + public static ClusterMetricsConfigurationPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMetricsConfigurationPatchParameters deserializedClusterMetricsConfigurationPatchParameters + = new ClusterMetricsConfigurationPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterMetricsConfigurationPatchParameters.innerProperties + = ClusterMetricsConfigurationPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterMetricsConfigurationPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMetricsConfigurationPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java index a4b39e12edabc..5b5d82bf0f57d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the metrics configuration. */ +/** + * The provisioning state of the metrics configuration. + */ public final class ClusterMetricsConfigurationProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ClusterMetricsConfigurationProvisioningState. */ + /** + * Static value Succeeded for ClusterMetricsConfigurationProvisioningState. + */ public static final ClusterMetricsConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ClusterMetricsConfigurationProvisioningState. */ + /** + * Static value Failed for ClusterMetricsConfigurationProvisioningState. + */ public static final ClusterMetricsConfigurationProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ClusterMetricsConfigurationProvisioningState. */ + /** + * Static value Canceled for ClusterMetricsConfigurationProvisioningState. + */ public static final ClusterMetricsConfigurationProvisioningState CANCELED = fromString("Canceled"); - /** Static value Accepted for ClusterMetricsConfigurationProvisioningState. */ + /** + * Static value Accepted for ClusterMetricsConfigurationProvisioningState. + */ public static final ClusterMetricsConfigurationProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Provisioning for ClusterMetricsConfigurationProvisioningState. */ + /** + * Static value Provisioning for ClusterMetricsConfigurationProvisioningState. + */ public static final ClusterMetricsConfigurationProvisioningState PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of ClusterMetricsConfigurationProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public ClusterMetricsConfigurationProvisioningState() { /** * Creates or finds a ClusterMetricsConfigurationProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterMetricsConfigurationProvisioningState. */ - @JsonCreator public static ClusterMetricsConfigurationProvisioningState fromString(String name) { return fromString(name, ClusterMetricsConfigurationProvisioningState.class); } /** * Gets known ClusterMetricsConfigurationProvisioningState values. - * + * * @return known ClusterMetricsConfigurationProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java index f07f0521e657c..a46701e553700 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java @@ -5,39 +5,64 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ClusterPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** ClusterPatchParameters represents the body of the request to patch the cluster properties. */ +/** + * ClusterPatchParameters represents the body of the request to patch the cluster properties. + */ @Fluent -public final class ClusterPatchParameters { +public final class ClusterPatchParameters implements JsonSerializable { + /* + * The identity for the resource. + */ + private ManagedServiceIdentity identity; + /* - * ClusterPatchProperties represents the properties of the cluster for patching. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private ClusterPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ClusterPatchParameters class. */ + /** + * Creates an instance of ClusterPatchParameters class. + */ public ClusterPatchParameters() { } /** - * Get the innerProperties property: ClusterPatchProperties represents the properties of the cluster for patching. - * - *

The list of the resource properties. - * + * Get the identity property: The identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity for the resource. + * + * @param identity the identity value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ClusterPatchProperties innerProperties() { @@ -46,7 +71,7 @@ private ClusterPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +80,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the ClusterPatchParameters object itself. */ @@ -65,11 +90,9 @@ public ClusterPatchParameters withTags(Map tags) { } /** - * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Get the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @return the aggregatorOrSingleRackDefinition value. */ public RackDefinition aggregatorOrSingleRackDefinition() { @@ -77,11 +100,9 @@ public RackDefinition aggregatorOrSingleRackDefinition() { } /** - * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. - * - *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator - * rack in a multi-rack cluster. - * + * Set the aggregatorOrSingleRackDefinition property: The rack definition that is intended to reflect only a single + * rack in a single rack cluster, or an aggregator rack in a multi-rack cluster. + * * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. * @return the ClusterPatchParameters object itself. */ @@ -94,10 +115,35 @@ public RackDefinition aggregatorOrSingleRackDefinition() { return this; } + /** + * Get the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @return the analyticsOutputSettings value. + */ + public AnalyticsOutputSettings analyticsOutputSettings() { + return this.innerProperties() == null ? null : this.innerProperties().analyticsOutputSettings(); + } + + /** + * Set the analyticsOutputSettings property: The settings for the log analytics workspace used for output of logs + * from this cluster. + * + * @param analyticsOutputSettings the analyticsOutputSettings value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withAnalyticsOutputSettings(AnalyticsOutputSettings analyticsOutputSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAnalyticsOutputSettings(analyticsOutputSettings); + return this; + } + /** * Get the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @return the clusterLocation value. */ public String clusterLocation() { @@ -107,7 +153,7 @@ public String clusterLocation() { /** * Set the clusterLocation property: The customer-provided location information to identify where the cluster * resides. - * + * * @param clusterLocation the clusterLocation value to set. * @return the ClusterPatchParameters object itself. */ @@ -120,11 +166,9 @@ public ClusterPatchParameters withClusterLocation(String clusterLocation) { } /** - * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Get the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @return the clusterServicePrincipal value. */ public ServicePrincipalInformation clusterServicePrincipal() { @@ -132,11 +176,9 @@ public ServicePrincipalInformation clusterServicePrincipal() { } /** - * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service - * principal to be used by the cluster during Arc Appliance installation. - * - *

The service principal to be used by the cluster during Arc Appliance installation. - * + * Set the clusterServicePrincipal property: The service principal to be used by the cluster during Arc Appliance + * installation. + * * @param clusterServicePrincipal the clusterServicePrincipal value to set. * @return the ClusterPatchParameters object itself. */ @@ -149,12 +191,34 @@ public ClusterPatchParameters withClusterServicePrincipal(ServicePrincipalInform } /** - * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Get the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @return the commandOutputSettings value. + */ + public CommandOutputSettings commandOutputSettings() { + return this.innerProperties() == null ? null : this.innerProperties().commandOutputSettings(); + } + + /** + * Set the commandOutputSettings property: The settings for commands run in this cluster, such as bare metal machine + * run read only commands and data extracts. + * + * @param commandOutputSettings the commandOutputSettings value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withCommandOutputSettings(CommandOutputSettings commandOutputSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withCommandOutputSettings(commandOutputSettings); + return this; + } + + /** + * Get the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @return the computeDeploymentThreshold value. */ public ValidationThreshold computeDeploymentThreshold() { @@ -162,12 +226,9 @@ public ValidationThreshold computeDeploymentThreshold() { } /** - * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and - * deployment failures. - * - *

The validation threshold indicating the allowable failures of compute machines during environment validation - * and deployment. - * + * Set the computeDeploymentThreshold property: The validation threshold indicating the allowable failures of + * compute machines during environment validation and deployment. + * * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. * @return the ClusterPatchParameters object itself. */ @@ -182,7 +243,7 @@ public ClusterPatchParameters withComputeDeploymentThreshold(ValidationThreshold /** * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @return the computeRackDefinitions value. */ public List computeRackDefinitions() { @@ -192,7 +253,7 @@ public List computeRackDefinitions() { /** * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack * cluster, or an empty list in a single-rack cluster. - * + * * @param computeRackDefinitions the computeRackDefinitions value to set. * @return the ClusterPatchParameters object itself. */ @@ -204,14 +265,183 @@ public ClusterPatchParameters withComputeRackDefinitions(List co return this; } + /** + * Get the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @return the runtimeProtectionConfiguration value. + */ + public RuntimeProtectionConfiguration runtimeProtectionConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().runtimeProtectionConfiguration(); + } + + /** + * Set the runtimeProtectionConfiguration property: The settings for cluster runtime protection. + * + * @param runtimeProtectionConfiguration the runtimeProtectionConfiguration value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters + withRuntimeProtectionConfiguration(RuntimeProtectionConfiguration runtimeProtectionConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withRuntimeProtectionConfiguration(runtimeProtectionConfiguration); + return this; + } + + /** + * Get the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @return the secretArchive value. + */ + public ClusterSecretArchive secretArchive() { + return this.innerProperties() == null ? null : this.innerProperties().secretArchive(); + } + + /** + * Set the secretArchive property: The configuration for use of a key vault to store secrets for later retrieval by + * the operator. + * + * @param secretArchive the secretArchive value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withSecretArchive(ClusterSecretArchive secretArchive) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withSecretArchive(secretArchive); + return this; + } + + /** + * Get the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @return the secretArchiveSettings value. + */ + public SecretArchiveSettings secretArchiveSettings() { + return this.innerProperties() == null ? null : this.innerProperties().secretArchiveSettings(); + } + + /** + * Set the secretArchiveSettings property: The settings for the secret archive used to hold credentials for the + * cluster. + * + * @param secretArchiveSettings the secretArchiveSettings value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withSecretArchiveSettings(SecretArchiveSettings secretArchiveSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withSecretArchiveSettings(secretArchiveSettings); + return this; + } + + /** + * Get the updateStrategy property: The strategy for updating the cluster. + * + * @return the updateStrategy value. + */ + public ClusterUpdateStrategy updateStrategy() { + return this.innerProperties() == null ? null : this.innerProperties().updateStrategy(); + } + + /** + * Set the updateStrategy property: The strategy for updating the cluster. + * + * @param updateStrategy the updateStrategy value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withUpdateStrategy(ClusterUpdateStrategy updateStrategy) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withUpdateStrategy(updateStrategy); + return this; + } + + /** + * Get the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @return the vulnerabilityScanningSettings value. + */ + public VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings() { + return this.innerProperties() == null ? null : this.innerProperties().vulnerabilityScanningSettings(); + } + + /** + * Set the vulnerabilityScanningSettings property: The settings for how security vulnerability scanning is applied + * to the cluster. + * + * @param vulnerabilityScanningSettings the vulnerabilityScanningSettings value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters + withVulnerabilityScanningSettings(VulnerabilityScanningSettingsPatch vulnerabilityScanningSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withVulnerabilityScanningSettings(vulnerabilityScanningSettings); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterPatchParameters 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 ClusterPatchParameters. + */ + public static ClusterPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterPatchParameters deserializedClusterPatchParameters = new ClusterPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedClusterPatchParameters.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterPatchParameters.innerProperties = ClusterPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedClusterPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java index fbe1d66629daf..d552cf4b2f39b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the cluster. */ +/** + * The provisioning state of the cluster. + */ public final class ClusterProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ClusterProvisioningState. */ + /** + * Static value Succeeded for ClusterProvisioningState. + */ public static final ClusterProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ClusterProvisioningState. */ + /** + * Static value Failed for ClusterProvisioningState. + */ public static final ClusterProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ClusterProvisioningState. */ + /** + * Static value Canceled for ClusterProvisioningState. + */ public static final ClusterProvisioningState CANCELED = fromString("Canceled"); - /** Static value Accepted for ClusterProvisioningState. */ + /** + * Static value Accepted for ClusterProvisioningState. + */ public static final ClusterProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Validating for ClusterProvisioningState. */ + /** + * Static value Validating for ClusterProvisioningState. + */ public static final ClusterProvisioningState VALIDATING = fromString("Validating"); - /** Static value Updating for ClusterProvisioningState. */ + /** + * Static value Updating for ClusterProvisioningState. + */ public static final ClusterProvisioningState UPDATING = fromString("Updating"); /** * Creates a new instance of ClusterProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public ClusterProvisioningState() { /** * Creates or finds a ClusterProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterProvisioningState. */ - @JsonCreator public static ClusterProvisioningState fromString(String name) { return fromString(name, ClusterProvisioningState.class); } /** * Gets known ClusterProvisioningState values. - * + * * @return known ClusterProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParameters.java new file mode 100644 index 0000000000000..799799be2affd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParameters.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. + */ +@Fluent +public final class ClusterScanRuntimeParameters implements JsonSerializable { + /* + * The choice of if the scan operation should run the scan. + */ + private ClusterScanRuntimeParametersScanActivity scanActivity; + + /** + * Creates an instance of ClusterScanRuntimeParameters class. + */ + public ClusterScanRuntimeParameters() { + } + + /** + * Get the scanActivity property: The choice of if the scan operation should run the scan. + * + * @return the scanActivity value. + */ + public ClusterScanRuntimeParametersScanActivity scanActivity() { + return this.scanActivity; + } + + /** + * Set the scanActivity property: The choice of if the scan operation should run the scan. + * + * @param scanActivity the scanActivity value to set. + * @return the ClusterScanRuntimeParameters object itself. + */ + public ClusterScanRuntimeParameters withScanActivity(ClusterScanRuntimeParametersScanActivity scanActivity) { + this.scanActivity = scanActivity; + 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("scanActivity", this.scanActivity == null ? null : this.scanActivity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterScanRuntimeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterScanRuntimeParameters 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 ClusterScanRuntimeParameters. + */ + public static ClusterScanRuntimeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterScanRuntimeParameters deserializedClusterScanRuntimeParameters = new ClusterScanRuntimeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scanActivity".equals(fieldName)) { + deserializedClusterScanRuntimeParameters.scanActivity + = ClusterScanRuntimeParametersScanActivity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterScanRuntimeParameters; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParametersScanActivity.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParametersScanActivity.java new file mode 100644 index 0000000000000..0d210fab3ad51 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterScanRuntimeParametersScanActivity.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The choice of if the scan operation should run the scan. + */ +public final class ClusterScanRuntimeParametersScanActivity + extends ExpandableStringEnum { + /** + * Static value Scan for ClusterScanRuntimeParametersScanActivity. + */ + public static final ClusterScanRuntimeParametersScanActivity SCAN = fromString("Scan"); + + /** + * Static value Skip for ClusterScanRuntimeParametersScanActivity. + */ + public static final ClusterScanRuntimeParametersScanActivity SKIP = fromString("Skip"); + + /** + * Creates a new instance of ClusterScanRuntimeParametersScanActivity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterScanRuntimeParametersScanActivity() { + } + + /** + * Creates or finds a ClusterScanRuntimeParametersScanActivity from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterScanRuntimeParametersScanActivity. + */ + public static ClusterScanRuntimeParametersScanActivity fromString(String name) { + return fromString(name, ClusterScanRuntimeParametersScanActivity.class); + } + + /** + * Gets known ClusterScanRuntimeParametersScanActivity values. + * + * @return known ClusterScanRuntimeParametersScanActivity values. + */ + public static Collection values() { + return values(ClusterScanRuntimeParametersScanActivity.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchive.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchive.java new file mode 100644 index 0000000000000..4b4948e257779 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchive.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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; + +/** + * ClusterSecretArchive configures the key vault to archive the secrets of the cluster for later retrieval. + */ +@Fluent +public final class ClusterSecretArchive implements JsonSerializable { + /* + * The resource ID of the key vault to archive the secrets of the cluster. + */ + private String keyVaultId; + + /* + * The indicator if the specified key vault should be used to archive the secrets of the cluster. + */ + private ClusterSecretArchiveEnabled useKeyVault; + + /** + * Creates an instance of ClusterSecretArchive class. + */ + public ClusterSecretArchive() { + } + + /** + * Get the keyVaultId property: The resource ID of the key vault to archive the secrets of the cluster. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: The resource ID of the key vault to archive the secrets of the cluster. + * + * @param keyVaultId the keyVaultId value to set. + * @return the ClusterSecretArchive object itself. + */ + public ClusterSecretArchive withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the useKeyVault property: The indicator if the specified key vault should be used to archive the secrets of + * the cluster. + * + * @return the useKeyVault value. + */ + public ClusterSecretArchiveEnabled useKeyVault() { + return this.useKeyVault; + } + + /** + * Set the useKeyVault property: The indicator if the specified key vault should be used to archive the secrets of + * the cluster. + * + * @param useKeyVault the useKeyVault value to set. + * @return the ClusterSecretArchive object itself. + */ + public ClusterSecretArchive withUseKeyVault(ClusterSecretArchiveEnabled useKeyVault) { + this.useKeyVault = useKeyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultId() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property keyVaultId in model ClusterSecretArchive")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterSecretArchive.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + jsonWriter.writeStringField("useKeyVault", this.useKeyVault == null ? null : this.useKeyVault.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterSecretArchive from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterSecretArchive 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 ClusterSecretArchive. + */ + public static ClusterSecretArchive fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterSecretArchive deserializedClusterSecretArchive = new ClusterSecretArchive(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultId".equals(fieldName)) { + deserializedClusterSecretArchive.keyVaultId = reader.getString(); + } else if ("useKeyVault".equals(fieldName)) { + deserializedClusterSecretArchive.useKeyVault + = ClusterSecretArchiveEnabled.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterSecretArchive; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchiveEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchiveEnabled.java new file mode 100644 index 0000000000000..88ba06fa0d76a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterSecretArchiveEnabled.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The indicator if the specified key vault should be used to archive the secrets of the cluster. + */ +public final class ClusterSecretArchiveEnabled extends ExpandableStringEnum { + /** + * Static value True for ClusterSecretArchiveEnabled. + */ + public static final ClusterSecretArchiveEnabled TRUE = fromString("True"); + + /** + * Static value False for ClusterSecretArchiveEnabled. + */ + public static final ClusterSecretArchiveEnabled FALSE = fromString("False"); + + /** + * Creates a new instance of ClusterSecretArchiveEnabled value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterSecretArchiveEnabled() { + } + + /** + * Creates or finds a ClusterSecretArchiveEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterSecretArchiveEnabled. + */ + public static ClusterSecretArchiveEnabled fromString(String name) { + return fromString(name, ClusterSecretArchiveEnabled.class); + } + + /** + * Gets known ClusterSecretArchiveEnabled values. + * + * @return known ClusterSecretArchiveEnabled values. + */ + public static Collection values() { + return values(ClusterSecretArchiveEnabled.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java index 00746e9e80a7c..cf31299db5846 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of rack configuration for the cluster. */ +/** + * The type of rack configuration for the cluster. + */ public final class ClusterType extends ExpandableStringEnum { - /** Static value SingleRack for ClusterType. */ + /** + * Static value SingleRack for ClusterType. + */ public static final ClusterType SINGLE_RACK = fromString("SingleRack"); - /** Static value MultiRack for ClusterType. */ + /** + * Static value MultiRack for ClusterType. + */ public static final ClusterType MULTI_RACK = fromString("MultiRack"); /** * Creates a new instance of ClusterType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ClusterType() { /** * Creates or finds a ClusterType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterType. */ - @JsonCreator public static ClusterType fromString(String name) { return fromString(name, ClusterType.class); } /** * Gets known ClusterType values. - * + * * @return known ClusterType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategy.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategy.java new file mode 100644 index 0000000000000..d1a6f1ac4f338 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategy.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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; + +/** + * ClusterUpdateStrategy represents the strategy for updating the cluster. + */ +@Fluent +public final class ClusterUpdateStrategy implements JsonSerializable { + /* + * The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + * Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + */ + private Long maxUnavailable; + + /* + * The mode of operation for runtime protection. + */ + private ClusterUpdateStrategyType strategyType; + + /* + * Selection of how the threshold should be evaluated. + */ + private ValidationThresholdType thresholdType; + + /* + * The numeric threshold value. + */ + private long thresholdValue; + + /* + * The time to wait between the increments of update defined by the strategy. + */ + private Long waitTimeMinutes; + + /** + * Creates an instance of ClusterUpdateStrategy class. + */ + public ClusterUpdateStrategy() { + } + + /** + * Get the maxUnavailable property: The maximum number of worker nodes that can be offline within the increment of + * update, e.g., rack-by-rack. + * Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + * + * @return the maxUnavailable value. + */ + public Long maxUnavailable() { + return this.maxUnavailable; + } + + /** + * Set the maxUnavailable property: The maximum number of worker nodes that can be offline within the increment of + * update, e.g., rack-by-rack. + * Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + * + * @param maxUnavailable the maxUnavailable value to set. + * @return the ClusterUpdateStrategy object itself. + */ + public ClusterUpdateStrategy withMaxUnavailable(Long maxUnavailable) { + this.maxUnavailable = maxUnavailable; + return this; + } + + /** + * Get the strategyType property: The mode of operation for runtime protection. + * + * @return the strategyType value. + */ + public ClusterUpdateStrategyType strategyType() { + return this.strategyType; + } + + /** + * Set the strategyType property: The mode of operation for runtime protection. + * + * @param strategyType the strategyType value to set. + * @return the ClusterUpdateStrategy object itself. + */ + public ClusterUpdateStrategy withStrategyType(ClusterUpdateStrategyType strategyType) { + this.strategyType = strategyType; + return this; + } + + /** + * Get the thresholdType property: Selection of how the threshold should be evaluated. + * + * @return the thresholdType value. + */ + public ValidationThresholdType thresholdType() { + return this.thresholdType; + } + + /** + * Set the thresholdType property: Selection of how the threshold should be evaluated. + * + * @param thresholdType the thresholdType value to set. + * @return the ClusterUpdateStrategy object itself. + */ + public ClusterUpdateStrategy withThresholdType(ValidationThresholdType thresholdType) { + this.thresholdType = thresholdType; + return this; + } + + /** + * Get the thresholdValue property: The numeric threshold value. + * + * @return the thresholdValue value. + */ + public long thresholdValue() { + return this.thresholdValue; + } + + /** + * Set the thresholdValue property: The numeric threshold value. + * + * @param thresholdValue the thresholdValue value to set. + * @return the ClusterUpdateStrategy object itself. + */ + public ClusterUpdateStrategy withThresholdValue(long thresholdValue) { + this.thresholdValue = thresholdValue; + return this; + } + + /** + * Get the waitTimeMinutes property: The time to wait between the increments of update defined by the strategy. + * + * @return the waitTimeMinutes value. + */ + public Long waitTimeMinutes() { + return this.waitTimeMinutes; + } + + /** + * Set the waitTimeMinutes property: The time to wait between the increments of update defined by the strategy. + * + * @param waitTimeMinutes the waitTimeMinutes value to set. + * @return the ClusterUpdateStrategy object itself. + */ + public ClusterUpdateStrategy withWaitTimeMinutes(Long waitTimeMinutes) { + this.waitTimeMinutes = waitTimeMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (strategyType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property strategyType in model ClusterUpdateStrategy")); + } + if (thresholdType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property thresholdType in model ClusterUpdateStrategy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpdateStrategy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("strategyType", this.strategyType == null ? null : this.strategyType.toString()); + jsonWriter.writeStringField("thresholdType", this.thresholdType == null ? null : this.thresholdType.toString()); + jsonWriter.writeLongField("thresholdValue", this.thresholdValue); + jsonWriter.writeNumberField("maxUnavailable", this.maxUnavailable); + jsonWriter.writeNumberField("waitTimeMinutes", this.waitTimeMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpdateStrategy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpdateStrategy 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 ClusterUpdateStrategy. + */ + public static ClusterUpdateStrategy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpdateStrategy deserializedClusterUpdateStrategy = new ClusterUpdateStrategy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("strategyType".equals(fieldName)) { + deserializedClusterUpdateStrategy.strategyType + = ClusterUpdateStrategyType.fromString(reader.getString()); + } else if ("thresholdType".equals(fieldName)) { + deserializedClusterUpdateStrategy.thresholdType + = ValidationThresholdType.fromString(reader.getString()); + } else if ("thresholdValue".equals(fieldName)) { + deserializedClusterUpdateStrategy.thresholdValue = reader.getLong(); + } else if ("maxUnavailable".equals(fieldName)) { + deserializedClusterUpdateStrategy.maxUnavailable = reader.getNullable(JsonReader::getLong); + } else if ("waitTimeMinutes".equals(fieldName)) { + deserializedClusterUpdateStrategy.waitTimeMinutes = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpdateStrategy; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategyType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategyType.java new file mode 100644 index 0000000000000..5f10cbd5d831e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateStrategyType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode of operation for runtime protection. + */ +public final class ClusterUpdateStrategyType extends ExpandableStringEnum { + /** + * Static value Rack for ClusterUpdateStrategyType. + */ + public static final ClusterUpdateStrategyType RACK = fromString("Rack"); + + /** + * Static value PauseAfterRack for ClusterUpdateStrategyType. + */ + public static final ClusterUpdateStrategyType PAUSE_AFTER_RACK = fromString("PauseAfterRack"); + + /** + * Creates a new instance of ClusterUpdateStrategyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterUpdateStrategyType() { + } + + /** + * Creates or finds a ClusterUpdateStrategyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterUpdateStrategyType. + */ + public static ClusterUpdateStrategyType fromString(String name) { + return fromString(name, ClusterUpdateStrategyType.class); + } + + /** + * Gets known ClusterUpdateStrategyType values. + * + * @return known ClusterUpdateStrategyType values. + */ + public static Collection values() { + return values(ClusterUpdateStrategyType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java index 0bf31c3a92720..dc53521a67cf6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java @@ -6,24 +6,31 @@ 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; -/** ClusterUpdateVersionParameters represents the body of the request to update cluster version. */ +/** + * ClusterUpdateVersionParameters represents the body of the request to update cluster version. + */ @Fluent -public final class ClusterUpdateVersionParameters { +public final class ClusterUpdateVersionParameters implements JsonSerializable { /* * The version to be applied to the cluster during update. */ - @JsonProperty(value = "targetClusterVersion", required = true) private String targetClusterVersion; - /** Creates an instance of ClusterUpdateVersionParameters class. */ + /** + * Creates an instance of ClusterUpdateVersionParameters class. + */ public ClusterUpdateVersionParameters() { } /** * Get the targetClusterVersion property: The version to be applied to the cluster during update. - * + * * @return the targetClusterVersion value. */ public String targetClusterVersion() { @@ -32,7 +39,7 @@ public String targetClusterVersion() { /** * Set the targetClusterVersion property: The version to be applied to the cluster during update. - * + * * @param targetClusterVersion the targetClusterVersion value to set. * @return the ClusterUpdateVersionParameters object itself. */ @@ -43,15 +50,54 @@ public ClusterUpdateVersionParameters withTargetClusterVersion(String targetClus /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (targetClusterVersion() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property targetClusterVersion in model ClusterUpdateVersionParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetClusterVersion in model ClusterUpdateVersionParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(ClusterUpdateVersionParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetClusterVersion", this.targetClusterVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpdateVersionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpdateVersionParameters 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 ClusterUpdateVersionParameters. + */ + public static ClusterUpdateVersionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpdateVersionParameters deserializedClusterUpdateVersionParameters + = new ClusterUpdateVersionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetClusterVersion".equals(fieldName)) { + deserializedClusterUpdateVersionParameters.targetClusterVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpdateVersionParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java index 21d5753158f39..1866e77a955de 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Clusters. */ +/** + * Resource collection API of Clusters. + */ public interface Clusters { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface Clusters { /** * List clusters in the subscription. - * - *

Get a list of clusters in the provided subscription. - * + * + * Get a list of clusters in the provided subscription. + * * @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. @@ -36,9 +38,9 @@ public interface Clusters { /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,9 +51,9 @@ public interface Clusters { /** * List clusters in the resource group. - * - *

Get a list of clusters in the provided resource group. - * + * + * Get a list of clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,9 +65,9 @@ public interface Clusters { /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. @@ -78,9 +80,9 @@ public interface Clusters { /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,36 +94,73 @@ public interface Clusters { /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String clusterName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String clusterName); /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 current status of an async operation. + */ + OperationStatusResult delete(String resourceGroupName, String clusterName, Context context); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. + */ + OperationStatusResult continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters); + + /** + * Continue a paused update to the cluster version. + * + * Trigger the continuation of an update for a cluster with a matching update strategy that has paused after + * completing a segment of the update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterContinueUpdateVersionParameters The request body. + * @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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, Context context); + OperationStatusResult continueUpdateVersion(String resourceGroupName, String clusterName, + ClusterContinueUpdateVersionParameters clusterContinueUpdateVersionParameters, Context context); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -132,10 +171,10 @@ public interface Clusters { OperationStatusResult deploy(String resourceGroupName, String clusterName); /** - * Deploy the cluster to the rack. - * - *

Deploy the cluster to the provided rack. - * + * Deploy the cluster. + * + * Deploy the cluster using the rack configuration provided during creation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterDeployParameters The request body. @@ -148,11 +187,44 @@ public interface Clusters { OperationStatusResult deploy(String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the 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 current status of an async operation. + */ + OperationStatusResult scanRuntime(String resourceGroupName, String clusterName); + + /** + * Execute a runtime protection scan on the cluster. + * + * Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with + * the cluster configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterScanRuntimeParameters The request body. + * @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 current status of an async operation. + */ + OperationStatusResult scanRuntime(String resourceGroupName, String clusterName, + ClusterScanRuntimeParameters clusterScanRuntimeParameters, Context context); + /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -166,9 +238,9 @@ OperationStatusResult updateVersion(String resourceGroupName, String clusterName /** * Update the cluster version. - * - *

Update the version of the provided cluster to one of the available supported versions. - * + * + * Update the version of the provided cluster to one of the available supported versions. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param clusterUpdateVersionParameters The request body. @@ -183,9 +255,9 @@ OperationStatusResult updateVersion(String resourceGroupName, String clusterName /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -196,9 +268,9 @@ OperationStatusResult updateVersion(String resourceGroupName, String clusterName /** * Retrieve the cluster. - * - *

Get properties of the provided cluster. - * + * + * Get properties of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -210,32 +282,34 @@ OperationStatusResult updateVersion(String resourceGroupName, String clusterName /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the cluster. - * - *

Delete the provided cluster. - * + * + * Delete the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Cluster resource. - * + * * @param name resource name. * @return the first stage of the new Cluster definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommandOutputSettings.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommandOutputSettings.java new file mode 100644 index 0000000000000..a72a4918bea38 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommandOutputSettings.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run + * read-only commands. + */ +@Fluent +public final class CommandOutputSettings implements JsonSerializable { + /* + * The selection of the managed identity to use with this storage account container. The identity type must be + * either system assigned or user assigned. + */ + private IdentitySelector associatedIdentity; + + /* + * The URL of the storage account container that is to be used by the specified identities. + */ + private String containerUrl; + + /** + * Creates an instance of CommandOutputSettings class. + */ + public CommandOutputSettings() { + } + + /** + * Get the associatedIdentity property: The selection of the managed identity to use with this storage account + * container. The identity type must be either system assigned or user assigned. + * + * @return the associatedIdentity value. + */ + public IdentitySelector associatedIdentity() { + return this.associatedIdentity; + } + + /** + * Set the associatedIdentity property: The selection of the managed identity to use with this storage account + * container. The identity type must be either system assigned or user assigned. + * + * @param associatedIdentity the associatedIdentity value to set. + * @return the CommandOutputSettings object itself. + */ + public CommandOutputSettings withAssociatedIdentity(IdentitySelector associatedIdentity) { + this.associatedIdentity = associatedIdentity; + return this; + } + + /** + * Get the containerUrl property: The URL of the storage account container that is to be used by the specified + * identities. + * + * @return the containerUrl value. + */ + public String containerUrl() { + return this.containerUrl; + } + + /** + * Set the containerUrl property: The URL of the storage account container that is to be used by the specified + * identities. + * + * @param containerUrl the containerUrl value to set. + * @return the CommandOutputSettings object itself. + */ + public CommandOutputSettings withContainerUrl(String containerUrl) { + this.containerUrl = containerUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedIdentity() != null) { + associatedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("associatedIdentity", this.associatedIdentity); + jsonWriter.writeStringField("containerUrl", this.containerUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandOutputSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandOutputSettings 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 CommandOutputSettings. + */ + public static CommandOutputSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandOutputSettings deserializedCommandOutputSettings = new CommandOutputSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("associatedIdentity".equals(fieldName)) { + deserializedCommandOutputSettings.associatedIdentity = IdentitySelector.fromJson(reader); + } else if ("containerUrl".equals(fieldName)) { + deserializedCommandOutputSettings.containerUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandOutputSettings; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java index b77be5730642a..bc5186862fc08 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java @@ -11,84 +11,84 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of Console. */ +/** + * An immutable client-side representation of Console. + */ public interface Console { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. - * + * Gets the extendedLocation property: The extended location of the cluster manager associated with the cluster this + * virtual machine is created on. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the detailedStatus property: The more detailed status of the console. - * + * * @return the detailedStatus value. */ ConsoleDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the enabled property: The indicator of whether the console access is enabled. - * + * * @return the enabled value. */ ConsoleEnabled enabled(); /** * Gets the expiration property: The date and time after which the key will be disallowed access. - * + * * @return the expiration value. */ OffsetDateTime expiration(); @@ -96,25 +96,22 @@ public interface Console { /** * Gets the privateLinkServiceId property: The resource ID of the private link service that is used to provide * virtual machine console access. - * + * * @return the privateLinkServiceId value. */ String privateLinkServiceId(); /** * Gets the provisioningState property: The provisioning state of the virtual machine console. - * + * * @return the provisioningState value. */ ConsoleProvisioningState provisioningState(); /** - * Gets the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Gets the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ SshPublicKey sshPublicKey(); @@ -122,56 +119,64 @@ public interface Console { /** * Gets the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access * the console. - * + * * @return the virtualMachineAccessId value. */ String virtualMachineAccessId(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner object. - * + * * @return the inner object. */ ConsoleInner innerModel(); - /** The entirety of the Console definition. */ + /** + * The entirety of the Console definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithParentResource, DefinitionStages.WithExtendedLocation, DefinitionStages.WithEnabled, DefinitionStages.WithSshPublicKey, DefinitionStages.WithCreate { } - /** The Console definition stages. */ + /** + * The Console definition stages. + */ interface DefinitionStages { - /** The first stage of the Console definition. */ + /** + * The first stage of the Console definition. + */ interface Blank extends WithLocation { } - /** The stage of the Console definition allowing to specify location. */ + /** + * The stage of the Console definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -179,18 +184,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the Console definition allowing to specify parent resource. */ + /** + * The stage of the Console definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, virtualMachineName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @return the next definition stage. @@ -198,48 +205,44 @@ interface WithParentResource { WithExtendedLocation withExistingVirtualMachine(String resourceGroupName, String virtualMachineName); } - /** The stage of the Console definition allowing to specify extendedLocation. */ + /** + * The stage of the Console definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster manager associated with the cluster this virtual machine is - * created on.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster manager associated with the cluster this virtual machine is - * created on. + * Specifies the extendedLocation property: The extended location of the cluster manager associated with the + * cluster this virtual machine is created on.. + * + * @param extendedLocation The extended location of the cluster manager associated with the cluster this + * virtual machine is created on. * @return the next definition stage. */ WithEnabled withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the Console definition allowing to specify enabled. */ + /** + * The stage of the Console definition allowing to specify enabled. + */ interface WithEnabled { /** * Specifies the enabled property: The indicator of whether the console access is enabled.. - * + * * @param enabled The indicator of whether the console access is enabled. * @return the next definition stage. */ WithSshPublicKey withEnabled(ConsoleEnabled enabled); } - /** The stage of the Console definition allowing to specify sshPublicKey. */ + /** + * The stage of the Console definition allowing to specify sshPublicKey. + */ interface WithSshPublicKey { /** - * Specifies the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a - * resource through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the - * corresponding SSH private key for logging in.. - * - * @param sshPublicKey SshPublicKey represents the public key used to authenticate with a resource through - * SSH. - *

The SSH public key that will be provisioned for user access. The user is expected to have the - * corresponding SSH private key for logging in. + * Specifies the sshPublicKey property: The SSH public key that will be provisioned for user access. The + * user is expected to have the corresponding SSH private key for logging in.. + * + * @param sshPublicKey The SSH public key that will be provisioned for user access. The user is expected to + * have the corresponding SSH private key for logging in. * @return the next definition stage. */ WithCreate withSshPublicKey(SshPublicKey sshPublicKey); @@ -252,36 +255,40 @@ interface WithSshPublicKey { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExpiration { /** * Executes the create request. - * + * * @return the created resource. */ Console create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Console create(Context context); } - /** The stage of the Console definition allowing to specify tags. */ + /** + * The stage of the Console definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Console definition allowing to specify expiration. */ + /** + * The stage of the Console definition allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the key will be disallowed access.. - * + * * @param expiration The date and time after which the key will be disallowed access. * @return the next definition stage. */ @@ -291,80 +298,85 @@ interface WithExpiration { /** * Begins update for the Console resource. - * + * * @return the stage of resource update. */ Console.Update update(); - /** The template for Console update. */ + /** + * The template for Console update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithEnabled, UpdateStages.WithExpiration, UpdateStages.WithSshPublicKey { /** * Executes the update request. - * + * * @return the updated resource. */ Console apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Console apply(Context context); } - /** The Console update stages. */ + /** + * The Console update stages. + */ interface UpdateStages { - /** The stage of the Console update allowing to specify tags. */ + /** + * The stage of the Console update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Console update allowing to specify enabled. */ + /** + * The stage of the Console update allowing to specify enabled. + */ interface WithEnabled { /** - * Specifies the enabled property: The credentials used to login to the image repository that has access to - * the specified image.. - * - * @param enabled The credentials used to login to the image repository that has access to the specified - * image. + * Specifies the enabled property: The indicator of whether the console access is enabled.. + * + * @param enabled The indicator of whether the console access is enabled. * @return the next definition stage. */ Update withEnabled(ConsoleEnabled enabled); } - /** The stage of the Console update allowing to specify expiration. */ + /** + * The stage of the Console update allowing to specify expiration. + */ interface WithExpiration { /** * Specifies the expiration property: The date and time after which the key will be disallowed access.. - * + * * @param expiration The date and time after which the key will be disallowed access. * @return the next definition stage. */ Update withExpiration(OffsetDateTime expiration); } - /** The stage of the Console update allowing to specify sshPublicKey. */ + /** + * The stage of the Console update allowing to specify sshPublicKey. + */ interface WithSshPublicKey { /** - * Specifies the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a - * resource through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the - * corresponding SSH private key for logging in.. - * - * @param sshPublicKey SshPublicKey represents the public key used to authenticate with a resource through - * SSH. - *

The SSH public key that will be provisioned for user access. The user is expected to have the - * corresponding SSH private key for logging in. + * Specifies the sshPublicKey property: The SSH public key that will be provisioned for user access. The + * user is expected to have the corresponding SSH private key for logging in.. + * + * @param sshPublicKey The SSH public key that will be provisioned for user access. The user is expected to + * have the corresponding SSH private key for logging in. * @return the next definition stage. */ Update withSshPublicKey(SshPublicKey sshPublicKey); @@ -373,14 +385,14 @@ interface WithSshPublicKey { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Console refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java index d1d7904fb1e47..eadcc4cf10631 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the console. */ +/** + * The more detailed status of the console. + */ public final class ConsoleDetailedStatus extends ExpandableStringEnum { - /** Static value Ready for ConsoleDetailedStatus. */ + /** + * Static value Ready for ConsoleDetailedStatus. + */ public static final ConsoleDetailedStatus READY = fromString("Ready"); - /** Static value Error for ConsoleDetailedStatus. */ + /** + * Static value Error for ConsoleDetailedStatus. + */ public static final ConsoleDetailedStatus ERROR = fromString("Error"); /** * Creates a new instance of ConsoleDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ConsoleDetailedStatus() { /** * Creates or finds a ConsoleDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConsoleDetailedStatus. */ - @JsonCreator public static ConsoleDetailedStatus fromString(String name) { return fromString(name, ConsoleDetailedStatus.class); } /** * Gets known ConsoleDetailedStatus values. - * + * * @return known ConsoleDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java index 8809bc4724f6a..f21a8259c1b42 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The credentials used to login to the image repository that has access to the specified image. */ +/** + * The indicator of whether the console access is enabled. + */ public final class ConsoleEnabled extends ExpandableStringEnum { - /** Static value True for ConsoleEnabled. */ + /** + * Static value True for ConsoleEnabled. + */ public static final ConsoleEnabled TRUE = fromString("True"); - /** Static value False for ConsoleEnabled. */ + /** + * Static value False for ConsoleEnabled. + */ public static final ConsoleEnabled FALSE = fromString("False"); /** * Creates a new instance of ConsoleEnabled value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ConsoleEnabled() { /** * Creates or finds a ConsoleEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConsoleEnabled. */ - @JsonCreator public static ConsoleEnabled fromString(String name) { return fromString(name, ConsoleEnabled.class); } /** * Gets known ConsoleEnabled values. - * + * * @return known ConsoleEnabled values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java index 0682b983fdf0c..b7a06f3a466fe 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ConsoleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ConsoleList represents a list of virtual machine consoles. */ +/** + * ConsoleList represents a list of virtual machine consoles. + */ @Fluent -public final class ConsoleList { +public final class ConsoleList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of virtual machine consoles. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ConsoleList class. */ + /** + * Creates an instance of ConsoleList class. + */ public ConsoleList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the ConsoleList object itself. */ @@ -50,7 +56,7 @@ public ConsoleList withNextLink(String nextLink) { /** * Get the value property: The list of virtual machine consoles. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of virtual machine consoles. - * + * * @param value the value value to set. * @return the ConsoleList object itself. */ @@ -70,7 +76,7 @@ public ConsoleList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsoleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsoleList 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 ConsoleList. + */ + public static ConsoleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsoleList deserializedConsoleList = new ConsoleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedConsoleList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ConsoleInner.fromJson(reader1)); + deserializedConsoleList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConsoleList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java index f288ca9eb9983..5578771f877a5 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java @@ -5,40 +5,39 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.ConsolePatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -/** ConsolePatchParameters represents the body of the request to patch the virtual machine console. */ +/** + * ConsolePatchParameters represents the body of the request to patch the virtual machine console. + */ @Fluent -public final class ConsolePatchParameters { +public final class ConsolePatchParameters implements JsonSerializable { /* - * ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private ConsolePatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ConsolePatchParameters class. */ + /** + * Creates an instance of ConsolePatchParameters class. + */ public ConsolePatchParameters() { } /** - * Get the innerProperties property: ConsolePatchProperties represents the properties of the virtual machine console - * that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private ConsolePatchProperties innerProperties() { @@ -47,7 +46,7 @@ private ConsolePatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -56,7 +55,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the ConsolePatchParameters object itself. */ @@ -66,9 +65,8 @@ public ConsolePatchParameters withTags(Map tags) { } /** - * Get the enabled property: The credentials used to login to the image repository that has access to the specified - * image. - * + * Get the enabled property: The indicator of whether the console access is enabled. + * * @return the enabled value. */ public ConsoleEnabled enabled() { @@ -76,9 +74,8 @@ public ConsoleEnabled enabled() { } /** - * Set the enabled property: The credentials used to login to the image repository that has access to the specified - * image. - * + * Set the enabled property: The indicator of whether the console access is enabled. + * * @param enabled the enabled value to set. * @return the ConsolePatchParameters object itself. */ @@ -92,7 +89,7 @@ public ConsolePatchParameters withEnabled(ConsoleEnabled enabled) { /** * Get the expiration property: The date and time after which the key will be disallowed access. - * + * * @return the expiration value. */ public OffsetDateTime expiration() { @@ -101,7 +98,7 @@ public OffsetDateTime expiration() { /** * Set the expiration property: The date and time after which the key will be disallowed access. - * + * * @param expiration the expiration value to set. * @return the ConsolePatchParameters object itself. */ @@ -114,12 +111,9 @@ public ConsolePatchParameters withExpiration(OffsetDateTime expiration) { } /** - * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Get the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ public SshPublicKey sshPublicKey() { @@ -127,12 +121,9 @@ public SshPublicKey sshPublicKey() { } /** - * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Set the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @param sshPublicKey the sshPublicKey value to set. * @return the ConsolePatchParameters object itself. */ @@ -146,7 +137,7 @@ public ConsolePatchParameters withSshPublicKey(SshPublicKey sshPublicKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -154,4 +145,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsolePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsolePatchParameters 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 ConsolePatchParameters. + */ + public static ConsolePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsolePatchParameters deserializedConsolePatchParameters = new ConsolePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConsolePatchParameters.innerProperties = ConsolePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConsolePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConsolePatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java index 1c2ea1004c4fd..480d83c0673e9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the virtual machine console. */ +/** + * The provisioning state of the virtual machine console. + */ public final class ConsoleProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ConsoleProvisioningState. */ + /** + * Static value Succeeded for ConsoleProvisioningState. + */ public static final ConsoleProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ConsoleProvisioningState. */ + /** + * Static value Failed for ConsoleProvisioningState. + */ public static final ConsoleProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ConsoleProvisioningState. */ + /** + * Static value Canceled for ConsoleProvisioningState. + */ public static final ConsoleProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for ConsoleProvisioningState. */ + /** + * Static value Provisioning for ConsoleProvisioningState. + */ public static final ConsoleProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for ConsoleProvisioningState. */ + /** + * Static value Accepted for ConsoleProvisioningState. + */ public static final ConsoleProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of ConsoleProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public ConsoleProvisioningState() { /** * Creates or finds a ConsoleProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConsoleProvisioningState. */ - @JsonCreator public static ConsoleProvisioningState fromString(String name) { return fromString(name, ConsoleProvisioningState.class); } /** * Gets known ConsoleProvisioningState values. - * + * * @return known ConsoleProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java index 54f904134bf1e..2480d59239f30 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Consoles. */ +/** + * Resource collection API of Consoles. + */ public interface Consoles { /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -26,9 +28,9 @@ public interface Consoles { /** * List consoles of the virtual machine. - * - *

Get a list of consoles for the provided virtual machine. - * + * + * Get a list of consoles for the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -41,9 +43,9 @@ public interface Consoles { /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -58,9 +60,9 @@ Response getWithResponse(String resourceGroupName, String virtualMachin /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -73,23 +75,24 @@ Response getWithResponse(String resourceGroupName, String virtualMachin /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String virtualMachineName, String consoleName); + OperationStatusResult delete(String resourceGroupName, String virtualMachineName, String consoleName); /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param consoleName The name of the virtual machine console. @@ -97,14 +100,16 @@ Response getWithResponse(String resourceGroupName, String virtualMachin * @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 current status of an async operation. */ - void delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context); + OperationStatusResult delete(String resourceGroupName, String virtualMachineName, String consoleName, + Context context); /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -115,9 +120,9 @@ Response getWithResponse(String resourceGroupName, String virtualMachin /** * Retrieve the virtual machine console. - * - *

Get properties of the provided virtual machine console. - * + * + * Get properties of the provided virtual machine console. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,32 +134,34 @@ Response getWithResponse(String resourceGroupName, String virtualMachin /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the virtual machine console. - * - *

Delete the provided virtual machine console. - * + * + * Delete the provided virtual machine console. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Console resource. - * + * * @param name resource name. * @return the first stage of the new Console definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java index 0b3153141a72c..ba27e4f3bb645 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the control plane will be impacted during the upgrade. */ +/** + * The indicator of whether the control plane will be impacted during the upgrade. + */ public final class ControlImpact extends ExpandableStringEnum { - /** Static value True for ControlImpact. */ + /** + * Static value True for ControlImpact. + */ public static final ControlImpact TRUE = fromString("True"); - /** Static value False for ControlImpact. */ + /** + * Static value False for ControlImpact. + */ public static final ControlImpact FALSE = fromString("False"); /** * Creates a new instance of ControlImpact value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ControlImpact() { /** * Creates or finds a ControlImpact from its string representation. - * + * * @param name a name to look for. * @return the corresponding ControlImpact. */ - @JsonCreator public static ControlImpact fromString(String name) { return fromString(name, ControlImpact.class); } /** * Gets known ControlImpact values. - * + * * @return known ControlImpact values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodeConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodeConfiguration.java index 6168ccafe569f..3f48f1353d69d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodeConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodeConfiguration.java @@ -6,7 +6,11 @@ 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; /** @@ -14,45 +18,38 @@ * Kubernetes cluster. */ @Fluent -public final class ControlPlaneNodeConfiguration { +public final class ControlPlaneNodeConfiguration implements JsonSerializable { /* - * AdministratorConfiguration represents the administrative credentials that will be applied to the control plane - * and agent pool nodes in Kubernetes clusters. - * * The administrator credentials to be used for the nodes in the control plane. */ - @JsonProperty(value = "administratorConfiguration") private AdministratorConfiguration administratorConfiguration; /* * The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the * control plane. If not specified, all availability zones will be used. */ - @JsonProperty(value = "availabilityZones") private List availabilityZones; /* * The number of virtual machines that use this configuration. */ - @JsonProperty(value = "count", required = true) private long count; /* * The name of the VM SKU supplied during creation. */ - @JsonProperty(value = "vmSkuName", required = true) private String vmSkuName; - /** Creates an instance of ControlPlaneNodeConfiguration class. */ + /** + * Creates an instance of ControlPlaneNodeConfiguration class. + */ public ControlPlaneNodeConfiguration() { } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in the control plane. - * + * Get the administratorConfiguration property: The administrator credentials to be used for the nodes in the + * control plane. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -60,11 +57,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in the control plane. - * + * Set the administratorConfiguration property: The administrator credentials to be used for the nodes in the + * control plane. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the ControlPlaneNodeConfiguration object itself. */ @@ -77,7 +72,7 @@ public AdministratorConfiguration administratorConfiguration() { /** * Get the availabilityZones property: The list of availability zones of the Network Cloud cluster to be used for * the provisioning of nodes in the control plane. If not specified, all availability zones will be used. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -87,7 +82,7 @@ public List availabilityZones() { /** * Set the availabilityZones property: The list of availability zones of the Network Cloud cluster to be used for * the provisioning of nodes in the control plane. If not specified, all availability zones will be used. - * + * * @param availabilityZones the availabilityZones value to set. * @return the ControlPlaneNodeConfiguration object itself. */ @@ -98,7 +93,7 @@ public ControlPlaneNodeConfiguration withAvailabilityZones(List availabi /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public long count() { @@ -107,7 +102,7 @@ public long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the ControlPlaneNodeConfiguration object itself. */ @@ -118,7 +113,7 @@ public ControlPlaneNodeConfiguration withCount(long count) { /** * Get the vmSkuName property: The name of the VM SKU supplied during creation. - * + * * @return the vmSkuName value. */ public String vmSkuName() { @@ -127,7 +122,7 @@ public String vmSkuName() { /** * Set the vmSkuName property: The name of the VM SKU supplied during creation. - * + * * @param vmSkuName the vmSkuName value to set. * @return the ControlPlaneNodeConfiguration object itself. */ @@ -138,7 +133,7 @@ public ControlPlaneNodeConfiguration withVmSkuName(String vmSkuName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -146,10 +141,61 @@ public void validate() { administratorConfiguration().validate(); } if (vmSkuName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property vmSkuName in model ControlPlaneNodeConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSkuName in model ControlPlaneNodeConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(ControlPlaneNodeConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("count", this.count); + jsonWriter.writeStringField("vmSkuName", this.vmSkuName); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ControlPlaneNodeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ControlPlaneNodeConfiguration 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 ControlPlaneNodeConfiguration. + */ + public static ControlPlaneNodeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ControlPlaneNodeConfiguration deserializedControlPlaneNodeConfiguration + = new ControlPlaneNodeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedControlPlaneNodeConfiguration.count = reader.getLong(); + } else if ("vmSkuName".equals(fieldName)) { + deserializedControlPlaneNodeConfiguration.vmSkuName = reader.getString(); + } else if ("administratorConfiguration".equals(fieldName)) { + deserializedControlPlaneNodeConfiguration.administratorConfiguration + = AdministratorConfiguration.fromJson(reader); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedControlPlaneNodeConfiguration.availabilityZones = availabilityZones; + } else { + reader.skipChildren(); + } + } + + return deserializedControlPlaneNodeConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodePatchConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodePatchConfiguration.java index 3202315ee21d7..98ba2ee8ea0ef 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodePatchConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlPlaneNodePatchConfiguration.java @@ -5,27 +5,60 @@ package com.azure.resourcemanager.networkcloud.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; /** * ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this * Kubernetes cluster. */ @Fluent -public final class ControlPlaneNodePatchConfiguration { +public final class ControlPlaneNodePatchConfiguration implements JsonSerializable { + /* + * The configuration of administrator credentials for the control plane nodes. + */ + private AdministratorConfigurationPatch administratorConfiguration; + /* * The number of virtual machines that use this configuration. */ - @JsonProperty(value = "count") private Long count; - /** Creates an instance of ControlPlaneNodePatchConfiguration class. */ + /** + * Creates an instance of ControlPlaneNodePatchConfiguration class. + */ public ControlPlaneNodePatchConfiguration() { } + /** + * Get the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @return the administratorConfiguration value. + */ + public AdministratorConfigurationPatch administratorConfiguration() { + return this.administratorConfiguration; + } + + /** + * Set the administratorConfiguration property: The configuration of administrator credentials for the control plane + * nodes. + * + * @param administratorConfiguration the administratorConfiguration value to set. + * @return the ControlPlaneNodePatchConfiguration object itself. + */ + public ControlPlaneNodePatchConfiguration + withAdministratorConfiguration(AdministratorConfigurationPatch administratorConfiguration) { + this.administratorConfiguration = administratorConfiguration; + return this; + } + /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public Long count() { @@ -34,7 +67,7 @@ public Long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the ControlPlaneNodePatchConfiguration object itself. */ @@ -45,9 +78,53 @@ public ControlPlaneNodePatchConfiguration withCount(Long count) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (administratorConfiguration() != null) { + administratorConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ControlPlaneNodePatchConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ControlPlaneNodePatchConfiguration 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 ControlPlaneNodePatchConfiguration. + */ + public static ControlPlaneNodePatchConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ControlPlaneNodePatchConfiguration deserializedControlPlaneNodePatchConfiguration + = new ControlPlaneNodePatchConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorConfiguration".equals(fieldName)) { + deserializedControlPlaneNodePatchConfiguration.administratorConfiguration + = AdministratorConfigurationPatch.fromJson(reader); + } else if ("count".equals(fieldName)) { + deserializedControlPlaneNodePatchConfiguration.count = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedControlPlaneNodePatchConfiguration; + }); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java index 965f9dea4ef52..fa8f92efb45bc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java @@ -5,23 +5,27 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * The indicator of whether this is the default gateway. Only one of the attached networks (including the - * CloudServicesNetwork attachment) for a single machine may be specified as True. + * The indicator of whether this is the default gateway. + * Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be + * specified as True. */ public final class DefaultGateway extends ExpandableStringEnum { - /** Static value True for DefaultGateway. */ + /** + * Static value True for DefaultGateway. + */ public static final DefaultGateway TRUE = fromString("True"); - /** Static value False for DefaultGateway. */ + /** + * Static value False for DefaultGateway. + */ public static final DefaultGateway FALSE = fromString("False"); /** * Creates a new instance of DefaultGateway value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +34,17 @@ public DefaultGateway() { /** * Creates or finds a DefaultGateway from its string representation. - * + * * @param name a name to look for. * @return the corresponding DefaultGateway. */ - @JsonCreator public static DefaultGateway fromString(String name) { return fromString(name, DefaultGateway.class); } /** * Gets known DefaultGateway values. - * + * * @return known DefaultGateway values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java index db9d27f815484..ae0206d20e7f3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The connection type of the device. */ +/** + * The connection type of the device. + */ public final class DeviceConnectionType extends ExpandableStringEnum { - /** Static value PCI for DeviceConnectionType. */ + /** + * Static value PCI for DeviceConnectionType. + */ public static final DeviceConnectionType PCI = fromString("PCI"); /** * Creates a new instance of DeviceConnectionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public DeviceConnectionType() { /** * Creates or finds a DeviceConnectionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DeviceConnectionType. */ - @JsonCreator public static DeviceConnectionType fromString(String name) { return fromString(name, DeviceConnectionType.class); } /** * Gets known DeviceConnectionType values. - * + * * @return known DeviceConnectionType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java index bc873fb4204e5..17fcd08d0e827 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The disk type of rack SKU resource. */ +/** + * The disk type of rack SKU resource. + */ public final class DiskType extends ExpandableStringEnum { - /** Static value HDD for DiskType. */ + /** + * Static value HDD for DiskType. + */ public static final DiskType HDD = fromString("HDD"); - /** Static value SSD for DiskType. */ + /** + * Static value SSD for DiskType. + */ public static final DiskType SSD = fromString("SSD"); /** * Creates a new instance of DiskType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public DiskType() { /** * Creates or finds a DiskType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DiskType. */ - @JsonCreator public static DiskType fromString(String name) { return fromString(name, DiskType.class); } /** * Gets known DiskType values. - * + * * @return known DiskType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java index 1e57da2d51409..45183c258c48f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java @@ -6,7 +6,11 @@ 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; /** @@ -14,22 +18,22 @@ * purpose. */ @Fluent -public final class EgressEndpoint { +public final class EgressEndpoint implements JsonSerializable { /* * The descriptive category name of endpoints accessible by the AKS agent node. For example, * azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the * category 'default'. */ - @JsonProperty(value = "category", required = true) private String category; /* * The list of endpoint dependencies. */ - @JsonProperty(value = "endpoints", required = true) private List endpoints; - /** Creates an instance of EgressEndpoint class. */ + /** + * Creates an instance of EgressEndpoint class. + */ public EgressEndpoint() { } @@ -37,7 +41,7 @@ public EgressEndpoint() { * Get the category property: The descriptive category name of endpoints accessible by the AKS agent node. For * example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use * the category 'default'. - * + * * @return the category value. */ public String category() { @@ -48,7 +52,7 @@ public String category() { * Set the category property: The descriptive category name of endpoints accessible by the AKS agent node. For * example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use * the category 'default'. - * + * * @param category the category value to set. * @return the EgressEndpoint object itself. */ @@ -59,7 +63,7 @@ public EgressEndpoint withCategory(String category) { /** * Get the endpoints property: The list of endpoint dependencies. - * + * * @return the endpoints value. */ public List endpoints() { @@ -68,7 +72,7 @@ public List endpoints() { /** * Set the endpoints property: The list of endpoint dependencies. - * + * * @param endpoints the endpoints value to set. * @return the EgressEndpoint object itself. */ @@ -79,21 +83,63 @@ public EgressEndpoint withEndpoints(List endpoints) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (category() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property category in model EgressEndpoint")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property category in model EgressEndpoint")); } if (endpoints() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property endpoints in model EgressEndpoint")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property endpoints in model EgressEndpoint")); } else { endpoints().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(EgressEndpoint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EgressEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EgressEndpoint 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 EgressEndpoint. + */ + public static EgressEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EgressEndpoint deserializedEgressEndpoint = new EgressEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedEgressEndpoint.category = reader.getString(); + } else if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> EndpointDependency.fromJson(reader1)); + deserializedEgressEndpoint.endpoints = endpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedEgressEndpoint; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java index 42b1661dd0b7a..857117e6bc9be 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java @@ -6,30 +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; -/** EndpointDependency represents the definition of an endpoint, including the domain and details. */ +/** + * EndpointDependency represents the definition of an endpoint, including the domain and details. + */ @Fluent -public final class EndpointDependency { +public final class EndpointDependency implements JsonSerializable { /* * The domain name of the dependency. */ - @JsonProperty(value = "domainName", required = true) private String domainName; /* * The port of this endpoint. */ - @JsonProperty(value = "port") private Long port; - /** Creates an instance of EndpointDependency class. */ + /** + * Creates an instance of EndpointDependency class. + */ public EndpointDependency() { } /** * Get the domainName property: The domain name of the dependency. - * + * * @return the domainName value. */ public String domainName() { @@ -38,7 +44,7 @@ public String domainName() { /** * Set the domainName property: The domain name of the dependency. - * + * * @param domainName the domainName value to set. * @return the EndpointDependency object itself. */ @@ -49,7 +55,7 @@ public EndpointDependency withDomainName(String domainName) { /** * Get the port property: The port of this endpoint. - * + * * @return the port value. */ public Long port() { @@ -58,7 +64,7 @@ public Long port() { /** * Set the port property: The port of this endpoint. - * + * * @param port the port value to set. * @return the EndpointDependency object itself. */ @@ -69,15 +75,55 @@ public EndpointDependency withPort(Long port) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (domainName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property domainName in model EndpointDependency")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property domainName in model EndpointDependency")); } } private static final ClientLogger LOGGER = new ClientLogger(EndpointDependency.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointDependency from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointDependency 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 EndpointDependency. + */ + public static EndpointDependency fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointDependency deserializedEndpointDependency = new EndpointDependency(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainName".equals(fieldName)) { + deserializedEndpointDependency.domainName = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpointDependency.port = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointDependency; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java index 70157b75a4b2c..78af3d07d9893 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java @@ -6,30 +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; -/** ExtendedLocation represents the Azure custom location where the resource will be created. */ +/** + * ExtendedLocation represents the Azure custom location where the resource will be created. + */ @Fluent -public final class ExtendedLocation { +public final class ExtendedLocation implements JsonSerializable { /* * The resource ID of the extended location on which the resource will be created. */ - @JsonProperty(value = "name", required = true) private String name; /* * The extended location type, for example, CustomLocation. */ - @JsonProperty(value = "type", required = true) private String type; - /** Creates an instance of ExtendedLocation class. */ + /** + * Creates an instance of ExtendedLocation class. + */ public ExtendedLocation() { } /** * Get the name property: The resource ID of the extended location on which the resource will be created. - * + * * @return the name value. */ public String name() { @@ -38,7 +44,7 @@ public String name() { /** * Set the name property: The resource ID of the extended location on which the resource will be created. - * + * * @param name the name value to set. * @return the ExtendedLocation object itself. */ @@ -49,7 +55,7 @@ public ExtendedLocation withName(String name) { /** * Get the type property: The extended location type, for example, CustomLocation. - * + * * @return the type value. */ public String type() { @@ -58,7 +64,7 @@ public String type() { /** * Set the type property: The extended location type, for example, CustomLocation. - * + * * @param type the type value to set. * @return the ExtendedLocation object itself. */ @@ -69,19 +75,59 @@ public ExtendedLocation withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ExtendedLocation")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ExtendedLocation")); } if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ExtendedLocation")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ExtendedLocation")); } } private static final ClientLogger LOGGER = new ClientLogger(ExtendedLocation.class); + + /** + * {@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 ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation 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 ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FabricPeeringEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FabricPeeringEnabled.java index 47044b3302a64..d00c4c366a990 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FabricPeeringEnabled.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FabricPeeringEnabled.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator to specify if the load balancer peers with the network fabric. */ +/** + * The indicator to specify if the load balancer peers with the network fabric. + */ public final class FabricPeeringEnabled extends ExpandableStringEnum { - /** Static value True for FabricPeeringEnabled. */ + /** + * Static value True for FabricPeeringEnabled. + */ public static final FabricPeeringEnabled TRUE = fromString("True"); - /** Static value False for FabricPeeringEnabled. */ + /** + * Static value False for FabricPeeringEnabled. + */ public static final FabricPeeringEnabled FALSE = fromString("False"); /** * Creates a new instance of FabricPeeringEnabled value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public FabricPeeringEnabled() { /** * Creates or finds a FabricPeeringEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding FabricPeeringEnabled. */ - @JsonCreator public static FabricPeeringEnabled fromString(String name) { return fromString(name, FabricPeeringEnabled.class); } /** * Gets known FabricPeeringEnabled values. - * + * * @return known FabricPeeringEnabled values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureDetailedStatus.java index 5f5b57f0b6cdb..892f3d50f3e94 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The status representing the state of this feature. */ +/** + * The status representing the state of this feature. + */ public final class FeatureDetailedStatus extends ExpandableStringEnum { - /** Static value Running for FeatureDetailedStatus. */ + /** + * Static value Running for FeatureDetailedStatus. + */ public static final FeatureDetailedStatus RUNNING = fromString("Running"); - /** Static value Failed for FeatureDetailedStatus. */ + /** + * Static value Failed for FeatureDetailedStatus. + */ public static final FeatureDetailedStatus FAILED = fromString("Failed"); - /** Static value Unknown for FeatureDetailedStatus. */ + /** + * Static value Unknown for FeatureDetailedStatus. + */ public static final FeatureDetailedStatus UNKNOWN = fromString("Unknown"); /** * Creates a new instance of FeatureDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public FeatureDetailedStatus() { /** * Creates or finds a FeatureDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding FeatureDetailedStatus. */ - @JsonCreator public static FeatureDetailedStatus fromString(String name) { return fromString(name, FeatureDetailedStatus.class); } /** * Gets known FeatureDetailedStatus values. - * + * * @return known FeatureDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureStatus.java index ad779d4ee5e59..85cd700a60dc1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/FeatureStatus.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.networkcloud.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; -/** FeatureStatus contains information regarding a Kubernetes cluster feature. */ +/** + * FeatureStatus contains information regarding a Kubernetes cluster feature. + */ @Immutable -public final class FeatureStatus { +public final class FeatureStatus implements JsonSerializable { /* * The status representing the state of this feature. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private FeatureDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* * The name of the feature. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The version of the feature. */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; - /** Creates an instance of FeatureStatus class. */ + /** + * Creates an instance of FeatureStatus class. + */ public FeatureStatus() { } /** * Get the detailedStatus property: The status representing the state of this feature. - * + * * @return the detailedStatus value. */ public FeatureDetailedStatus detailedStatus() { @@ -49,7 +53,7 @@ public FeatureDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -58,7 +62,7 @@ public String detailedStatusMessage() { /** * Get the name property: The name of the feature. - * + * * @return the name value. */ public String name() { @@ -67,7 +71,7 @@ public String name() { /** * Get the version property: The version of the feature. - * + * * @return the version value. */ public String version() { @@ -76,9 +80,50 @@ public String version() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureStatus 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 FeatureStatus. + */ + public static FeatureStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureStatus deserializedFeatureStatus = new FeatureStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("detailedStatus".equals(fieldName)) { + deserializedFeatureStatus.detailedStatus = FeatureDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedFeatureStatus.detailedStatusMessage = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeatureStatus.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedFeatureStatus.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureStatus; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java index 67d790cdd15a1..e91867f4dbfbe 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.networkcloud.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; import java.util.List; /** @@ -13,35 +17,34 @@ * information acquired from the model/sku information and from the ironic inspector. */ @Immutable -public final class HardwareInventory { +public final class HardwareInventory implements JsonSerializable { /* * Freeform data extracted from the environment about this machine. This information varies depending on the * specific hardware and configuration. */ - @JsonProperty(value = "additionalHostInformation", access = JsonProperty.Access.WRITE_ONLY) private String additionalHostInformation; /* * The list of network interfaces and associated details for the bare metal machine. */ - @JsonProperty(value = "interfaces", access = JsonProperty.Access.WRITE_ONLY) private List interfaces; /* * Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated * details for the bare metal machine. */ - @JsonProperty(value = "nics", access = JsonProperty.Access.WRITE_ONLY) private List nics; - /** Creates an instance of HardwareInventory class. */ + /** + * Creates an instance of HardwareInventory class. + */ public HardwareInventory() { } /** * Get the additionalHostInformation property: Freeform data extracted from the environment about this machine. This * information varies depending on the specific hardware and configuration. - * + * * @return the additionalHostInformation value. */ public String additionalHostInformation() { @@ -50,7 +53,7 @@ public String additionalHostInformation() { /** * Get the interfaces property: The list of network interfaces and associated details for the bare metal machine. - * + * * @return the interfaces value. */ public List interfaces() { @@ -60,7 +63,7 @@ public List interfaces() { /** * Get the nics property: Field Deprecated. Will be removed in an upcoming version. The list of network interface * cards and associated details for the bare metal machine. - * + * * @return the nics value. */ public List nics() { @@ -69,7 +72,7 @@ public List nics() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +83,46 @@ public void validate() { nics().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HardwareInventory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HardwareInventory 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 HardwareInventory. + */ + public static HardwareInventory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HardwareInventory deserializedHardwareInventory = new HardwareInventory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalHostInformation".equals(fieldName)) { + deserializedHardwareInventory.additionalHostInformation = reader.getString(); + } else if ("interfaces".equals(fieldName)) { + List interfaces + = reader.readArray(reader1 -> HardwareInventoryNetworkInterface.fromJson(reader1)); + deserializedHardwareInventory.interfaces = interfaces; + } else if ("nics".equals(fieldName)) { + List nics = reader.readArray(reader1 -> Nic.fromJson(reader1)); + deserializedHardwareInventory.nics = nics; + } else { + reader.skipChildren(); + } + } + + return deserializedHardwareInventory; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java index 9a8a222bb5113..684fe29ef1368 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.networkcloud.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; -/** HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. */ +/** + * HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. + */ @Immutable -public final class HardwareInventoryNetworkInterface { +public final class HardwareInventoryNetworkInterface implements JsonSerializable { /* * The current status of the link. */ - @JsonProperty(value = "linkStatus", access = JsonProperty.Access.WRITE_ONLY) private String linkStatus; /* * The MAC address associated with this interface. */ - @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) private String macAddress; /* * The name of the interface. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The resource ID of the network interface for the port on the switch that this machine's interface is connected * to. */ - @JsonProperty(value = "networkInterfaceId", access = JsonProperty.Access.WRITE_ONLY) private String networkInterfaceId; - /** Creates an instance of HardwareInventoryNetworkInterface class. */ + /** + * Creates an instance of HardwareInventoryNetworkInterface class. + */ public HardwareInventoryNetworkInterface() { } /** * Get the linkStatus property: The current status of the link. - * + * * @return the linkStatus value. */ public String linkStatus() { @@ -50,7 +54,7 @@ public String linkStatus() { /** * Get the macAddress property: The MAC address associated with this interface. - * + * * @return the macAddress value. */ public String macAddress() { @@ -59,7 +63,7 @@ public String macAddress() { /** * Get the name property: The name of the interface. - * + * * @return the name value. */ public String name() { @@ -69,7 +73,7 @@ public String name() { /** * Get the networkInterfaceId property: The resource ID of the network interface for the port on the switch that * this machine's interface is connected to. - * + * * @return the networkInterfaceId value. */ public String networkInterfaceId() { @@ -78,9 +82,51 @@ public String networkInterfaceId() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HardwareInventoryNetworkInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HardwareInventoryNetworkInterface 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 HardwareInventoryNetworkInterface. + */ + public static HardwareInventoryNetworkInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HardwareInventoryNetworkInterface deserializedHardwareInventoryNetworkInterface + = new HardwareInventoryNetworkInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkStatus".equals(fieldName)) { + deserializedHardwareInventoryNetworkInterface.linkStatus = reader.getString(); + } else if ("macAddress".equals(fieldName)) { + deserializedHardwareInventoryNetworkInterface.macAddress = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHardwareInventoryNetworkInterface.name = reader.getString(); + } else if ("networkInterfaceId".equals(fieldName)) { + deserializedHardwareInventoryNetworkInterface.networkInterfaceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHardwareInventoryNetworkInterface; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java index 1a2670e7727cb..97f4b5b611f00 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java @@ -5,31 +5,38 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. */ +/** + * HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. + */ @Immutable -public final class HardwareValidationStatus { +public final class HardwareValidationStatus implements JsonSerializable { /* * The timestamp of the hardware validation execution. */ - @JsonProperty(value = "lastValidationTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastValidationTime; /* * The outcome of the hardware validation. */ - @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineHardwareValidationResult result; - /** Creates an instance of HardwareValidationStatus class. */ + /** + * Creates an instance of HardwareValidationStatus class. + */ public HardwareValidationStatus() { } /** * Get the lastValidationTime property: The timestamp of the hardware validation execution. - * + * * @return the lastValidationTime value. */ public OffsetDateTime lastValidationTime() { @@ -38,7 +45,7 @@ public OffsetDateTime lastValidationTime() { /** * Get the result property: The outcome of the hardware validation. - * + * * @return the result value. */ public BareMetalMachineHardwareValidationResult result() { @@ -47,9 +54,48 @@ public BareMetalMachineHardwareValidationResult result() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HardwareValidationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HardwareValidationStatus 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 HardwareValidationStatus. + */ + public static HardwareValidationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HardwareValidationStatus deserializedHardwareValidationStatus = new HardwareValidationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastValidationTime".equals(fieldName)) { + deserializedHardwareValidationStatus.lastValidationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("result".equals(fieldName)) { + deserializedHardwareValidationStatus.result + = BareMetalMachineHardwareValidationResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHardwareValidationStatus; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HugepagesSize.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HugepagesSize.java index 6555c5af30d2e..e604f900f53c4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HugepagesSize.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HugepagesSize.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The size of the hugepages to allocate. */ +/** + * The size of the hugepages to allocate. + */ public final class HugepagesSize extends ExpandableStringEnum { - /** Static value 2M for HugepagesSize. */ + /** + * Static value 2M for HugepagesSize. + */ public static final HugepagesSize TWOM = fromString("2M"); - /** Static value 1G for HugepagesSize. */ + /** + * Static value 1G for HugepagesSize. + */ public static final HugepagesSize ONEG = fromString("1G"); /** * Creates a new instance of HugepagesSize value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public HugepagesSize() { /** * Creates or finds a HugepagesSize from its string representation. - * + * * @param name a name to look for. * @return the corresponding HugepagesSize. */ - @JsonCreator public static HugepagesSize fromString(String name) { return fromString(name, HugepagesSize.class); } /** * Gets known HugepagesSize values. - * + * * @return known HugepagesSize values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java index 7634a579d3479..5abaa42078a96 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -14,15 +13,19 @@ * AKS Cluster. */ public final class HybridAksIpamEnabled extends ExpandableStringEnum { - /** Static value True for HybridAksIpamEnabled. */ + /** + * Static value True for HybridAksIpamEnabled. + */ public static final HybridAksIpamEnabled TRUE = fromString("True"); - /** Static value False for HybridAksIpamEnabled. */ + /** + * Static value False for HybridAksIpamEnabled. + */ public static final HybridAksIpamEnabled FALSE = fromString("False"); /** * Creates a new instance of HybridAksIpamEnabled value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +34,17 @@ public HybridAksIpamEnabled() { /** * Creates or finds a HybridAksIpamEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding HybridAksIpamEnabled. */ - @JsonCreator public static HybridAksIpamEnabled fromString(String name) { return fromString(name, HybridAksIpamEnabled.class); } /** * Gets known HybridAksIpamEnabled values. - * + * * @return known HybridAksIpamEnabled values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java index b2ce6f775932f..66ea2feb9d5c9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * network plugin type for Hybrid AKS. */ public final class HybridAksPluginType extends ExpandableStringEnum { - /** Static value DPDK for HybridAksPluginType. */ + /** + * Static value DPDK for HybridAksPluginType. + */ public static final HybridAksPluginType DPDK = fromString("DPDK"); - /** Static value SRIOV for HybridAksPluginType. */ + /** + * Static value SRIOV for HybridAksPluginType. + */ public static final HybridAksPluginType SRIOV = fromString("SRIOV"); - /** Static value OSDevice for HybridAksPluginType. */ + /** + * Static value OSDevice for HybridAksPluginType. + */ public static final HybridAksPluginType OSDEVICE = fromString("OSDevice"); /** * Creates a new instance of HybridAksPluginType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public HybridAksPluginType() { /** * Creates or finds a HybridAksPluginType from its string representation. - * + * * @param name a name to look for. * @return the corresponding HybridAksPluginType. */ - @JsonCreator public static HybridAksPluginType fromString(String name) { return fromString(name, HybridAksPluginType.class); } /** * Gets known HybridAksPluginType values. - * + * * @return known HybridAksPluginType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IdentitySelector.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IdentitySelector.java new file mode 100644 index 0000000000000..c13bb1d4f4c48 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IdentitySelector.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IdentitySelector represents the selection of a managed identity for use. + */ +@Fluent +public final class IdentitySelector implements JsonSerializable { + /* + * The type of managed identity that is being selected. + */ + private ManagedServiceIdentitySelectorType identityType; + + /* + * The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + */ + private String userAssignedIdentityResourceId; + + /** + * Creates an instance of IdentitySelector class. + */ + public IdentitySelector() { + } + + /** + * Get the identityType property: The type of managed identity that is being selected. + * + * @return the identityType value. + */ + public ManagedServiceIdentitySelectorType identityType() { + return this.identityType; + } + + /** + * Set the identityType property: The type of managed identity that is being selected. + * + * @param identityType the identityType value to set. + * @return the IdentitySelector object itself. + */ + public IdentitySelector withIdentityType(ManagedServiceIdentitySelectorType identityType) { + this.identityType = identityType; + return this; + } + + /** + * Get the userAssignedIdentityResourceId property: The user assigned managed identity resource ID to use. Mutually + * exclusive with a system assigned identity type. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: The user assigned managed identity resource ID to use. Mutually + * exclusive with a system assigned identity type. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the IdentitySelector object itself. + */ + public IdentitySelector withUserAssignedIdentityResourceId(String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + 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("identityType", this.identityType == null ? null : this.identityType.toString()); + jsonWriter.writeStringField("userAssignedIdentityResourceId", this.userAssignedIdentityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentitySelector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentitySelector 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 IdentitySelector. + */ + public static IdentitySelector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentitySelector deserializedIdentitySelector = new IdentitySelector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedIdentitySelector.identityType + = ManagedServiceIdentitySelectorType.fromString(reader.getString()); + } else if ("userAssignedIdentityResourceId".equals(fieldName)) { + deserializedIdentitySelector.userAssignedIdentityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentitySelector; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java index e26374235693f..7e0c5b4e171b0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java @@ -6,36 +6,41 @@ 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; -/** ImageRepositoryCredentials represents the credentials used to login to the image repository. */ +/** + * ImageRepositoryCredentials represents the credentials used to login to the image repository. + */ @Fluent -public final class ImageRepositoryCredentials { +public final class ImageRepositoryCredentials implements JsonSerializable { /* * The password or token used to access an image in the target repository. */ - @JsonProperty(value = "password") private String password; /* * The URL of the authentication server used to validate the repository credentials. */ - @JsonProperty(value = "registryUrl", required = true) private String registryUrl; /* * The username used to access an image in the target repository. */ - @JsonProperty(value = "username", required = true) private String username; - /** Creates an instance of ImageRepositoryCredentials class. */ + /** + * Creates an instance of ImageRepositoryCredentials class. + */ public ImageRepositoryCredentials() { } /** * Get the password property: The password or token used to access an image in the target repository. - * + * * @return the password value. */ public String password() { @@ -44,7 +49,7 @@ public String password() { /** * Set the password property: The password or token used to access an image in the target repository. - * + * * @param password the password value to set. * @return the ImageRepositoryCredentials object itself. */ @@ -55,7 +60,7 @@ public ImageRepositoryCredentials withPassword(String password) { /** * Get the registryUrl property: The URL of the authentication server used to validate the repository credentials. - * + * * @return the registryUrl value. */ public String registryUrl() { @@ -64,7 +69,7 @@ public String registryUrl() { /** * Set the registryUrl property: The URL of the authentication server used to validate the repository credentials. - * + * * @param registryUrl the registryUrl value to set. * @return the ImageRepositoryCredentials object itself. */ @@ -75,7 +80,7 @@ public ImageRepositoryCredentials withRegistryUrl(String registryUrl) { /** * Get the username property: The username used to access an image in the target repository. - * + * * @return the username value. */ public String username() { @@ -84,7 +89,7 @@ public String username() { /** * Set the username property: The username used to access an image in the target repository. - * + * * @param username the username value to set. * @return the ImageRepositoryCredentials object itself. */ @@ -95,23 +100,69 @@ public ImageRepositoryCredentials withUsername(String username) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (password() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property password in model ImageRepositoryCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property password in model ImageRepositoryCredentials")); } if (registryUrl() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property registryUrl in model ImageRepositoryCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property registryUrl in model ImageRepositoryCredentials")); } if (username() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property username in model ImageRepositoryCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property username in model ImageRepositoryCredentials")); } } private static final ClientLogger LOGGER = new ClientLogger(ImageRepositoryCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("registryUrl", this.registryUrl); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageRepositoryCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageRepositoryCredentials 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 ImageRepositoryCredentials. + */ + public static ImageRepositoryCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageRepositoryCredentials deserializedImageRepositoryCredentials = new ImageRepositoryCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("password".equals(fieldName)) { + deserializedImageRepositoryCredentials.password = reader.getString(); + } else if ("registryUrl".equals(fieldName)) { + deserializedImageRepositoryCredentials.registryUrl = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedImageRepositoryCredentials.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageRepositoryCredentials; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/InitialAgentPoolConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/InitialAgentPoolConfiguration.java index c4300510ca508..da3b1f9878ccc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/InitialAgentPoolConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/InitialAgentPoolConfiguration.java @@ -6,7 +6,11 @@ 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; /** @@ -14,50 +18,37 @@ * with a Kubernetes cluster. */ @Fluent -public final class InitialAgentPoolConfiguration { +public final class InitialAgentPoolConfiguration implements JsonSerializable { /* - * AdministratorConfiguration represents the administrative credentials that will be applied to the control plane - * and agent pool nodes in Kubernetes clusters. - * * The administrator credentials to be used for the nodes in this agent pool. */ - @JsonProperty(value = "administratorConfiguration") private AdministratorConfiguration administratorConfiguration; /* - * AgentOptions are configurations that will be applied to each agent in an agent pool. - * * The configurations that will be applied to each agent in this agent pool. */ - @JsonProperty(value = "agentOptions") private AgentOptions agentOptions; /* - * AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - * * The configuration of networks being attached to the agent pool for use by the workloads that run on this * Kubernetes cluster. */ - @JsonProperty(value = "attachedNetworkConfiguration") private AttachedNetworkConfiguration attachedNetworkConfiguration; /* * The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent * pool. If not specified, all availability zones will be used. */ - @JsonProperty(value = "availabilityZones") private List availabilityZones; /* * The number of virtual machines that use this configuration. */ - @JsonProperty(value = "count", required = true) private long count; /* * The labels applied to the nodes in this agent pool. */ - @JsonProperty(value = "labels") private List labels; /* @@ -65,45 +56,38 @@ public final class InitialAgentPoolConfiguration { * features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. * Every Kubernetes cluster must contain at least one system node pool with at least one node. */ - @JsonProperty(value = "mode", required = true) private AgentPoolMode mode; /* * The name that will be used for the agent pool resource representing this agent pool. */ - @JsonProperty(value = "name", required = true) private String name; /* * The taints applied to the nodes in this agent pool. */ - @JsonProperty(value = "taints") private List taints; /* - * AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * * The configuration of the agent pool. */ - @JsonProperty(value = "upgradeSettings") private AgentPoolUpgradeSettings upgradeSettings; /* * The name of the VM SKU that determines the size of resources allocated for node VMs. */ - @JsonProperty(value = "vmSkuName", required = true) private String vmSkuName; - /** Creates an instance of InitialAgentPoolConfiguration class. */ + /** + * Creates an instance of InitialAgentPoolConfiguration class. + */ public InitialAgentPoolConfiguration() { } /** - * Get the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Get the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @return the administratorConfiguration value. */ public AdministratorConfiguration administratorConfiguration() { @@ -111,11 +95,9 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Set the administratorConfiguration property: AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrator credentials to be used for the nodes in this agent pool. - * + * Set the administratorConfiguration property: The administrator credentials to be used for the nodes in this agent + * pool. + * * @param administratorConfiguration the administratorConfiguration value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -126,11 +108,8 @@ public AdministratorConfiguration administratorConfiguration() { } /** - * Get the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Get the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @return the agentOptions value. */ public AgentOptions agentOptions() { @@ -138,11 +117,8 @@ public AgentOptions agentOptions() { } /** - * Set the agentOptions property: AgentOptions are configurations that will be applied to each agent in an agent - * pool. - * - *

The configurations that will be applied to each agent in this agent pool. - * + * Set the agentOptions property: The configurations that will be applied to each agent in this agent pool. + * * @param agentOptions the agentOptions value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -152,12 +128,9 @@ public InitialAgentPoolConfiguration withAgentOptions(AgentOptions agentOptions) } /** - * Get the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Get the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @return the attachedNetworkConfiguration value. */ public AttachedNetworkConfiguration attachedNetworkConfiguration() { @@ -165,12 +138,9 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { } /** - * Set the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the agent pool for use by the workloads that run on this - * Kubernetes cluster. - * + * Set the attachedNetworkConfiguration property: The configuration of networks being attached to the agent pool for + * use by the workloads that run on this Kubernetes cluster. + * * @param attachedNetworkConfiguration the attachedNetworkConfiguration value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -183,7 +153,7 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { /** * Get the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @return the availabilityZones value. */ public List availabilityZones() { @@ -193,7 +163,7 @@ public List availabilityZones() { /** * Set the availabilityZones property: The list of availability zones of the Network Cloud cluster used for the * provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - * + * * @param availabilityZones the availabilityZones value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -204,7 +174,7 @@ public InitialAgentPoolConfiguration withAvailabilityZones(List availabi /** * Get the count property: The number of virtual machines that use this configuration. - * + * * @return the count value. */ public long count() { @@ -213,7 +183,7 @@ public long count() { /** * Set the count property: The number of virtual machines that use this configuration. - * + * * @param count the count value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -224,7 +194,7 @@ public InitialAgentPoolConfiguration withCount(long count) { /** * Get the labels property: The labels applied to the nodes in this agent pool. - * + * * @return the labels value. */ public List labels() { @@ -233,7 +203,7 @@ public List labels() { /** * Set the labels property: The labels applied to the nodes in this agent pool. - * + * * @param labels the labels value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -246,7 +216,7 @@ public InitialAgentPoolConfiguration withLabels(List labels) { * Get the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @return the mode value. */ public AgentPoolMode mode() { @@ -257,7 +227,7 @@ public AgentPoolMode mode() { * Set the mode property: The selection of how this agent pool is utilized, either as a system pool or a user pool. * System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to * user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. - * + * * @param mode the mode value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -268,7 +238,7 @@ public InitialAgentPoolConfiguration withMode(AgentPoolMode mode) { /** * Get the name property: The name that will be used for the agent pool resource representing this agent pool. - * + * * @return the name value. */ public String name() { @@ -277,7 +247,7 @@ public String name() { /** * Set the name property: The name that will be used for the agent pool resource representing this agent pool. - * + * * @param name the name value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -288,7 +258,7 @@ public InitialAgentPoolConfiguration withName(String name) { /** * Get the taints property: The taints applied to the nodes in this agent pool. - * + * * @return the taints value. */ public List taints() { @@ -297,7 +267,7 @@ public List taints() { /** * Set the taints property: The taints applied to the nodes in this agent pool. - * + * * @param taints the taints value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -307,10 +277,8 @@ public InitialAgentPoolConfiguration withTaints(List taints) { } /** - * Get the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Get the upgradeSettings property: The configuration of the agent pool. + * * @return the upgradeSettings value. */ public AgentPoolUpgradeSettings upgradeSettings() { @@ -318,10 +286,8 @@ public AgentPoolUpgradeSettings upgradeSettings() { } /** - * Set the upgradeSettings property: AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. - * - *

The configuration of the agent pool. - * + * Set the upgradeSettings property: The configuration of the agent pool. + * * @param upgradeSettings the upgradeSettings value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -332,7 +298,7 @@ public InitialAgentPoolConfiguration withUpgradeSettings(AgentPoolUpgradeSetting /** * Get the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @return the vmSkuName value. */ public String vmSkuName() { @@ -341,7 +307,7 @@ public String vmSkuName() { /** * Set the vmSkuName property: The name of the VM SKU that determines the size of resources allocated for node VMs. - * + * * @param vmSkuName the vmSkuName value to set. * @return the InitialAgentPoolConfiguration object itself. */ @@ -352,7 +318,7 @@ public InitialAgentPoolConfiguration withVmSkuName(String vmSkuName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -369,12 +335,14 @@ public void validate() { labels().forEach(e -> e.validate()); } if (mode() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property mode in model InitialAgentPoolConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property mode in model InitialAgentPoolConfiguration")); } if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model InitialAgentPoolConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model InitialAgentPoolConfiguration")); } if (taints() != null) { taints().forEach(e -> e.validate()); @@ -383,10 +351,86 @@ public void validate() { upgradeSettings().validate(); } if (vmSkuName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property vmSkuName in model InitialAgentPoolConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSkuName in model InitialAgentPoolConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(InitialAgentPoolConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("count", this.count); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("vmSkuName", this.vmSkuName); + jsonWriter.writeJsonField("administratorConfiguration", this.administratorConfiguration); + jsonWriter.writeJsonField("agentOptions", this.agentOptions); + jsonWriter.writeJsonField("attachedNetworkConfiguration", this.attachedNetworkConfiguration); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("taints", this.taints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("upgradeSettings", this.upgradeSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitialAgentPoolConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitialAgentPoolConfiguration 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 InitialAgentPoolConfiguration. + */ + public static InitialAgentPoolConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitialAgentPoolConfiguration deserializedInitialAgentPoolConfiguration + = new InitialAgentPoolConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.count = reader.getLong(); + } else if ("mode".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.mode = AgentPoolMode.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.name = reader.getString(); + } else if ("vmSkuName".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.vmSkuName = reader.getString(); + } else if ("administratorConfiguration".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.administratorConfiguration + = AdministratorConfiguration.fromJson(reader); + } else if ("agentOptions".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.agentOptions = AgentOptions.fromJson(reader); + } else if ("attachedNetworkConfiguration".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.attachedNetworkConfiguration + = AttachedNetworkConfiguration.fromJson(reader); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedInitialAgentPoolConfiguration.availabilityZones = availabilityZones; + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedInitialAgentPoolConfiguration.labels = labels; + } else if ("taints".equals(fieldName)) { + List taints = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedInitialAgentPoolConfiguration.taints = taints; + } else if ("upgradeSettings".equals(fieldName)) { + deserializedInitialAgentPoolConfiguration.upgradeSettings + = AgentPoolUpgradeSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInitialAgentPoolConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAddressPool.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAddressPool.java index bc75a5f867fde..93b5dff147c7f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAddressPool.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAddressPool.java @@ -6,46 +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; -/** IpAddressPool represents a pool of IP addresses that can be allocated to a service. */ +/** + * IpAddressPool represents a pool of IP addresses that can be allocated to a service. + */ @Fluent -public final class IpAddressPool { +public final class IpAddressPool implements JsonSerializable { /* * The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range - * of IP addresses. + * of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 + * (IPv4) and /128 (IPv6) prefixes. */ - @JsonProperty(value = "addresses", required = true) private List addresses; /* * The indicator to determine if automatic allocation from the pool should occur. */ - @JsonProperty(value = "autoAssign") private BfdEnabled autoAssign; /* * The name used to identify this IP address pool for association with a BGP advertisement. */ - @JsonProperty(value = "name", required = true) private String name; /* - * The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option - * will only use IP addresses between .1 and .254 inclusive. + * The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will + * only use IP addresses between .1 and .254 inclusive. */ - @JsonProperty(value = "onlyUseHostIps") private BfdEnabled onlyUseHostIps; - /** Creates an instance of IpAddressPool class. */ + /** + * Creates an instance of IpAddressPool class. + */ public IpAddressPool() { } /** * Get the addresses property: The list of IP address ranges. Each range can be a either a subnet in CIDR format or - * an explicit start-end range of IP addresses. - * + * an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is + * supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + * * @return the addresses value. */ public List addresses() { @@ -54,8 +60,9 @@ public List addresses() { /** * Set the addresses property: The list of IP address ranges. Each range can be a either a subnet in CIDR format or - * an explicit start-end range of IP addresses. - * + * an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is + * supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + * * @param addresses the addresses value to set. * @return the IpAddressPool object itself. */ @@ -66,7 +73,7 @@ public IpAddressPool withAddresses(List addresses) { /** * Get the autoAssign property: The indicator to determine if automatic allocation from the pool should occur. - * + * * @return the autoAssign value. */ public BfdEnabled autoAssign() { @@ -75,7 +82,7 @@ public BfdEnabled autoAssign() { /** * Set the autoAssign property: The indicator to determine if automatic allocation from the pool should occur. - * + * * @param autoAssign the autoAssign value to set. * @return the IpAddressPool object itself. */ @@ -86,7 +93,7 @@ public IpAddressPool withAutoAssign(BfdEnabled autoAssign) { /** * Get the name property: The name used to identify this IP address pool for association with a BGP advertisement. - * + * * @return the name value. */ public String name() { @@ -95,7 +102,7 @@ public String name() { /** * Set the name property: The name used to identify this IP address pool for association with a BGP advertisement. - * + * * @param name the name value to set. * @return the IpAddressPool object itself. */ @@ -107,7 +114,7 @@ public IpAddressPool withName(String name) { /** * Get the onlyUseHostIps property: The indicator to prevent the use of IP addresses ending with .0 and .255 for * this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. - * + * * @return the onlyUseHostIps value. */ public BfdEnabled onlyUseHostIps() { @@ -117,7 +124,7 @@ public BfdEnabled onlyUseHostIps() { /** * Set the onlyUseHostIps property: The indicator to prevent the use of IP addresses ending with .0 and .255 for * this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. - * + * * @param onlyUseHostIps the onlyUseHostIps value to set. * @return the IpAddressPool object itself. */ @@ -128,19 +135,67 @@ public IpAddressPool withOnlyUseHostIps(BfdEnabled onlyUseHostIps) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (addresses() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property addresses in model IpAddressPool")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property addresses in model IpAddressPool")); } if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model IpAddressPool")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model IpAddressPool")); } } private static final ClientLogger LOGGER = new ClientLogger(IpAddressPool.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addresses", this.addresses, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("autoAssign", this.autoAssign == null ? null : this.autoAssign.toString()); + jsonWriter.writeStringField("onlyUseHostIps", + this.onlyUseHostIps == null ? null : this.onlyUseHostIps.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressPool 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 IpAddressPool. + */ + public static IpAddressPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressPool deserializedIpAddressPool = new IpAddressPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addresses".equals(fieldName)) { + List addresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpAddressPool.addresses = addresses; + } else if ("name".equals(fieldName)) { + deserializedIpAddressPool.name = reader.getString(); + } else if ("autoAssign".equals(fieldName)) { + deserializedIpAddressPool.autoAssign = BfdEnabled.fromString(reader.getString()); + } else if ("onlyUseHostIps".equals(fieldName)) { + deserializedIpAddressPool.onlyUseHostIps = BfdEnabled.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddressPool; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java index 5a8e2f2280ffa..d3f4ede6d789b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the IP address allocation, defaulted to "DualStack". */ +/** + * The type of the IP address allocation, defaulted to "DualStack". + */ public final class IpAllocationType extends ExpandableStringEnum { - /** Static value IPV4 for IpAllocationType. */ + /** + * Static value IPV4 for IpAllocationType. + */ public static final IpAllocationType IPV4 = fromString("IPV4"); - /** Static value IPV6 for IpAllocationType. */ + /** + * Static value IPV6 for IpAllocationType. + */ public static final IpAllocationType IPV6 = fromString("IPV6"); - /** Static value DualStack for IpAllocationType. */ + /** + * Static value DualStack for IpAllocationType. + */ public static final IpAllocationType DUAL_STACK = fromString("DualStack"); /** * Creates a new instance of IpAllocationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public IpAllocationType() { /** * Creates or finds a IpAllocationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding IpAllocationType. */ - @JsonCreator public static IpAllocationType fromString(String name) { return fromString(name, IpAllocationType.class); } /** * Gets known IpAllocationType values. - * + * * @return known IpAllocationType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java index c31532176a4aa..5e0dfdf092bfc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java @@ -6,39 +6,47 @@ 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; -/** KeySetUser represents the properties of the user in the key set. */ +/** + * KeySetUser represents the properties of the user in the key set. + */ @Fluent -public final class KeySetUser { +public final class KeySetUser implements JsonSerializable { /* * The user name that will be used for access. */ - @JsonProperty(value = "azureUserName", required = true) private String azureUsername; /* * The free-form description for this user. */ - @JsonProperty(value = "description") private String description; /* - * SshPublicKey represents the public key used to authenticate with a resource through SSH. - * * The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH * private key for logging in. */ - @JsonProperty(value = "sshPublicKey", required = true) private SshPublicKey sshPublicKey; - /** Creates an instance of KeySetUser class. */ + /* + * The user principal name (email format) used to validate this user's group membership. + */ + private String userPrincipalName; + + /** + * Creates an instance of KeySetUser class. + */ public KeySetUser() { } /** * Get the azureUsername property: The user name that will be used for access. - * + * * @return the azureUsername value. */ public String azureUsername() { @@ -47,7 +55,7 @@ public String azureUsername() { /** * Set the azureUsername property: The user name that will be used for access. - * + * * @param azureUsername the azureUsername value to set. * @return the KeySetUser object itself. */ @@ -58,7 +66,7 @@ public KeySetUser withAzureUsername(String azureUsername) { /** * Get the description property: The free-form description for this user. - * + * * @return the description value. */ public String description() { @@ -67,7 +75,7 @@ public String description() { /** * Set the description property: The free-form description for this user. - * + * * @param description the description value to set. * @return the KeySetUser object itself. */ @@ -77,12 +85,9 @@ public KeySetUser withDescription(String description) { } /** - * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Get the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @return the sshPublicKey value. */ public SshPublicKey sshPublicKey() { @@ -90,12 +95,9 @@ public SshPublicKey sshPublicKey() { } /** - * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource - * through SSH. - * - *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding - * SSH private key for logging in. - * + * Set the sshPublicKey property: The SSH public key that will be provisioned for user access. The user is expected + * to have the corresponding SSH private key for logging in. + * * @param sshPublicKey the sshPublicKey value to set. * @return the KeySetUser object itself. */ @@ -104,23 +106,91 @@ public KeySetUser withSshPublicKey(SshPublicKey sshPublicKey) { return this; } + /** + * Get the userPrincipalName property: The user principal name (email format) used to validate this user's group + * membership. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Set the userPrincipalName property: The user principal name (email format) used to validate this user's group + * membership. + * + * @param userPrincipalName the userPrincipalName value to set. + * @return the KeySetUser object itself. + */ + public KeySetUser withUserPrincipalName(String userPrincipalName) { + this.userPrincipalName = userPrincipalName; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (azureUsername() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property azureUsername in model KeySetUser")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property azureUsername in model KeySetUser")); } if (sshPublicKey() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property sshPublicKey in model KeySetUser")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sshPublicKey in model KeySetUser")); } else { sshPublicKey().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(KeySetUser.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureUserName", this.azureUsername); + jsonWriter.writeJsonField("sshPublicKey", this.sshPublicKey); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeySetUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeySetUser 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 KeySetUser. + */ + public static KeySetUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeySetUser deserializedKeySetUser = new KeySetUser(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureUserName".equals(fieldName)) { + deserializedKeySetUser.azureUsername = reader.getString(); + } else if ("sshPublicKey".equals(fieldName)) { + deserializedKeySetUser.sshPublicKey = SshPublicKey.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedKeySetUser.description = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedKeySetUser.userPrincipalName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeySetUser; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java index 912afa3ce470c..1e3aede8d3c80 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.networkcloud.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; -/** KeySetUserStatus represents the status of the key set user. */ +/** + * KeySetUserStatus represents the status of the key set user. + */ @Immutable -public final class KeySetUserStatus { +public final class KeySetUserStatus implements JsonSerializable { /* * The user name that will be used for access. */ - @JsonProperty(value = "azureUserName", access = JsonProperty.Access.WRITE_ONLY) private String azureUsername; /* * The indicator of whether the user is currently deployed for access. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private BareMetalMachineKeySetUserSetupStatus status; /* * The additional information describing the current status of this user, if any available. */ - @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) private String statusMessage; - /** Creates an instance of KeySetUserStatus class. */ + /** + * Creates an instance of KeySetUserStatus class. + */ public KeySetUserStatus() { } /** * Get the azureUsername property: The user name that will be used for access. - * + * * @return the azureUsername value. */ public String azureUsername() { @@ -43,7 +48,7 @@ public String azureUsername() { /** * Get the status property: The indicator of whether the user is currently deployed for access. - * + * * @return the status value. */ public BareMetalMachineKeySetUserSetupStatus status() { @@ -53,7 +58,7 @@ public BareMetalMachineKeySetUserSetupStatus status() { /** * Get the statusMessage property: The additional information describing the current status of this user, if any * available. - * + * * @return the statusMessage value. */ public String statusMessage() { @@ -62,9 +67,49 @@ public String statusMessage() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeySetUserStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeySetUserStatus 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 KeySetUserStatus. + */ + public static KeySetUserStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeySetUserStatus deserializedKeySetUserStatus = new KeySetUserStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureUserName".equals(fieldName)) { + deserializedKeySetUserStatus.azureUsername = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedKeySetUserStatus.status + = BareMetalMachineKeySetUserSetupStatus.fromString(reader.getString()); + } else if ("statusMessage".equals(fieldName)) { + deserializedKeySetUserStatus.statusMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeySetUserStatus; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesCluster.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesCluster.java index 88bfd6f831309..4543051015f36 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesCluster.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesCluster.java @@ -11,77 +11,70 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of KubernetesCluster. */ +/** + * An immutable client-side representation of KubernetesCluster. + */ public interface KubernetesCluster { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** - * Gets the aadConfiguration property: AadConfiguration represents the Azure Active Directory Integration - * properties. - * - *

The Azure Active Directory Integration properties. - * + * Gets the aadConfiguration property: The Azure Active Directory Integration properties. + * * @return the aadConfiguration value. */ AadConfiguration aadConfiguration(); /** - * Gets the administratorConfiguration property: AdministratorConfiguration represents the administrative - * credentials that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do not - * specify their own values. - * + * Gets the administratorConfiguration property: The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. + * * @return the administratorConfiguration value. */ AdministratorConfiguration administratorConfiguration(); @@ -89,21 +82,21 @@ public interface KubernetesCluster { /** * Gets the attachedNetworkIds property: The full list of network resource IDs that are attached to this cluster, * including those attached only to specific agent pools. - * + * * @return the attachedNetworkIds value. */ List attachedNetworkIds(); /** * Gets the availableUpgrades property: The list of versions that this Kubernetes cluster can be upgraded to. - * + * * @return the availableUpgrades value. */ List availableUpgrades(); /** * Gets the clusterId property: The resource ID of the Network Cloud cluster. - * + * * @return the clusterId value. */ String clusterId(); @@ -111,45 +104,43 @@ public interface KubernetesCluster { /** * Gets the connectedClusterId property: The resource ID of the connected cluster set up when this Kubernetes * cluster is created. - * + * * @return the connectedClusterId value. */ String connectedClusterId(); /** * Gets the controlPlaneKubernetesVersion property: The current running version of Kubernetes on the control plane. - * + * * @return the controlPlaneKubernetesVersion value. */ String controlPlaneKubernetesVersion(); /** - * Gets the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the selection of - * virtual machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster. - * + * Gets the controlPlaneNodeConfiguration property: The defining characteristics of the control plane for this + * Kubernetes Cluster. + * * @return the controlPlaneNodeConfiguration value. */ ControlPlaneNodeConfiguration controlPlaneNodeConfiguration(); /** * Gets the detailedStatus property: The current status of the Kubernetes cluster. - * + * * @return the detailedStatus value. */ KubernetesClusterDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the featureStatuses property: The current feature settings. - * + * * @return the featureStatuses value. */ List featureStatuses(); @@ -159,100 +150,102 @@ public interface KubernetesCluster { * for running critical system services and workloads. This data in this field is only used during creation, and the * field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent * pools is done using the agentPools sub-resource. - * + * * @return the initialAgentPoolConfigurations value. */ List initialAgentPoolConfigurations(); /** - * Gets the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Gets the kubernetesVersion property: The Kubernetes version for this cluster. + * * @return the kubernetesVersion value. */ String kubernetesVersion(); /** - * Gets the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the - * configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource. - * + * Gets the managedResourceGroupConfiguration property: The configuration of the managed resource group associated + * with the resource. + * * @return the managedResourceGroupConfiguration value. */ ManagedResourceGroupConfiguration managedResourceGroupConfiguration(); /** - * Gets the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span the - * cluster. - * + * Gets the networkConfiguration property: The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. + * * @return the networkConfiguration value. */ NetworkConfiguration networkConfiguration(); /** * Gets the nodes property: The details of the nodes in this cluster. - * + * * @return the nodes value. */ List nodes(); /** * Gets the provisioningState property: The provisioning state of the Kubernetes cluster resource. - * + * * @return the provisioningState value. */ KubernetesClusterProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterInner object. - * + * * @return the inner object. */ KubernetesClusterInner innerModel(); - /** The entirety of the KubernetesCluster definition. */ + /** + * The entirety of the KubernetesCluster definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithControlPlaneNodeConfiguration, DefinitionStages.WithInitialAgentPoolConfigurations, DefinitionStages.WithKubernetesVersion, DefinitionStages.WithNetworkConfiguration, DefinitionStages.WithCreate { } - /** The KubernetesCluster definition stages. */ + /** + * The KubernetesCluster definition stages. + */ interface DefinitionStages { - /** The first stage of the KubernetesCluster definition. */ + /** + * The first stage of the KubernetesCluster definition. + */ interface Blank extends WithLocation { } - /** The stage of the KubernetesCluster definition allowing to specify location. */ + /** + * The stage of the KubernetesCluster definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -260,102 +253,99 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the KubernetesCluster definition allowing to specify parent resource. */ + /** + * The stage of the KubernetesCluster definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the KubernetesCluster definition allowing to specify extendedLocation. */ + /** + * The stage of the KubernetesCluster definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithControlPlaneNodeConfiguration withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the KubernetesCluster definition allowing to specify controlPlaneNodeConfiguration. */ + /** + * The stage of the KubernetesCluster definition allowing to specify controlPlaneNodeConfiguration. + */ interface WithControlPlaneNodeConfiguration { /** - * Specifies the controlPlaneNodeConfiguration property: ControlPlaneNodeConfiguration represents the - * selection of virtual machines and size of the control plane for a Kubernetes cluster. - * - *

The defining characteristics of the control plane for this Kubernetes Cluster.. - * - * @param controlPlaneNodeConfiguration ControlPlaneNodeConfiguration represents the selection of virtual - * machines and size of the control plane for a Kubernetes cluster. - *

The defining characteristics of the control plane for this Kubernetes Cluster. + * Specifies the controlPlaneNodeConfiguration property: The defining characteristics of the control plane + * for this Kubernetes Cluster.. + * + * @param controlPlaneNodeConfiguration The defining characteristics of the control plane for this + * Kubernetes Cluster. * @return the next definition stage. */ WithInitialAgentPoolConfigurations withControlPlaneNodeConfiguration(ControlPlaneNodeConfiguration controlPlaneNodeConfiguration); } - /** The stage of the KubernetesCluster definition allowing to specify initialAgentPoolConfigurations. */ + /** + * The stage of the KubernetesCluster definition allowing to specify initialAgentPoolConfigurations. + */ interface WithInitialAgentPoolConfigurations { /** * Specifies the initialAgentPoolConfigurations property: The agent pools that are created with this * Kubernetes cluster for running critical system services and workloads. This data in this field is only * used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After * creation, the management of agent pools is done using the agentPools sub-resource.. - * + * * @param initialAgentPoolConfigurations The agent pools that are created with this Kubernetes cluster for - * running critical system services and workloads. This data in this field is only used during creation, - * and the field will be empty following the creation of the Kubernetes Cluster. After creation, the - * management of agent pools is done using the agentPools sub-resource. + * running critical system services and workloads. This data in this field is only used during creation, and + * the field will be empty following the creation of the Kubernetes Cluster. After creation, the management + * of agent pools is done using the agentPools sub-resource. * @return the next definition stage. */ WithKubernetesVersion withInitialAgentPoolConfigurations(List initialAgentPoolConfigurations); } - /** The stage of the KubernetesCluster definition allowing to specify kubernetesVersion. */ + /** + * The stage of the KubernetesCluster definition allowing to specify kubernetesVersion. + */ interface WithKubernetesVersion { /** - * Specifies the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, - * and n.n.n-n format. The interpreted version used will be resolved into this field after creation or - * update.. - * - * @param kubernetesVersion The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. - * The interpreted version used will be resolved into this field after creation or update. + * Specifies the kubernetesVersion property: The Kubernetes version for this cluster.. + * + * @param kubernetesVersion The Kubernetes version for this cluster. * @return the next definition stage. */ WithNetworkConfiguration withKubernetesVersion(String kubernetesVersion); } - /** The stage of the KubernetesCluster definition allowing to specify networkConfiguration. */ + /** + * The stage of the KubernetesCluster definition allowing to specify networkConfiguration. + */ interface WithNetworkConfiguration { /** - * Specifies the networkConfiguration property: NetworkConfiguration specifies the Kubernetes cluster - * network related configuration. - * - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that span - * the cluster.. - * - * @param networkConfiguration NetworkConfiguration specifies the Kubernetes cluster network related - * configuration. - *

The configuration of the Kubernetes cluster networking, including the attachment of networks that - * span the cluster. + * Specifies the networkConfiguration property: The configuration of the Kubernetes cluster networking, + * including the attachment of networks that span the cluster.. + * + * @param networkConfiguration The configuration of the Kubernetes cluster networking, including the + * attachment of networks that span the cluster. * @return the next definition stage. */ WithCreate withNetworkConfiguration(NetworkConfiguration networkConfiguration); @@ -369,76 +359,71 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAad DefinitionStages.WithAdministratorConfiguration, DefinitionStages.WithManagedResourceGroupConfiguration { /** * Executes the create request. - * + * * @return the created resource. */ KubernetesCluster create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ KubernetesCluster create(Context context); } - /** The stage of the KubernetesCluster definition allowing to specify tags. */ + /** + * The stage of the KubernetesCluster definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the KubernetesCluster definition allowing to specify aadConfiguration. */ + /** + * The stage of the KubernetesCluster definition allowing to specify aadConfiguration. + */ interface WithAadConfiguration { /** - * Specifies the aadConfiguration property: AadConfiguration represents the Azure Active Directory - * Integration properties. - * - *

The Azure Active Directory Integration properties.. - * - * @param aadConfiguration AadConfiguration represents the Azure Active Directory Integration properties. - *

The Azure Active Directory Integration properties. + * Specifies the aadConfiguration property: The Azure Active Directory Integration properties.. + * + * @param aadConfiguration The Azure Active Directory Integration properties. * @return the next definition stage. */ WithCreate withAadConfiguration(AadConfiguration aadConfiguration); } - /** The stage of the KubernetesCluster definition allowing to specify administratorConfiguration. */ + /** + * The stage of the KubernetesCluster definition allowing to specify administratorConfiguration. + */ interface WithAdministratorConfiguration { /** - * Specifies the administratorConfiguration property: AdministratorConfiguration represents the - * administrative credentials that will be applied to the control plane and agent pool nodes in Kubernetes - * clusters. - * - *

The administrative credentials that will be applied to the control plane and agent pool nodes that do - * not specify their own values.. - * - * @param administratorConfiguration AdministratorConfiguration represents the administrative credentials - * that will be applied to the control plane and agent pool nodes in Kubernetes clusters. - *

The administrative credentials that will be applied to the control plane and agent pool nodes that - * do not specify their own values. + * Specifies the administratorConfiguration property: The administrative credentials that will be applied to + * the control plane and agent pool nodes that do not specify their own values.. + * + * @param administratorConfiguration The administrative credentials that will be applied to the control + * plane and agent pool nodes that do not specify their own values. * @return the next definition stage. */ WithCreate withAdministratorConfiguration(AdministratorConfiguration administratorConfiguration); } - /** The stage of the KubernetesCluster definition allowing to specify managedResourceGroupConfiguration. */ + /** + * The stage of the KubernetesCluster definition allowing to specify managedResourceGroupConfiguration. + */ interface WithManagedResourceGroupConfiguration { /** - * Specifies the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents - * the configuration of the resource group managed by Azure. - * - *

The configuration of the managed resource group associated with the resource.. - * - * @param managedResourceGroupConfiguration ManagedResourceGroupConfiguration represents the configuration - * of the resource group managed by Azure. - *

The configuration of the managed resource group associated with the resource. + * Specifies the managedResourceGroupConfiguration property: The configuration of the managed resource group + * associated with the resource.. + * + * @param managedResourceGroupConfiguration The configuration of the managed resource group associated with + * the resource. * @return the next definition stage. */ WithCreate withManagedResourceGroupConfiguration( @@ -448,68 +433,86 @@ WithCreate withManagedResourceGroupConfiguration( /** * Begins update for the KubernetesCluster resource. - * + * * @return the stage of resource update. */ KubernetesCluster.Update update(); - /** The template for KubernetesCluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithControlPlaneNodeConfiguration, - UpdateStages.WithKubernetesVersion { + /** + * The template for KubernetesCluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithAdministratorConfiguration, + UpdateStages.WithControlPlaneNodeConfiguration, UpdateStages.WithKubernetesVersion { /** * Executes the update request. - * + * * @return the updated resource. */ KubernetesCluster apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ KubernetesCluster apply(Context context); } - /** The KubernetesCluster update stages. */ + /** + * The KubernetesCluster update stages. + */ interface UpdateStages { - /** The stage of the KubernetesCluster update allowing to specify tags. */ + /** + * The stage of the KubernetesCluster update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the KubernetesCluster update allowing to specify controlPlaneNodeConfiguration. */ + /** + * The stage of the KubernetesCluster update allowing to specify administratorConfiguration. + */ + interface WithAdministratorConfiguration { + /** + * Specifies the administratorConfiguration property: The configuration of the default administrator + * credentials.. + * + * @param administratorConfiguration The configuration of the default administrator credentials. + * @return the next definition stage. + */ + Update withAdministratorConfiguration(AdministratorConfigurationPatch administratorConfiguration); + } + + /** + * The stage of the KubernetesCluster update allowing to specify controlPlaneNodeConfiguration. + */ interface WithControlPlaneNodeConfiguration { /** - * Specifies the controlPlaneNodeConfiguration property: ControlPlaneNodePatchConfiguration represents the - * properties of the control plane that can be patched for this Kubernetes cluster. - * - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster.. - * - * @param controlPlaneNodeConfiguration ControlPlaneNodePatchConfiguration represents the properties of the - * control plane that can be patched for this Kubernetes cluster. - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster. + * Specifies the controlPlaneNodeConfiguration property: The defining characteristics of the control plane + * that can be patched for this Kubernetes cluster.. + * + * @param controlPlaneNodeConfiguration The defining characteristics of the control plane that can be + * patched for this Kubernetes cluster. * @return the next definition stage. */ Update withControlPlaneNodeConfiguration(ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration); } - /** The stage of the KubernetesCluster update allowing to specify kubernetesVersion. */ + /** + * The stage of the KubernetesCluster update allowing to specify kubernetesVersion. + */ interface WithKubernetesVersion { /** - * Specifies the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, - * and n.n.n-n format. The interpreted version used will be resolved into this field after creation or - * update.. - * - * @param kubernetesVersion The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. - * The interpreted version used will be resolved into this field after creation or update. + * Specifies the kubernetesVersion property: The Kubernetes version for this cluster.. + * + * @param kubernetesVersion The Kubernetes version for this cluster. * @return the next definition stage. */ Update withKubernetesVersion(String kubernetesVersion); @@ -518,14 +521,14 @@ interface WithKubernetesVersion { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ KubernetesCluster refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -533,9 +536,9 @@ interface WithKubernetesVersion { /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param kubernetesClusterRestartNodeParameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -546,9 +549,9 @@ interface WithKubernetesVersion { /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param kubernetesClusterRestartNodeParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterDetailedStatus.java index 819f152d07f58..3314cb63dde9a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current status of the Kubernetes cluster. */ +/** + * The current status of the Kubernetes cluster. + */ public final class KubernetesClusterDetailedStatus extends ExpandableStringEnum { - /** Static value Available for KubernetesClusterDetailedStatus. */ + /** + * Static value Available for KubernetesClusterDetailedStatus. + */ public static final KubernetesClusterDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Error for KubernetesClusterDetailedStatus. */ + /** + * Static value Error for KubernetesClusterDetailedStatus. + */ public static final KubernetesClusterDetailedStatus ERROR = fromString("Error"); - /** Static value Provisioning for KubernetesClusterDetailedStatus. */ + /** + * Static value Provisioning for KubernetesClusterDetailedStatus. + */ public static final KubernetesClusterDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of KubernetesClusterDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public KubernetesClusterDetailedStatus() { /** * Creates or finds a KubernetesClusterDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesClusterDetailedStatus. */ - @JsonCreator public static KubernetesClusterDetailedStatus fromString(String name) { return fromString(name, KubernetesClusterDetailedStatus.class); } /** * Gets known KubernetesClusterDetailedStatus values. - * + * * @return known KubernetesClusterDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeature.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeature.java new file mode 100644 index 0000000000000..48d00994385f4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeature.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of KubernetesClusterFeature. + */ +public interface KubernetesClusterFeature { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the availabilityLifecycle property: The lifecycle indicator of the feature. + * + * @return the availabilityLifecycle value. + */ + KubernetesClusterFeatureAvailabilityLifecycle availabilityLifecycle(); + + /** + * Gets the detailedStatus property: The detailed status of the feature. + * + * @return the detailedStatus value. + */ + KubernetesClusterFeatureDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message for the detailed status of the feature. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the options property: The configured options for the feature. + * + * @return the options value. + */ + List options(); + + /** + * Gets the provisioningState property: The provisioning state of the Kubernetes cluster feature. + * + * @return the provisioningState value. + */ + KubernetesClusterFeatureProvisioningState provisioningState(); + + /** + * Gets the required property: The indicator of if the feature is required or optional. Optional features may be + * deleted by the user, while required features are managed with the kubernetes cluster lifecycle. + * + * @return the required value. + */ + KubernetesClusterFeatureRequired required(); + + /** + * Gets the version property: The version of the feature. + * + * @return the version value. + */ + String version(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterFeatureInner object. + * + * @return the inner object. + */ + KubernetesClusterFeatureInner innerModel(); + + /** + * The entirety of the KubernetesClusterFeature definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The KubernetesClusterFeature definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the KubernetesClusterFeature definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the KubernetesClusterFeature definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the KubernetesClusterFeature definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, kubernetesClusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @return the next definition stage. + */ + WithCreate withExistingKubernetesCluster(String resourceGroupName, String kubernetesClusterName); + } + + /** + * The stage of the KubernetesClusterFeature definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + KubernetesClusterFeature create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KubernetesClusterFeature create(Context context); + } + + /** + * The stage of the KubernetesClusterFeature definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the KubernetesClusterFeature definition allowing to specify options. + */ + interface WithOptions { + /** + * Specifies the options property: The configured options for the feature.. + * + * @param options The configured options for the feature. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + + /** + * Begins update for the KubernetesClusterFeature resource. + * + * @return the stage of resource update. + */ + KubernetesClusterFeature.Update update(); + + /** + * The template for KubernetesClusterFeature update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithOptions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KubernetesClusterFeature apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KubernetesClusterFeature apply(Context context); + } + + /** + * The KubernetesClusterFeature update stages. + */ + interface UpdateStages { + /** + * The stage of the KubernetesClusterFeature update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the KubernetesClusterFeature update allowing to specify options. + */ + interface WithOptions { + /** + * Specifies the options property: The configured options for the feature.. + * + * @param options The configured options for the feature. + * @return the next definition stage. + */ + Update withOptions(List options); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KubernetesClusterFeature refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KubernetesClusterFeature refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureAvailabilityLifecycle.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureAvailabilityLifecycle.java new file mode 100644 index 0000000000000..3af42a5ff0d15 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureAvailabilityLifecycle.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The lifecycle indicator of the feature. + */ +public final class KubernetesClusterFeatureAvailabilityLifecycle + extends ExpandableStringEnum { + /** + * Static value Preview for KubernetesClusterFeatureAvailabilityLifecycle. + */ + public static final KubernetesClusterFeatureAvailabilityLifecycle PREVIEW = fromString("Preview"); + + /** + * Static value GenerallyAvailable for KubernetesClusterFeatureAvailabilityLifecycle. + */ + public static final KubernetesClusterFeatureAvailabilityLifecycle GENERALLY_AVAILABLE + = fromString("GenerallyAvailable"); + + /** + * Creates a new instance of KubernetesClusterFeatureAvailabilityLifecycle value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubernetesClusterFeatureAvailabilityLifecycle() { + } + + /** + * Creates or finds a KubernetesClusterFeatureAvailabilityLifecycle from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubernetesClusterFeatureAvailabilityLifecycle. + */ + public static KubernetesClusterFeatureAvailabilityLifecycle fromString(String name) { + return fromString(name, KubernetesClusterFeatureAvailabilityLifecycle.class); + } + + /** + * Gets known KubernetesClusterFeatureAvailabilityLifecycle values. + * + * @return known KubernetesClusterFeatureAvailabilityLifecycle values. + */ + public static Collection values() { + return values(KubernetesClusterFeatureAvailabilityLifecycle.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureDetailedStatus.java new file mode 100644 index 0000000000000..5a3127576a6bb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureDetailedStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The detailed status of the feature. + */ +public final class KubernetesClusterFeatureDetailedStatus + extends ExpandableStringEnum { + /** + * Static value Error for KubernetesClusterFeatureDetailedStatus. + */ + public static final KubernetesClusterFeatureDetailedStatus ERROR = fromString("Error"); + + /** + * Static value Provisioning for KubernetesClusterFeatureDetailedStatus. + */ + public static final KubernetesClusterFeatureDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Static value Installed for KubernetesClusterFeatureDetailedStatus. + */ + public static final KubernetesClusterFeatureDetailedStatus INSTALLED = fromString("Installed"); + + /** + * Creates a new instance of KubernetesClusterFeatureDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubernetesClusterFeatureDetailedStatus() { + } + + /** + * Creates or finds a KubernetesClusterFeatureDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubernetesClusterFeatureDetailedStatus. + */ + public static KubernetesClusterFeatureDetailedStatus fromString(String name) { + return fromString(name, KubernetesClusterFeatureDetailedStatus.class); + } + + /** + * Gets known KubernetesClusterFeatureDetailedStatus values. + * + * @return known KubernetesClusterFeatureDetailedStatus values. + */ + public static Collection values() { + return values(KubernetesClusterFeatureDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureList.java new file mode 100644 index 0000000000000..51e02a5a3aa58 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureList.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.KubernetesClusterFeatureInner; +import java.io.IOException; +import java.util.List; + +/** + * KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. + */ +@Fluent +public final class KubernetesClusterFeatureList implements JsonSerializable { + /* + * The link used to get the next page of operations. + */ + private String nextLink; + + /* + * The list of Kubernetes cluster features. + */ + private List value; + + /** + * Creates an instance of KubernetesClusterFeatureList class. + */ + public KubernetesClusterFeatureList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the KubernetesClusterFeatureList object itself. + */ + public KubernetesClusterFeatureList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of Kubernetes cluster features. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kubernetes cluster features. + * + * @param value the value value to set. + * @return the KubernetesClusterFeatureList object itself. + */ + public KubernetesClusterFeatureList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterFeatureList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterFeatureList 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 KubernetesClusterFeatureList. + */ + public static KubernetesClusterFeatureList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterFeatureList deserializedKubernetesClusterFeatureList = new KubernetesClusterFeatureList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedKubernetesClusterFeatureList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> KubernetesClusterFeatureInner.fromJson(reader1)); + deserializedKubernetesClusterFeatureList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterFeatureList; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeaturePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeaturePatchParameters.java new file mode 100644 index 0000000000000..a65a7312ce4a4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeaturePatchParameters.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.KubernetesClusterFeaturePatchProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + */ +@Fluent +public final class KubernetesClusterFeaturePatchParameters + implements JsonSerializable { + /* + * The list of the resource properties. + */ + private KubernetesClusterFeaturePatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + private Map tags; + + /** + * Creates an instance of KubernetesClusterFeaturePatchParameters class. + */ + public KubernetesClusterFeaturePatchParameters() { + } + + /** + * Get the innerProperties property: The list of the resource properties. + * + * @return the innerProperties value. + */ + private KubernetesClusterFeaturePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the KubernetesClusterFeaturePatchParameters object itself. + */ + public KubernetesClusterFeaturePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the options property: The configured options for the feature. + * + * @return the options value. + */ + public List options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: The configured options for the feature. + * + * @param options the options value to set. + * @return the KubernetesClusterFeaturePatchParameters object itself. + */ + public KubernetesClusterFeaturePatchParameters withOptions(List options) { + if (this.innerProperties() == null) { + this.innerProperties = new KubernetesClusterFeaturePatchProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterFeaturePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterFeaturePatchParameters 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 KubernetesClusterFeaturePatchParameters. + */ + public static KubernetesClusterFeaturePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterFeaturePatchParameters deserializedKubernetesClusterFeaturePatchParameters + = new KubernetesClusterFeaturePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedKubernetesClusterFeaturePatchParameters.innerProperties + = KubernetesClusterFeaturePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesClusterFeaturePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterFeaturePatchParameters; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureProvisioningState.java new file mode 100644 index 0000000000000..58b14e5f91e7a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureProvisioningState.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the Kubernetes cluster feature. + */ +public final class KubernetesClusterFeatureProvisioningState + extends ExpandableStringEnum { + /** + * Static value Accepted for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Canceled for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Succeeded for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Updating for KubernetesClusterFeatureProvisioningState. + */ + public static final KubernetesClusterFeatureProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of KubernetesClusterFeatureProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubernetesClusterFeatureProvisioningState() { + } + + /** + * Creates or finds a KubernetesClusterFeatureProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubernetesClusterFeatureProvisioningState. + */ + public static KubernetesClusterFeatureProvisioningState fromString(String name) { + return fromString(name, KubernetesClusterFeatureProvisioningState.class); + } + + /** + * Gets known KubernetesClusterFeatureProvisioningState values. + * + * @return known KubernetesClusterFeatureProvisioningState values. + */ + public static Collection values() { + return values(KubernetesClusterFeatureProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureRequired.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureRequired.java new file mode 100644 index 0000000000000..52af99c5d56d6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatureRequired.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + * features are managed with the kubernetes cluster lifecycle. + */ +public final class KubernetesClusterFeatureRequired extends ExpandableStringEnum { + /** + * Static value True for KubernetesClusterFeatureRequired. + */ + public static final KubernetesClusterFeatureRequired TRUE = fromString("True"); + + /** + * Static value False for KubernetesClusterFeatureRequired. + */ + public static final KubernetesClusterFeatureRequired FALSE = fromString("False"); + + /** + * Creates a new instance of KubernetesClusterFeatureRequired value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KubernetesClusterFeatureRequired() { + } + + /** + * Creates or finds a KubernetesClusterFeatureRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubernetesClusterFeatureRequired. + */ + public static KubernetesClusterFeatureRequired fromString(String name) { + return fromString(name, KubernetesClusterFeatureRequired.class); + } + + /** + * Gets known KubernetesClusterFeatureRequired values. + * + * @return known KubernetesClusterFeatureRequired values. + */ + public static Collection values() { + return values(KubernetesClusterFeatureRequired.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatures.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatures.java new file mode 100644 index 0000000000000..f0c210a2a7b42 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterFeatures.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of KubernetesClusterFeatures. + */ +public interface KubernetesClusterFeatures { + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName); + + /** + * List features for the Kubernetes cluster. + * + * Get a list of features for the provided Kubernetes cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes 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 a list of features for the provided Kubernetes cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByKubernetesCluster(String resourceGroupName, + String kubernetesClusterName, Context context); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 properties of the provided the Kubernetes cluster feature along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String kubernetesClusterName, + String featureName, Context context); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 properties of the provided the Kubernetes cluster feature. + */ + KubernetesClusterFeature get(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String featureName); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kubernetesClusterName The name of the Kubernetes cluster. + * @param featureName The name of the feature. + * @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 current status of an async operation. + */ + OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, String featureName, + Context context); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature along with {@link Response}. + */ + KubernetesClusterFeature getById(String id); + + /** + * Retrieve the Kubernetes cluster feature. + * + * Get properties of the provided the Kubernetes cluster feature. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the provided the Kubernetes cluster feature along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult deleteById(String id); + + /** + * Delete the Kubernetes cluster feature. + * + * Delete the provided Kubernetes cluster feature. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new KubernetesClusterFeature resource. + * + * @param name resource name. + * @return the first stage of the new KubernetesClusterFeature definition. + */ + KubernetesClusterFeature.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterList.java index fa736f7428ded..3430adb0fbe2b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.KubernetesClusterInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** KubernetesClusterList represents a list of Kubernetes clusters. */ +/** + * KubernetesClusterList represents a list of Kubernetes clusters. + */ @Fluent -public final class KubernetesClusterList { +public final class KubernetesClusterList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of additional details related to Kubernetes clusters. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of KubernetesClusterList class. */ + /** + * Creates an instance of KubernetesClusterList class. + */ public KubernetesClusterList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the KubernetesClusterList object itself. */ @@ -50,7 +56,7 @@ public KubernetesClusterList withNextLink(String nextLink) { /** * Get the value property: The list of additional details related to Kubernetes clusters. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of additional details related to Kubernetes clusters. - * + * * @param value the value value to set. * @return the KubernetesClusterList object itself. */ @@ -70,7 +76,7 @@ public KubernetesClusterList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterList 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 KubernetesClusterList. + */ + public static KubernetesClusterList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterList deserializedKubernetesClusterList = new KubernetesClusterList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedKubernetesClusterList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> KubernetesClusterInner.fromJson(reader1)); + deserializedKubernetesClusterList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNode.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNode.java index 9a57f626d65c6..e3c5ab4ae9e85 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNode.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNode.java @@ -5,129 +5,120 @@ package com.azure.resourcemanager.networkcloud.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; import java.util.List; -/** KubernetesClusterNode represents the details of a node in a Kubernetes cluster. */ +/** + * KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + */ @Immutable -public final class KubernetesClusterNode { +public final class KubernetesClusterNode implements JsonSerializable { /* * The resource ID of the agent pool that this node belongs to. This value is not represented on control plane * nodes. */ - @JsonProperty(value = "agentPoolId", access = JsonProperty.Access.WRITE_ONLY) private String agentPoolId; /* * The availability zone this node is running within. */ - @JsonProperty(value = "availabilityZone", access = JsonProperty.Access.WRITE_ONLY) private String availabilityZone; /* * The resource ID of the bare metal machine that hosts this node. */ - @JsonProperty(value = "bareMetalMachineId", access = JsonProperty.Access.WRITE_ONLY) private String bareMetalMachineId; /* * The number of CPU cores configured for this node, derived from the VM SKU specified. */ - @JsonProperty(value = "cpuCores", access = JsonProperty.Access.WRITE_ONLY) private Long cpuCores; /* * The detailed state of this node. */ - @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) private KubernetesClusterNodeDetailedStatus detailedStatus; /* * The descriptive message about the current detailed status. */ - @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String detailedStatusMessage; /* - * The size of the disk configured for this node. + * The size of the disk configured for this node. Allocations are measured in gibibytes. */ - @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) private Long diskSizeGB; /* * The machine image used to deploy this node. */ - @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) private String image; /* * The currently running version of Kubernetes and bundled features running on this node. */ - @JsonProperty(value = "kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) private String kubernetesVersion; /* * The list of labels on this node that have been assigned to the agent pool containing this node. */ - @JsonProperty(value = "labels", access = JsonProperty.Access.WRITE_ONLY) private List labels; /* - * The amount of memory configured for this node, derived from the vm SKU specified. + * The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in + * gibibytes. */ - @JsonProperty(value = "memorySizeGB", access = JsonProperty.Access.WRITE_ONLY) private Long memorySizeGB; /* * The mode of the agent pool containing this node. Not applicable for control plane nodes. */ - @JsonProperty(value = "mode", access = JsonProperty.Access.WRITE_ONLY) private AgentPoolMode mode; /* * The name of this node, as realized in the Kubernetes cluster. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The NetworkAttachments made to this node. */ - @JsonProperty(value = "networkAttachments", access = JsonProperty.Access.WRITE_ONLY) private List networkAttachments; /* * The power state of this node. */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) private KubernetesNodePowerState powerState; /* * The role of this node in the cluster. */ - @JsonProperty(value = "role", access = JsonProperty.Access.WRITE_ONLY) private KubernetesNodeRole role; /* * The list of taints that have been assigned to the agent pool containing this node. */ - @JsonProperty(value = "taints", access = JsonProperty.Access.WRITE_ONLY) private List taints; /* * The VM SKU name that was used to create this cluster node. */ - @JsonProperty(value = "vmSkuName", access = JsonProperty.Access.WRITE_ONLY) private String vmSkuName; - /** Creates an instance of KubernetesClusterNode class. */ + /** + * Creates an instance of KubernetesClusterNode class. + */ public KubernetesClusterNode() { } /** * Get the agentPoolId property: The resource ID of the agent pool that this node belongs to. This value is not * represented on control plane nodes. - * + * * @return the agentPoolId value. */ public String agentPoolId() { @@ -136,7 +127,7 @@ public String agentPoolId() { /** * Get the availabilityZone property: The availability zone this node is running within. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -145,7 +136,7 @@ public String availabilityZone() { /** * Get the bareMetalMachineId property: The resource ID of the bare metal machine that hosts this node. - * + * * @return the bareMetalMachineId value. */ public String bareMetalMachineId() { @@ -154,7 +145,7 @@ public String bareMetalMachineId() { /** * Get the cpuCores property: The number of CPU cores configured for this node, derived from the VM SKU specified. - * + * * @return the cpuCores value. */ public Long cpuCores() { @@ -163,7 +154,7 @@ public Long cpuCores() { /** * Get the detailedStatus property: The detailed state of this node. - * + * * @return the detailedStatus value. */ public KubernetesClusterNodeDetailedStatus detailedStatus() { @@ -172,7 +163,7 @@ public KubernetesClusterNodeDetailedStatus detailedStatus() { /** * Get the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ public String detailedStatusMessage() { @@ -180,8 +171,9 @@ public String detailedStatusMessage() { } /** - * Get the diskSizeGB property: The size of the disk configured for this node. - * + * Get the diskSizeGB property: The size of the disk configured for this node. Allocations are measured in + * gibibytes. + * * @return the diskSizeGB value. */ public Long diskSizeGB() { @@ -190,7 +182,7 @@ public Long diskSizeGB() { /** * Get the image property: The machine image used to deploy this node. - * + * * @return the image value. */ public String image() { @@ -200,7 +192,7 @@ public String image() { /** * Get the kubernetesVersion property: The currently running version of Kubernetes and bundled features running on * this node. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -210,7 +202,7 @@ public String kubernetesVersion() { /** * Get the labels property: The list of labels on this node that have been assigned to the agent pool containing * this node. - * + * * @return the labels value. */ public List labels() { @@ -219,7 +211,8 @@ public List labels() { /** * Get the memorySizeGB property: The amount of memory configured for this node, derived from the vm SKU specified. - * + * Allocations are measured in gibibytes. + * * @return the memorySizeGB value. */ public Long memorySizeGB() { @@ -228,7 +221,7 @@ public Long memorySizeGB() { /** * Get the mode property: The mode of the agent pool containing this node. Not applicable for control plane nodes. - * + * * @return the mode value. */ public AgentPoolMode mode() { @@ -237,7 +230,7 @@ public AgentPoolMode mode() { /** * Get the name property: The name of this node, as realized in the Kubernetes cluster. - * + * * @return the name value. */ public String name() { @@ -246,7 +239,7 @@ public String name() { /** * Get the networkAttachments property: The NetworkAttachments made to this node. - * + * * @return the networkAttachments value. */ public List networkAttachments() { @@ -255,7 +248,7 @@ public List networkAttachments() { /** * Get the powerState property: The power state of this node. - * + * * @return the powerState value. */ public KubernetesNodePowerState powerState() { @@ -264,7 +257,7 @@ public KubernetesNodePowerState powerState() { /** * Get the role property: The role of this node in the cluster. - * + * * @return the role value. */ public KubernetesNodeRole role() { @@ -273,7 +266,7 @@ public KubernetesNodeRole role() { /** * Get the taints property: The list of taints that have been assigned to the agent pool containing this node. - * + * * @return the taints value. */ public List taints() { @@ -282,7 +275,7 @@ public List taints() { /** * Get the vmSkuName property: The VM SKU name that was used to create this cluster node. - * + * * @return the vmSkuName value. */ public String vmSkuName() { @@ -291,7 +284,7 @@ public String vmSkuName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -305,4 +298,79 @@ public void validate() { taints().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterNode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterNode 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 KubernetesClusterNode. + */ + public static KubernetesClusterNode fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterNode deserializedKubernetesClusterNode = new KubernetesClusterNode(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("agentPoolId".equals(fieldName)) { + deserializedKubernetesClusterNode.agentPoolId = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedKubernetesClusterNode.availabilityZone = reader.getString(); + } else if ("bareMetalMachineId".equals(fieldName)) { + deserializedKubernetesClusterNode.bareMetalMachineId = reader.getString(); + } else if ("cpuCores".equals(fieldName)) { + deserializedKubernetesClusterNode.cpuCores = reader.getNullable(JsonReader::getLong); + } else if ("detailedStatus".equals(fieldName)) { + deserializedKubernetesClusterNode.detailedStatus + = KubernetesClusterNodeDetailedStatus.fromString(reader.getString()); + } else if ("detailedStatusMessage".equals(fieldName)) { + deserializedKubernetesClusterNode.detailedStatusMessage = reader.getString(); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedKubernetesClusterNode.diskSizeGB = reader.getNullable(JsonReader::getLong); + } else if ("image".equals(fieldName)) { + deserializedKubernetesClusterNode.image = reader.getString(); + } else if ("kubernetesVersion".equals(fieldName)) { + deserializedKubernetesClusterNode.kubernetesVersion = reader.getString(); + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedKubernetesClusterNode.labels = labels; + } else if ("memorySizeGB".equals(fieldName)) { + deserializedKubernetesClusterNode.memorySizeGB = reader.getNullable(JsonReader::getLong); + } else if ("mode".equals(fieldName)) { + deserializedKubernetesClusterNode.mode = AgentPoolMode.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedKubernetesClusterNode.name = reader.getString(); + } else if ("networkAttachments".equals(fieldName)) { + List networkAttachments + = reader.readArray(reader1 -> NetworkAttachment.fromJson(reader1)); + deserializedKubernetesClusterNode.networkAttachments = networkAttachments; + } else if ("powerState".equals(fieldName)) { + deserializedKubernetesClusterNode.powerState + = KubernetesNodePowerState.fromString(reader.getString()); + } else if ("role".equals(fieldName)) { + deserializedKubernetesClusterNode.role = KubernetesNodeRole.fromString(reader.getString()); + } else if ("taints".equals(fieldName)) { + List taints = reader.readArray(reader1 -> KubernetesLabel.fromJson(reader1)); + deserializedKubernetesClusterNode.taints = taints; + } else if ("vmSkuName".equals(fieldName)) { + deserializedKubernetesClusterNode.vmSkuName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterNode; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNodeDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNodeDetailedStatus.java index 8b14df0c4dc38..bfbd979ae038a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNodeDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterNodeDetailedStatus.java @@ -5,39 +5,56 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The detailed state of this node. */ +/** + * The detailed state of this node. + */ public final class KubernetesClusterNodeDetailedStatus extends ExpandableStringEnum { - /** Static value Available for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Available for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Error for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Error for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus ERROR = fromString("Error"); - /** Static value Provisioning for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Provisioning for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus PROVISIONING = fromString("Provisioning"); - /** Static value Running for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Running for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus RUNNING = fromString("Running"); - /** Static value Scheduling for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Scheduling for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus SCHEDULING = fromString("Scheduling"); - /** Static value Stopped for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Stopped for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus STOPPED = fromString("Stopped"); - /** Static value Terminating for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Terminating for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus TERMINATING = fromString("Terminating"); - /** Static value Unknown for KubernetesClusterNodeDetailedStatus. */ + /** + * Static value Unknown for KubernetesClusterNodeDetailedStatus. + */ public static final KubernetesClusterNodeDetailedStatus UNKNOWN = fromString("Unknown"); /** * Creates a new instance of KubernetesClusterNodeDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -46,18 +63,17 @@ public KubernetesClusterNodeDetailedStatus() { /** * Creates or finds a KubernetesClusterNodeDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesClusterNodeDetailedStatus. */ - @JsonCreator public static KubernetesClusterNodeDetailedStatus fromString(String name) { return fromString(name, KubernetesClusterNodeDetailedStatus.class); } /** * Gets known KubernetesClusterNodeDetailedStatus values. - * + * * @return known KubernetesClusterNodeDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterPatchParameters.java index 9f92e32042e34..d94697c9ce249 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterPatchParameters.java @@ -5,39 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.KubernetesClusterPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. */ +/** + * KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + */ @Fluent -public final class KubernetesClusterPatchParameters { +public final class KubernetesClusterPatchParameters implements JsonSerializable { /* - * KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private KubernetesClusterPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of KubernetesClusterPatchParameters class. */ + /** + * Creates an instance of KubernetesClusterPatchParameters class. + */ public KubernetesClusterPatchParameters() { } /** - * Get the innerProperties property: KubernetesClusterPatchProperties represents the properties of the Kubernetes - * cluster that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private KubernetesClusterPatchProperties innerProperties() { @@ -46,7 +45,7 @@ private KubernetesClusterPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the KubernetesClusterPatchParameters object itself. */ @@ -65,11 +64,33 @@ public KubernetesClusterPatchParameters withTags(Map tags) { } /** - * Get the controlPlaneNodeConfiguration property: ControlPlaneNodePatchConfiguration represents the properties of - * the control plane that can be patched for this Kubernetes cluster. - * - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - * + * Get the administratorConfiguration property: The configuration of the default administrator credentials. + * + * @return the administratorConfiguration value. + */ + public AdministratorConfigurationPatch administratorConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().administratorConfiguration(); + } + + /** + * Set the administratorConfiguration property: The configuration of the default administrator credentials. + * + * @param administratorConfiguration the administratorConfiguration value to set. + * @return the KubernetesClusterPatchParameters object itself. + */ + public KubernetesClusterPatchParameters + withAdministratorConfiguration(AdministratorConfigurationPatch administratorConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new KubernetesClusterPatchProperties(); + } + this.innerProperties().withAdministratorConfiguration(administratorConfiguration); + return this; + } + + /** + * Get the controlPlaneNodeConfiguration property: The defining characteristics of the control plane that can be + * patched for this Kubernetes cluster. + * * @return the controlPlaneNodeConfiguration value. */ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { @@ -77,11 +98,9 @@ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { } /** - * Set the controlPlaneNodeConfiguration property: ControlPlaneNodePatchConfiguration represents the properties of - * the control plane that can be patched for this Kubernetes cluster. - * - *

The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - * + * Set the controlPlaneNodeConfiguration property: The defining characteristics of the control plane that can be + * patched for this Kubernetes cluster. + * * @param controlPlaneNodeConfiguration the controlPlaneNodeConfiguration value to set. * @return the KubernetesClusterPatchParameters object itself. */ @@ -95,9 +114,8 @@ public ControlPlaneNodePatchConfiguration controlPlaneNodeConfiguration() { } /** - * Get the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Get the kubernetesVersion property: The Kubernetes version for this cluster. + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -105,9 +123,8 @@ public String kubernetesVersion() { } /** - * Set the kubernetesVersion property: The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n - * format. The interpreted version used will be resolved into this field after creation or update. - * + * Set the kubernetesVersion property: The Kubernetes version for this cluster. + * * @param kubernetesVersion the kubernetesVersion value to set. * @return the KubernetesClusterPatchParameters object itself. */ @@ -121,7 +138,7 @@ public KubernetesClusterPatchParameters withKubernetesVersion(String kubernetesV /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -129,4 +146,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterPatchParameters 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 KubernetesClusterPatchParameters. + */ + public static KubernetesClusterPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterPatchParameters deserializedKubernetesClusterPatchParameters + = new KubernetesClusterPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedKubernetesClusterPatchParameters.innerProperties + = KubernetesClusterPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesClusterPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterProvisioningState.java index 14764c729c809..8171eda59820e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterProvisioningState.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the Kubernetes cluster resource. */ +/** + * The provisioning state of the Kubernetes cluster resource. + */ public final class KubernetesClusterProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for KubernetesClusterProvisioningState. */ + /** + * Static value Succeeded for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for KubernetesClusterProvisioningState. */ + /** + * Static value Failed for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for KubernetesClusterProvisioningState. */ + /** + * Static value Canceled for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState CANCELED = fromString("Canceled"); - /** Static value Accepted for KubernetesClusterProvisioningState. */ + /** + * Static value Accepted for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value InProgress for KubernetesClusterProvisioningState. */ + /** + * Static value InProgress for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState IN_PROGRESS = fromString("InProgress"); - /** Static value Created for KubernetesClusterProvisioningState. */ + /** + * Static value Created for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState CREATED = fromString("Created"); - /** Static value Updating for KubernetesClusterProvisioningState. */ + /** + * Static value Updating for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for KubernetesClusterProvisioningState. */ + /** + * Static value Deleting for KubernetesClusterProvisioningState. + */ public static final KubernetesClusterProvisioningState DELETING = fromString("Deleting"); /** * Creates a new instance of KubernetesClusterProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public KubernetesClusterProvisioningState() { /** * Creates or finds a KubernetesClusterProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesClusterProvisioningState. */ - @JsonCreator public static KubernetesClusterProvisioningState fromString(String name) { return fromString(name, KubernetesClusterProvisioningState.class); } /** * Gets known KubernetesClusterProvisioningState values. - * + * * @return known KubernetesClusterProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterRestartNodeParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterRestartNodeParameters.java index 989323a9b7f69..8eecd4d1de83f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterRestartNodeParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusterRestartNodeParameters.java @@ -6,27 +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; /** * KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes * cluster. */ @Fluent -public final class KubernetesClusterRestartNodeParameters { +public final class KubernetesClusterRestartNodeParameters + implements JsonSerializable { /* * The name of the node to restart. */ - @JsonProperty(value = "nodeName", required = true) private String nodeName; - /** Creates an instance of KubernetesClusterRestartNodeParameters class. */ + /** + * Creates an instance of KubernetesClusterRestartNodeParameters class. + */ public KubernetesClusterRestartNodeParameters() { } /** * Get the nodeName property: The name of the node to restart. - * + * * @return the nodeName value. */ public String nodeName() { @@ -35,7 +41,7 @@ public String nodeName() { /** * Set the nodeName property: The name of the node to restart. - * + * * @param nodeName the nodeName value to set. * @return the KubernetesClusterRestartNodeParameters object itself. */ @@ -46,15 +52,54 @@ public KubernetesClusterRestartNodeParameters withNodeName(String nodeName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (nodeName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property nodeName in model KubernetesClusterRestartNodeParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property nodeName in model KubernetesClusterRestartNodeParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(KubernetesClusterRestartNodeParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeName", this.nodeName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesClusterRestartNodeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesClusterRestartNodeParameters 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 KubernetesClusterRestartNodeParameters. + */ + public static KubernetesClusterRestartNodeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesClusterRestartNodeParameters deserializedKubernetesClusterRestartNodeParameters + = new KubernetesClusterRestartNodeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeName".equals(fieldName)) { + deserializedKubernetesClusterRestartNodeParameters.nodeName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesClusterRestartNodeParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusters.java index c612c0ec72242..8f80c0439d053 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesClusters.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of KubernetesClusters. */ +/** + * Resource collection API of KubernetesClusters. + */ public interface KubernetesClusters { /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List Kubernetes clusters in the subscription. - * - *

Get a list of Kubernetes clusters in the provided subscription. - * + * + * Get a list of Kubernetes clusters in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List Kubernetes clusters in the resource group. - * - *

Get a list of Kubernetes clusters in the provided resource group. - * + * + * Get a list of Kubernetes clusters in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Kubernetes clusters in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of Kubernetes clusters in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param context The context to associate with this operation. @@ -83,9 +85,9 @@ Response getByResourceGroupWithResponse(String resourceGroupN /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,36 +99,38 @@ Response getByResourceGroupWithResponse(String resourceGroupN /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String kubernetesClusterName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String kubernetesClusterName); /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes 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 current status of an async operation. */ - void delete(String resourceGroupName, String kubernetesClusterName, Context context); + OperationStatusResult delete(String resourceGroupName, String kubernetesClusterName, Context context); /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -140,9 +144,9 @@ OperationStatusResult restartNode(String resourceGroupName, String kubernetesClu /** * Restart a targeted node. - * - *

Restart a targeted node of a Kubernetes cluster. - * + * + * Restart a targeted node of a Kubernetes cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kubernetesClusterName The name of the Kubernetes cluster. * @param kubernetesClusterRestartNodeParameters The request body. @@ -157,9 +161,9 @@ OperationStatusResult restartNode(String resourceGroupName, String kubernetesClu /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -170,9 +174,9 @@ OperationStatusResult restartNode(String resourceGroupName, String kubernetesClu /** * Retrieve the Kubernetes cluster. - * - *

Get properties of the provided the Kubernetes cluster. - * + * + * Get properties of the provided the Kubernetes cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,32 +188,34 @@ OperationStatusResult restartNode(String resourceGroupName, String kubernetesClu /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the Kubernetes cluster. - * - *

Delete the provided Kubernetes cluster. - * + * + * Delete the provided Kubernetes cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new KubernetesCluster resource. - * + * * @param name resource name. * @return the first stage of the new KubernetesCluster definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesLabel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesLabel.java index 5736730fb2296..a0d565da321ab 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesLabel.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesLabel.java @@ -6,30 +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; -/** KubernetesLabel represents a single entry for a Kubernetes label or taint such as those used on a node or pod. */ +/** + * KubernetesLabel represents a single entry for a Kubernetes label or taint such as those used on a node or pod. + */ @Fluent -public final class KubernetesLabel { +public final class KubernetesLabel implements JsonSerializable { /* * The name of the label or taint. */ - @JsonProperty(value = "key", required = true) private String key; /* * The value of the label or taint. */ - @JsonProperty(value = "value", required = true) private String value; - /** Creates an instance of KubernetesLabel class. */ + /** + * Creates an instance of KubernetesLabel class. + */ public KubernetesLabel() { } /** * Get the key property: The name of the label or taint. - * + * * @return the key value. */ public String key() { @@ -38,7 +44,7 @@ public String key() { /** * Set the key property: The name of the label or taint. - * + * * @param key the key value to set. * @return the KubernetesLabel object itself. */ @@ -49,7 +55,7 @@ public KubernetesLabel withKey(String key) { /** * Get the value property: The value of the label or taint. - * + * * @return the value value. */ public String value() { @@ -58,7 +64,7 @@ public String value() { /** * Set the value property: The value of the label or taint. - * + * * @param value the value value to set. * @return the KubernetesLabel object itself. */ @@ -69,19 +75,59 @@ public KubernetesLabel withValue(String value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (key() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property key in model KubernetesLabel")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property key in model KubernetesLabel")); } if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model KubernetesLabel")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model KubernetesLabel")); } } private static final ClientLogger LOGGER = new ClientLogger(KubernetesLabel.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesLabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesLabel 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 KubernetesLabel. + */ + public static KubernetesLabel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesLabel deserializedKubernetesLabel = new KubernetesLabel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedKubernetesLabel.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedKubernetesLabel.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesLabel; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodePowerState.java index 8c8b50beddcd8..710086ce4e5fc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodePowerState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodePowerState.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The power state of this node. */ +/** + * The power state of this node. + */ public final class KubernetesNodePowerState extends ExpandableStringEnum { - /** Static value On for KubernetesNodePowerState. */ + /** + * Static value On for KubernetesNodePowerState. + */ public static final KubernetesNodePowerState ON = fromString("On"); - /** Static value Off for KubernetesNodePowerState. */ + /** + * Static value Off for KubernetesNodePowerState. + */ public static final KubernetesNodePowerState OFF = fromString("Off"); - /** Static value Unknown for KubernetesNodePowerState. */ + /** + * Static value Unknown for KubernetesNodePowerState. + */ public static final KubernetesNodePowerState UNKNOWN = fromString("Unknown"); /** * Creates a new instance of KubernetesNodePowerState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public KubernetesNodePowerState() { /** * Creates or finds a KubernetesNodePowerState from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesNodePowerState. */ - @JsonCreator public static KubernetesNodePowerState fromString(String name) { return fromString(name, KubernetesNodePowerState.class); } /** * Gets known KubernetesNodePowerState values. - * + * * @return known KubernetesNodePowerState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodeRole.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodeRole.java index 158c675d155fc..5ad2d9e5ba693 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodeRole.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesNodeRole.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The role of this node in the cluster. */ +/** + * The role of this node in the cluster. + */ public final class KubernetesNodeRole extends ExpandableStringEnum { - /** Static value ControlPlane for KubernetesNodeRole. */ + /** + * Static value ControlPlane for KubernetesNodeRole. + */ public static final KubernetesNodeRole CONTROL_PLANE = fromString("ControlPlane"); - /** Static value Worker for KubernetesNodeRole. */ + /** + * Static value Worker for KubernetesNodeRole. + */ public static final KubernetesNodeRole WORKER = fromString("Worker"); /** * Creates a new instance of KubernetesNodeRole value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public KubernetesNodeRole() { /** * Creates or finds a KubernetesNodeRole from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesNodeRole. */ - @JsonCreator public static KubernetesNodeRole fromString(String name) { return fromString(name, KubernetesNodeRole.class); } /** * Gets known KubernetesNodeRole values. - * + * * @return known KubernetesNodeRole values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesPluginType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesPluginType.java index 3fc078a3053cd..38aeb893d5b8a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesPluginType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KubernetesPluginType.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of how this network will be utilized by the Kubernetes cluster. */ +/** + * The indicator of how this network will be utilized by the Kubernetes cluster. + */ public final class KubernetesPluginType extends ExpandableStringEnum { - /** Static value DPDK for KubernetesPluginType. */ + /** + * Static value DPDK for KubernetesPluginType. + */ public static final KubernetesPluginType DPDK = fromString("DPDK"); - /** Static value SRIOV for KubernetesPluginType. */ + /** + * Static value SRIOV for KubernetesPluginType. + */ public static final KubernetesPluginType SRIOV = fromString("SRIOV"); - /** Static value OSDevice for KubernetesPluginType. */ + /** + * Static value OSDevice for KubernetesPluginType. + */ public static final KubernetesPluginType OSDEVICE = fromString("OSDevice"); - /** Static value MACVLAN for KubernetesPluginType. */ + /** + * Static value MACVLAN for KubernetesPluginType. + */ public static final KubernetesPluginType MACVLAN = fromString("MACVLAN"); - /** Static value IPVLAN for KubernetesPluginType. */ + /** + * Static value IPVLAN for KubernetesPluginType. + */ public static final KubernetesPluginType IPVLAN = fromString("IPVLAN"); /** * Creates a new instance of KubernetesPluginType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public KubernetesPluginType() { /** * Creates or finds a KubernetesPluginType from its string representation. - * + * * @param name a name to look for. * @return the corresponding KubernetesPluginType. */ - @JsonCreator public static KubernetesPluginType fromString(String name) { return fromString(name, KubernetesPluginType.class); } /** * Gets known KubernetesPluginType values. - * + * * @return known KubernetesPluginType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java index d62098e7a0df3..fb3c9e0678f38 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of L2Network. */ +/** + * An immutable client-side representation of L2Network. + */ public interface L2Network { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,28 +67,28 @@ public interface L2Network { /** * Gets the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ List associatedResourceIds(); /** * Gets the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The more detailed status of the L2 network. - * + * * @return the detailedStatus value. */ L2NetworkDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -97,7 +96,7 @@ public interface L2Network { /** * Gets the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ List hybridAksClustersAssociatedIds(); @@ -105,7 +104,7 @@ public interface L2Network { /** * Gets the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ HybridAksPluginType hybridAksPluginType(); @@ -113,21 +112,21 @@ public interface L2Network { /** * Gets the interfaceName property: The default interface name for this L2 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ String interfaceName(); /** * Gets the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. - * + * * @return the l2IsolationDomainId value. */ String l2IsolationDomainId(); /** * Gets the provisioningState property: The provisioning state of the L2 network. - * + * * @return the provisioningState value. */ L2NetworkProvisioningState provisioningState(); @@ -136,56 +135,64 @@ public interface L2Network { * Gets the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ List virtualMachinesAssociatedIds(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner object. - * + * * @return the inner object. */ L2NetworkInner innerModel(); - /** The entirety of the L2Network definition. */ + /** + * The entirety of the L2Network definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithL2IsolationDomainId, DefinitionStages.WithCreate { } - /** The L2Network definition stages. */ + /** + * The L2Network definition stages. + */ interface DefinitionStages { - /** The first stage of the L2Network definition. */ + /** + * The first stage of the L2Network definition. + */ interface Blank extends WithLocation { } - /** The stage of the L2Network definition allowing to specify location. */ + /** + * The stage of the L2Network definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -193,45 +200,47 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the L2Network definition allowing to specify parent resource. */ + /** + * The stage of the L2Network definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the L2Network definition allowing to specify extendedLocation. */ + /** + * The stage of the L2Network definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithL2IsolationDomainId withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the L2Network definition allowing to specify l2IsolationDomainId. */ + /** + * The stage of the L2Network definition allowing to specify l2IsolationDomainId. + */ interface WithL2IsolationDomainId { /** * Specifies the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain.. - * + * * @param l2IsolationDomainId The resource ID of the Network Fabric l2IsolationDomain. * @return the next definition stage. */ @@ -246,53 +255,59 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithHyb DefinitionStages.WithInterfaceName { /** * Executes the create request. - * + * * @return the created resource. */ L2Network create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ L2Network create(Context context); } - /** The stage of the L2Network definition allowing to specify tags. */ + /** + * The stage of the L2Network definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the L2Network definition allowing to specify hybridAksPluginType. */ + /** + * The stage of the L2Network definition allowing to specify hybridAksPluginType. + */ interface WithHybridAksPluginType { /** * Specifies the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it * will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.. - * + * * @param hybridAksPluginType Field Deprecated. The field was previously optional, now it will have no - * defined behavior and will be ignored. The network plugin type for Hybrid AKS. + * defined behavior and will be ignored. The network plugin type for Hybrid AKS. * @return the next definition stage. */ WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); } - /** The stage of the L2Network definition allowing to specify interfaceName. */ + /** + * The stage of the L2Network definition allowing to specify interfaceName. + */ interface WithInterfaceName { /** * Specifies the interfaceName property: The default interface name for this L2 network in the virtual * machine. This name can be overridden by the name supplied in the network attachment configuration of that * virtual machine.. - * + * * @param interfaceName The default interface name for this L2 network in the virtual machine. This name can - * be overridden by the name supplied in the network attachment configuration of that virtual machine. + * be overridden by the name supplied in the network attachment configuration of that virtual machine. * @return the next definition stage. */ WithCreate withInterfaceName(String interfaceName); @@ -301,36 +316,42 @@ interface WithInterfaceName { /** * Begins update for the L2Network resource. - * + * * @return the stage of resource update. */ L2Network.Update update(); - /** The template for L2Network update. */ + /** + * The template for L2Network update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ L2Network apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ L2Network apply(Context context); } - /** The L2Network update stages. */ + /** + * The L2Network update stages. + */ interface UpdateStages { - /** The stage of the L2Network update allowing to specify tags. */ + /** + * The stage of the L2Network update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ @@ -340,14 +361,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ L2Network refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkAttachmentConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkAttachmentConfiguration.java index fd386214c28fd..810db7d21be77 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkAttachmentConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkAttachmentConfiguration.java @@ -6,30 +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; -/** L2NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 2 network. */ +/** + * L2NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 2 network. + */ @Fluent -public final class L2NetworkAttachmentConfiguration { +public final class L2NetworkAttachmentConfiguration implements JsonSerializable { /* * The resource ID of the network that is being configured for attachment. */ - @JsonProperty(value = "networkId", required = true) private String networkId; /* * The indicator of how this network will be utilized by the Kubernetes cluster. */ - @JsonProperty(value = "pluginType") private KubernetesPluginType pluginType; - /** Creates an instance of L2NetworkAttachmentConfiguration class. */ + /** + * Creates an instance of L2NetworkAttachmentConfiguration class. + */ public L2NetworkAttachmentConfiguration() { } /** * Get the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @return the networkId value. */ public String networkId() { @@ -38,7 +44,7 @@ public String networkId() { /** * Set the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @param networkId the networkId value to set. * @return the L2NetworkAttachmentConfiguration object itself. */ @@ -49,7 +55,7 @@ public L2NetworkAttachmentConfiguration withNetworkId(String networkId) { /** * Get the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @return the pluginType value. */ public KubernetesPluginType pluginType() { @@ -58,7 +64,7 @@ public KubernetesPluginType pluginType() { /** * Set the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @param pluginType the pluginType value to set. * @return the L2NetworkAttachmentConfiguration object itself. */ @@ -69,15 +75,58 @@ public L2NetworkAttachmentConfiguration withPluginType(KubernetesPluginType plug /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (networkId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property networkId in model L2NetworkAttachmentConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkId in model L2NetworkAttachmentConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(L2NetworkAttachmentConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkId", this.networkId); + jsonWriter.writeStringField("pluginType", this.pluginType == null ? null : this.pluginType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2NetworkAttachmentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2NetworkAttachmentConfiguration 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 L2NetworkAttachmentConfiguration. + */ + public static L2NetworkAttachmentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2NetworkAttachmentConfiguration deserializedL2NetworkAttachmentConfiguration + = new L2NetworkAttachmentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkId".equals(fieldName)) { + deserializedL2NetworkAttachmentConfiguration.networkId = reader.getString(); + } else if ("pluginType".equals(fieldName)) { + deserializedL2NetworkAttachmentConfiguration.pluginType + = KubernetesPluginType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedL2NetworkAttachmentConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java index 9880b8715d17a..f675aa6488091 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the L2 network. */ +/** + * The more detailed status of the L2 network. + */ public final class L2NetworkDetailedStatus extends ExpandableStringEnum { - /** Static value Error for L2NetworkDetailedStatus. */ + /** + * Static value Error for L2NetworkDetailedStatus. + */ public static final L2NetworkDetailedStatus ERROR = fromString("Error"); - /** Static value Available for L2NetworkDetailedStatus. */ + /** + * Static value Available for L2NetworkDetailedStatus. + */ public static final L2NetworkDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for L2NetworkDetailedStatus. */ + /** + * Static value Provisioning for L2NetworkDetailedStatus. + */ public static final L2NetworkDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of L2NetworkDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public L2NetworkDetailedStatus() { /** * Creates or finds a L2NetworkDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding L2NetworkDetailedStatus. */ - @JsonCreator public static L2NetworkDetailedStatus fromString(String name) { return fromString(name, L2NetworkDetailedStatus.class); } /** * Gets known L2NetworkDetailedStatus values. - * + * * @return known L2NetworkDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java index f0e880f2c68e6..795b974199c81 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.L2NetworkInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** L2NetworkList represents a list of L2 networks. */ +/** + * L2NetworkList represents a list of L2 networks. + */ @Fluent -public final class L2NetworkList { +public final class L2NetworkList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of L2 networks. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of L2NetworkList class. */ + /** + * Creates an instance of L2NetworkList class. + */ public L2NetworkList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the L2NetworkList object itself. */ @@ -50,7 +56,7 @@ public L2NetworkList withNextLink(String nextLink) { /** * Get the value property: The list of L2 networks. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of L2 networks. - * + * * @param value the value value to set. * @return the L2NetworkList object itself. */ @@ -70,7 +76,7 @@ public L2NetworkList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2NetworkList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2NetworkList 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 L2NetworkList. + */ + public static L2NetworkList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2NetworkList deserializedL2NetworkList = new L2NetworkList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedL2NetworkList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> L2NetworkInner.fromJson(reader1)); + deserializedL2NetworkList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedL2NetworkList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java index 72534a605d056..6acea6f27bb53 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** L2NetworkPatchParameters represents the body of the request to patch the L2 network. */ +/** + * L2NetworkPatchParameters represents the body of the request to patch the L2 network. + */ @Fluent -public final class L2NetworkPatchParameters { +public final class L2NetworkPatchParameters implements JsonSerializable { /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of L2NetworkPatchParameters class. */ + /** + * Creates an instance of L2NetworkPatchParameters class. + */ public L2NetworkPatchParameters() { } /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the L2NetworkPatchParameters object itself. */ @@ -45,9 +50,46 @@ public L2NetworkPatchParameters withTags(Map tags) { /** * 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.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2NetworkPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2NetworkPatchParameters 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 L2NetworkPatchParameters. + */ + public static L2NetworkPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2NetworkPatchParameters deserializedL2NetworkPatchParameters = new L2NetworkPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedL2NetworkPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedL2NetworkPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java index c98da59a23c88..32bc25a571f38 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the L2 network. */ +/** + * The provisioning state of the L2 network. + */ public final class L2NetworkProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for L2NetworkProvisioningState. */ + /** + * Static value Succeeded for L2NetworkProvisioningState. + */ public static final L2NetworkProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for L2NetworkProvisioningState. */ + /** + * Static value Failed for L2NetworkProvisioningState. + */ public static final L2NetworkProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for L2NetworkProvisioningState. */ + /** + * Static value Canceled for L2NetworkProvisioningState. + */ public static final L2NetworkProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for L2NetworkProvisioningState. */ + /** + * Static value Provisioning for L2NetworkProvisioningState. + */ public static final L2NetworkProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for L2NetworkProvisioningState. */ + /** + * Static value Accepted for L2NetworkProvisioningState. + */ public static final L2NetworkProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of L2NetworkProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public L2NetworkProvisioningState() { /** * Creates or finds a L2NetworkProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding L2NetworkProvisioningState. */ - @JsonCreator public static L2NetworkProvisioningState fromString(String name) { return fromString(name, L2NetworkProvisioningState.class); } /** * Gets known L2NetworkProvisioningState values. - * + * * @return known L2NetworkProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java index 6b288dbc3244a..1422bcf03cd0e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of L2Networks. */ +/** + * Resource collection API of L2Networks. + */ public interface L2Networks { /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List layer 2 (L2) networks in the subscription. - * - *

Get a list of layer 2 (L2) networks in the provided subscription. - * + * + * Get a list of layer 2 (L2) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List layer 2 (L2) networks in the resource group. - * - *

Get a list of layer 2 (L2) networks in the provided resource group. - * + * + * Get a list of layer 2 (L2) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 2 (L2) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @param context The context to associate with this operation. @@ -82,9 +84,9 @@ public interface L2Networks { /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -96,36 +98,38 @@ public interface L2Networks { /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String l2NetworkName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String l2NetworkName); /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l2NetworkName The name of the L2 network. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String l2NetworkName, Context context); + OperationStatusResult delete(String resourceGroupName, String l2NetworkName, Context context); /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,9 +140,9 @@ public interface L2Networks { /** * Retrieve the layer 2 (L2) network. - * - *

Get properties of the provided layer 2 (L2) network. - * + * + * Get properties of the provided layer 2 (L2) network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -150,32 +154,34 @@ public interface L2Networks { /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the layer 2 (L2) network. - * - *

Delete the provided layer 2 (L2) network. - * + * + * Delete the provided layer 2 (L2) network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new L2Network resource. - * + * * @param name resource name. * @return the first stage of the new L2Network definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2ServiceLoadBalancerConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2ServiceLoadBalancerConfiguration.java new file mode 100644 index 0000000000000..4bc8ca7402605 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2ServiceLoadBalancerConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. + */ +@Fluent +public final class L2ServiceLoadBalancerConfiguration implements JsonSerializable { + /* + * The list of pools of IP addresses that can be allocated to load balancer services. + */ + private List ipAddressPools; + + /** + * Creates an instance of L2ServiceLoadBalancerConfiguration class. + */ + public L2ServiceLoadBalancerConfiguration() { + } + + /** + * Get the ipAddressPools property: The list of pools of IP addresses that can be allocated to load balancer + * services. + * + * @return the ipAddressPools value. + */ + public List ipAddressPools() { + return this.ipAddressPools; + } + + /** + * Set the ipAddressPools property: The list of pools of IP addresses that can be allocated to load balancer + * services. + * + * @param ipAddressPools the ipAddressPools value to set. + * @return the L2ServiceLoadBalancerConfiguration object itself. + */ + public L2ServiceLoadBalancerConfiguration withIpAddressPools(List ipAddressPools) { + this.ipAddressPools = ipAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressPools() != null) { + ipAddressPools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipAddressPools", this.ipAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L2ServiceLoadBalancerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L2ServiceLoadBalancerConfiguration 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 L2ServiceLoadBalancerConfiguration. + */ + public static L2ServiceLoadBalancerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L2ServiceLoadBalancerConfiguration deserializedL2ServiceLoadBalancerConfiguration + = new L2ServiceLoadBalancerConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddressPools".equals(fieldName)) { + List ipAddressPools = reader.readArray(reader1 -> IpAddressPool.fromJson(reader1)); + deserializedL2ServiceLoadBalancerConfiguration.ipAddressPools = ipAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedL2ServiceLoadBalancerConfiguration; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java index 00e0e62dbaf5d..bcbe9bbba151d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of L3Network. */ +/** + * An immutable client-side representation of L3Network. + */ public interface L3Network { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,28 +67,28 @@ public interface L3Network { /** * Gets the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ List associatedResourceIds(); /** * Gets the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The more detailed status of the L3 network. - * + * * @return the detailedStatus value. */ L3NetworkDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -97,7 +96,7 @@ public interface L3Network { /** * Gets the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this L3 network. - * + * * @return the hybridAksClustersAssociatedIds value. */ List hybridAksClustersAssociatedIds(); @@ -106,7 +105,7 @@ public interface L3Network { * Gets the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network * attachment definition injected into the Hybrid AKS Cluster. - * + * * @return the hybridAksIpamEnabled value. */ HybridAksIpamEnabled hybridAksIpamEnabled(); @@ -114,7 +113,7 @@ public interface L3Network { /** * Gets the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ HybridAksPluginType hybridAksPluginType(); @@ -122,44 +121,46 @@ public interface L3Network { /** * Gets the interfaceName property: The default interface name for this L3 network in the virtual machine. This name * can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ String interfaceName(); /** * Gets the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". - * + * * @return the ipAllocationType value. */ IpAllocationType ipAllocationType(); /** * Gets the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. - * + * allocation type + * is IPV4 or DualStack. + * * @return the ipv4ConnectedPrefix value. */ String ipv4ConnectedPrefix(); /** * Gets the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. - * + * allocation type + * is IPV6 or DualStack. + * * @return the ipv6ConnectedPrefix value. */ String ipv6ConnectedPrefix(); /** * Gets the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. - * + * * @return the l3IsolationDomainId value. */ String l3IsolationDomainId(); /** * Gets the provisioningState property: The provisioning state of the L3 network. - * + * * @return the provisioningState value. */ L3NetworkProvisioningState provisioningState(); @@ -168,63 +169,71 @@ public interface L3Network { * Gets the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 * network. - * + * * @return the virtualMachinesAssociatedIds value. */ List virtualMachinesAssociatedIds(); /** * Gets the vlan property: The VLAN from the l3IsolationDomain that is used for this network. - * + * * @return the vlan value. */ long vlan(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner object. - * + * * @return the inner object. */ L3NetworkInner innerModel(); - /** The entirety of the L3Network definition. */ + /** + * The entirety of the L3Network definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithL3IsolationDomainId, DefinitionStages.WithVlan, DefinitionStages.WithCreate { } - /** The L3Network definition stages. */ + /** + * The L3Network definition stages. + */ interface DefinitionStages { - /** The first stage of the L3Network definition. */ + /** + * The first stage of the L3Network definition. + */ interface Blank extends WithLocation { } - /** The stage of the L3Network definition allowing to specify location. */ + /** + * The stage of the L3Network definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -232,56 +241,60 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the L3Network definition allowing to specify parent resource. */ + /** + * The stage of the L3Network definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the L3Network definition allowing to specify extendedLocation. */ + /** + * The stage of the L3Network definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithL3IsolationDomainId withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the L3Network definition allowing to specify l3IsolationDomainId. */ + /** + * The stage of the L3Network definition allowing to specify l3IsolationDomainId. + */ interface WithL3IsolationDomainId { /** * Specifies the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain.. - * + * * @param l3IsolationDomainId The resource ID of the Network Fabric l3IsolationDomain. * @return the next definition stage. */ WithVlan withL3IsolationDomainId(String l3IsolationDomainId); } - /** The stage of the L3Network definition allowing to specify vlan. */ + /** + * The stage of the L3Network definition allowing to specify vlan. + */ interface WithVlan { /** * Specifies the vlan property: The VLAN from the l3IsolationDomain that is used for this network.. - * + * * @param vlan The VLAN from the l3IsolationDomain that is used for this network. * @return the next definition stage. */ @@ -298,106 +311,124 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithHyb DefinitionStages.WithIpv6ConnectedPrefix { /** * Executes the create request. - * + * * @return the created resource. */ L3Network create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ L3Network create(Context context); } - /** The stage of the L3Network definition allowing to specify tags. */ + /** + * The stage of the L3Network definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the L3Network definition allowing to specify hybridAksIpamEnabled. */ + /** + * The stage of the L3Network definition allowing to specify hybridAksIpamEnabled. + */ interface WithHybridAksIpamEnabled { /** * Specifies the hybridAksIpamEnabled property: Field Deprecated. The field was previously optional, now it * will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM * allocation on the network attachment definition injected into the Hybrid AKS Cluster.. - * + * * @param hybridAksIpamEnabled Field Deprecated. The field was previously optional, now it will have no - * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on - * the network attachment definition injected into the Hybrid AKS Cluster. + * defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the + * network attachment definition injected into the Hybrid AKS Cluster. * @return the next definition stage. */ WithCreate withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpamEnabled); } - /** The stage of the L3Network definition allowing to specify hybridAksPluginType. */ + /** + * The stage of the L3Network definition allowing to specify hybridAksPluginType. + */ interface WithHybridAksPluginType { /** * Specifies the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it * will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.. - * + * * @param hybridAksPluginType Field Deprecated. The field was previously optional, now it will have no - * defined behavior and will be ignored. The network plugin type for Hybrid AKS. + * defined behavior and will be ignored. The network plugin type for Hybrid AKS. * @return the next definition stage. */ WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); } - /** The stage of the L3Network definition allowing to specify interfaceName. */ + /** + * The stage of the L3Network definition allowing to specify interfaceName. + */ interface WithInterfaceName { /** * Specifies the interfaceName property: The default interface name for this L3 network in the virtual * machine. This name can be overridden by the name supplied in the network attachment configuration of that * virtual machine.. - * + * * @param interfaceName The default interface name for this L3 network in the virtual machine. This name can - * be overridden by the name supplied in the network attachment configuration of that virtual machine. + * be overridden by the name supplied in the network attachment configuration of that virtual machine. * @return the next definition stage. */ WithCreate withInterfaceName(String interfaceName); } - /** The stage of the L3Network definition allowing to specify ipAllocationType. */ + /** + * The stage of the L3Network definition allowing to specify ipAllocationType. + */ interface WithIpAllocationType { /** * Specifies the ipAllocationType property: The type of the IP address allocation, defaulted to * "DualStack".. - * + * * @param ipAllocationType The type of the IP address allocation, defaulted to "DualStack". * @return the next definition stage. */ WithCreate withIpAllocationType(IpAllocationType ipAllocationType); } - /** The stage of the L3Network definition allowing to specify ipv4ConnectedPrefix. */ + /** + * The stage of the L3Network definition allowing to specify ipv4ConnectedPrefix. + */ interface WithIpv4ConnectedPrefix { /** * Specifies the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required - * when the IP allocation type is IPV4 or DualStack.. - * + * when the IP allocation type + * is IPV4 or DualStack.. + * * @param ipv4ConnectedPrefix The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV4 or DualStack. + * allocation type + * is IPV4 or DualStack. * @return the next definition stage. */ WithCreate withIpv4ConnectedPrefix(String ipv4ConnectedPrefix); } - /** The stage of the L3Network definition allowing to specify ipv6ConnectedPrefix. */ + /** + * The stage of the L3Network definition allowing to specify ipv6ConnectedPrefix. + */ interface WithIpv6ConnectedPrefix { /** * Specifies the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required - * when the IP allocation type is IPV6 or DualStack.. - * + * when the IP allocation type + * is IPV6 or DualStack.. + * * @param ipv6ConnectedPrefix The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP - * allocation type is IPV6 or DualStack. + * allocation type + * is IPV6 or DualStack. * @return the next definition stage. */ WithCreate withIpv6ConnectedPrefix(String ipv6ConnectedPrefix); @@ -406,36 +437,42 @@ interface WithIpv6ConnectedPrefix { /** * Begins update for the L3Network resource. - * + * * @return the stage of resource update. */ L3Network.Update update(); - /** The template for L3Network update. */ + /** + * The template for L3Network update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ L3Network apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ L3Network apply(Context context); } - /** The L3Network update stages. */ + /** + * The L3Network update stages. + */ interface UpdateStages { - /** The stage of the L3Network update allowing to specify tags. */ + /** + * The stage of the L3Network update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ @@ -445,14 +482,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ L3Network refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkAttachmentConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkAttachmentConfiguration.java index c3a749f70839f..c2c19212cd5e2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkAttachmentConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkAttachmentConfiguration.java @@ -6,38 +6,43 @@ 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; -/** L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. */ +/** + * L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + */ @Fluent -public final class L3NetworkAttachmentConfiguration { +public final class L3NetworkAttachmentConfiguration implements JsonSerializable { /* * The indication of whether this network will or will not perform IP address management and allocate IP addresses * when attached. */ - @JsonProperty(value = "ipamEnabled") private L3NetworkConfigurationIpamEnabled ipamEnabled; /* * The resource ID of the network that is being configured for attachment. */ - @JsonProperty(value = "networkId", required = true) private String networkId; /* * The indicator of how this network will be utilized by the Kubernetes cluster. */ - @JsonProperty(value = "pluginType") private KubernetesPluginType pluginType; - /** Creates an instance of L3NetworkAttachmentConfiguration class. */ + /** + * Creates an instance of L3NetworkAttachmentConfiguration class. + */ public L3NetworkAttachmentConfiguration() { } /** * Get the ipamEnabled property: The indication of whether this network will or will not perform IP address * management and allocate IP addresses when attached. - * + * * @return the ipamEnabled value. */ public L3NetworkConfigurationIpamEnabled ipamEnabled() { @@ -47,7 +52,7 @@ public L3NetworkConfigurationIpamEnabled ipamEnabled() { /** * Set the ipamEnabled property: The indication of whether this network will or will not perform IP address * management and allocate IP addresses when attached. - * + * * @param ipamEnabled the ipamEnabled value to set. * @return the L3NetworkAttachmentConfiguration object itself. */ @@ -58,7 +63,7 @@ public L3NetworkAttachmentConfiguration withIpamEnabled(L3NetworkConfigurationIp /** * Get the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @return the networkId value. */ public String networkId() { @@ -67,7 +72,7 @@ public String networkId() { /** * Set the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @param networkId the networkId value to set. * @return the L3NetworkAttachmentConfiguration object itself. */ @@ -78,7 +83,7 @@ public L3NetworkAttachmentConfiguration withNetworkId(String networkId) { /** * Get the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @return the pluginType value. */ public KubernetesPluginType pluginType() { @@ -87,7 +92,7 @@ public KubernetesPluginType pluginType() { /** * Set the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @param pluginType the pluginType value to set. * @return the L3NetworkAttachmentConfiguration object itself. */ @@ -98,15 +103,62 @@ public L3NetworkAttachmentConfiguration withPluginType(KubernetesPluginType plug /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (networkId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property networkId in model L3NetworkAttachmentConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkId in model L3NetworkAttachmentConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(L3NetworkAttachmentConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkId", this.networkId); + jsonWriter.writeStringField("ipamEnabled", this.ipamEnabled == null ? null : this.ipamEnabled.toString()); + jsonWriter.writeStringField("pluginType", this.pluginType == null ? null : this.pluginType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L3NetworkAttachmentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L3NetworkAttachmentConfiguration 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 L3NetworkAttachmentConfiguration. + */ + public static L3NetworkAttachmentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L3NetworkAttachmentConfiguration deserializedL3NetworkAttachmentConfiguration + = new L3NetworkAttachmentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkId".equals(fieldName)) { + deserializedL3NetworkAttachmentConfiguration.networkId = reader.getString(); + } else if ("ipamEnabled".equals(fieldName)) { + deserializedL3NetworkAttachmentConfiguration.ipamEnabled + = L3NetworkConfigurationIpamEnabled.fromString(reader.getString()); + } else if ("pluginType".equals(fieldName)) { + deserializedL3NetworkAttachmentConfiguration.pluginType + = KubernetesPluginType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedL3NetworkAttachmentConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkConfigurationIpamEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkConfigurationIpamEnabled.java index fca5d548a5349..46b6f8689fb1f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkConfigurationIpamEnabled.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkConfigurationIpamEnabled.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * attached. */ public final class L3NetworkConfigurationIpamEnabled extends ExpandableStringEnum { - /** Static value True for L3NetworkConfigurationIpamEnabled. */ + /** + * Static value True for L3NetworkConfigurationIpamEnabled. + */ public static final L3NetworkConfigurationIpamEnabled TRUE = fromString("True"); - /** Static value False for L3NetworkConfigurationIpamEnabled. */ + /** + * Static value False for L3NetworkConfigurationIpamEnabled. + */ public static final L3NetworkConfigurationIpamEnabled FALSE = fromString("False"); /** * Creates a new instance of L3NetworkConfigurationIpamEnabled value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public L3NetworkConfigurationIpamEnabled() { /** * Creates or finds a L3NetworkConfigurationIpamEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding L3NetworkConfigurationIpamEnabled. */ - @JsonCreator public static L3NetworkConfigurationIpamEnabled fromString(String name) { return fromString(name, L3NetworkConfigurationIpamEnabled.class); } /** * Gets known L3NetworkConfigurationIpamEnabled values. - * + * * @return known L3NetworkConfigurationIpamEnabled values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java index 820cf9b025ded..2983333335cba 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the L3 network. */ +/** + * The more detailed status of the L3 network. + */ public final class L3NetworkDetailedStatus extends ExpandableStringEnum { - /** Static value Error for L3NetworkDetailedStatus. */ + /** + * Static value Error for L3NetworkDetailedStatus. + */ public static final L3NetworkDetailedStatus ERROR = fromString("Error"); - /** Static value Available for L3NetworkDetailedStatus. */ + /** + * Static value Available for L3NetworkDetailedStatus. + */ public static final L3NetworkDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for L3NetworkDetailedStatus. */ + /** + * Static value Provisioning for L3NetworkDetailedStatus. + */ public static final L3NetworkDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of L3NetworkDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public L3NetworkDetailedStatus() { /** * Creates or finds a L3NetworkDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding L3NetworkDetailedStatus. */ - @JsonCreator public static L3NetworkDetailedStatus fromString(String name) { return fromString(name, L3NetworkDetailedStatus.class); } /** * Gets known L3NetworkDetailedStatus values. - * + * * @return known L3NetworkDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java index 58b433c99e2f8..775b8b265cc3d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.L3NetworkInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** L3NetworkList represents a list of L3 networks. */ +/** + * L3NetworkList represents a list of L3 networks. + */ @Fluent -public final class L3NetworkList { +public final class L3NetworkList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of L3 networks. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of L3NetworkList class. */ + /** + * Creates an instance of L3NetworkList class. + */ public L3NetworkList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the L3NetworkList object itself. */ @@ -50,7 +56,7 @@ public L3NetworkList withNextLink(String nextLink) { /** * Get the value property: The list of L3 networks. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of L3 networks. - * + * * @param value the value value to set. * @return the L3NetworkList object itself. */ @@ -70,7 +76,7 @@ public L3NetworkList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L3NetworkList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L3NetworkList 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 L3NetworkList. + */ + public static L3NetworkList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L3NetworkList deserializedL3NetworkList = new L3NetworkList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedL3NetworkList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> L3NetworkInner.fromJson(reader1)); + deserializedL3NetworkList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedL3NetworkList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java index a64aec64d4f52..ad935cfff488a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** L3NetworkPatchParameters represents the body of the request to patch the cloud services network. */ +/** + * L3NetworkPatchParameters represents the body of the request to patch the cloud services network. + */ @Fluent -public final class L3NetworkPatchParameters { +public final class L3NetworkPatchParameters implements JsonSerializable { /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of L3NetworkPatchParameters class. */ + /** + * Creates an instance of L3NetworkPatchParameters class. + */ public L3NetworkPatchParameters() { } /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the L3NetworkPatchParameters object itself. */ @@ -45,9 +50,46 @@ public L3NetworkPatchParameters withTags(Map tags) { /** * 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.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of L3NetworkPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of L3NetworkPatchParameters 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 L3NetworkPatchParameters. + */ + public static L3NetworkPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + L3NetworkPatchParameters deserializedL3NetworkPatchParameters = new L3NetworkPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedL3NetworkPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedL3NetworkPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java index 3a5eab6857f70..a2a9f1a005d29 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the L3 network. */ +/** + * The provisioning state of the L3 network. + */ public final class L3NetworkProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for L3NetworkProvisioningState. */ + /** + * Static value Succeeded for L3NetworkProvisioningState. + */ public static final L3NetworkProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for L3NetworkProvisioningState. */ + /** + * Static value Failed for L3NetworkProvisioningState. + */ public static final L3NetworkProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for L3NetworkProvisioningState. */ + /** + * Static value Canceled for L3NetworkProvisioningState. + */ public static final L3NetworkProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for L3NetworkProvisioningState. */ + /** + * Static value Provisioning for L3NetworkProvisioningState. + */ public static final L3NetworkProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for L3NetworkProvisioningState. */ + /** + * Static value Accepted for L3NetworkProvisioningState. + */ public static final L3NetworkProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of L3NetworkProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public L3NetworkProvisioningState() { /** * Creates or finds a L3NetworkProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding L3NetworkProvisioningState. */ - @JsonCreator public static L3NetworkProvisioningState fromString(String name) { return fromString(name, L3NetworkProvisioningState.class); } /** * Gets known L3NetworkProvisioningState values. - * + * * @return known L3NetworkProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java index 0b16ab745ad36..ecce21a1c73bc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of L3Networks. */ +/** + * Resource collection API of L3Networks. + */ public interface L3Networks { /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List layer 3 (L3) networks in the subscription. - * - *

Get a list of layer 3 (L3) networks in the provided subscription. - * + * + * Get a list of layer 3 (L3) networks in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List layer 3 (L3) networks in the resource group. - * - *

Get a list of layer 3 (L3) networks in the provided resource group. - * + * + * Get a list of layer 3 (L3) networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of layer 3 (L3) networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @param context The context to associate with this operation. @@ -82,9 +84,9 @@ public interface L3Networks { /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -96,36 +98,38 @@ public interface L3Networks { /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String l3NetworkName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String l3NetworkName); /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param l3NetworkName The name of the L3 network. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String l3NetworkName, Context context); + OperationStatusResult delete(String resourceGroupName, String l3NetworkName, Context context); /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,9 +140,9 @@ public interface L3Networks { /** * Retrieve the layer 3 (L3) network. - * - *

Get properties of the provided layer 3 (L3) network. - * + * + * Get properties of the provided layer 3 (L3) network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -150,32 +154,34 @@ public interface L3Networks { /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the layer 3 (L3) network. - * - *

Delete the provided layer 3 (L3) network. - * + * + * Delete the provided layer 3 (L3) network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new L3Network resource. - * + * * @param name resource name. * @return the first stage of the new L3Network definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java index c30a4a8ad01f9..fa92343353069 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java @@ -5,45 +5,47 @@ package com.azure.resourcemanager.networkcloud.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; /** * Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents the details about the device * connected to the NIC. */ @Immutable -public final class LldpNeighbor { +public final class LldpNeighbor implements JsonSerializable { /* * The descriptive information about the port on the connected device. */ - @JsonProperty(value = "portDescription", access = JsonProperty.Access.WRITE_ONLY) private String portDescription; /* * The system-assigned name of the port on the connected device. */ - @JsonProperty(value = "portName", access = JsonProperty.Access.WRITE_ONLY) private String portName; /* * The descriptive information about the connected device. */ - @JsonProperty(value = "systemDescription", access = JsonProperty.Access.WRITE_ONLY) private String systemDescription; /* * The system-assigned name of the connected device. */ - @JsonProperty(value = "systemName", access = JsonProperty.Access.WRITE_ONLY) private String systemName; - /** Creates an instance of LldpNeighbor class. */ + /** + * Creates an instance of LldpNeighbor class. + */ public LldpNeighbor() { } /** * Get the portDescription property: The descriptive information about the port on the connected device. - * + * * @return the portDescription value. */ public String portDescription() { @@ -52,7 +54,7 @@ public String portDescription() { /** * Get the portName property: The system-assigned name of the port on the connected device. - * + * * @return the portName value. */ public String portName() { @@ -61,7 +63,7 @@ public String portName() { /** * Get the systemDescription property: The descriptive information about the connected device. - * + * * @return the systemDescription value. */ public String systemDescription() { @@ -70,7 +72,7 @@ public String systemDescription() { /** * Get the systemName property: The system-assigned name of the connected device. - * + * * @return the systemName value. */ public String systemName() { @@ -79,9 +81,50 @@ public String systemName() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LldpNeighbor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LldpNeighbor 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 LldpNeighbor. + */ + public static LldpNeighbor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LldpNeighbor deserializedLldpNeighbor = new LldpNeighbor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("portDescription".equals(fieldName)) { + deserializedLldpNeighbor.portDescription = reader.getString(); + } else if ("portName".equals(fieldName)) { + deserializedLldpNeighbor.portName = reader.getString(); + } else if ("systemDescription".equals(fieldName)) { + deserializedLldpNeighbor.systemDescription = reader.getString(); + } else if ("systemName".equals(fieldName)) { + deserializedLldpNeighbor.systemName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLldpNeighbor; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java index 57bb0b0de1ebf..a4a2cfac81c4a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.networkcloud.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; -/** Disk represents the properties of the disk. */ +/** + * Disk represents the properties of the disk. + */ @Immutable -public final class MachineDisk { +public final class MachineDisk implements JsonSerializable { /* - * The maximum amount of storage in GB. + * The maximum amount of storage. Measured in gibibytes. */ - @JsonProperty(value = "capacityGB", access = JsonProperty.Access.WRITE_ONLY) private Long capacityGB; /* * The connection type of the rack SKU resource. */ - @JsonProperty(value = "connection", access = JsonProperty.Access.WRITE_ONLY) private MachineSkuDiskConnectionType connection; /* * The disk type of rack SKU resource. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private DiskType type; - /** Creates an instance of MachineDisk class. */ + /** + * Creates an instance of MachineDisk class. + */ public MachineDisk() { } /** - * Get the capacityGB property: The maximum amount of storage in GB. - * + * Get the capacityGB property: The maximum amount of storage. Measured in gibibytes. + * * @return the capacityGB value. */ public Long capacityGB() { @@ -43,7 +48,7 @@ public Long capacityGB() { /** * Get the connection property: The connection type of the rack SKU resource. - * + * * @return the connection value. */ public MachineSkuDiskConnectionType connection() { @@ -52,7 +57,7 @@ public MachineSkuDiskConnectionType connection() { /** * Get the type property: The disk type of rack SKU resource. - * + * * @return the type value. */ public DiskType type() { @@ -61,9 +66,48 @@ public DiskType type() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineDisk 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 MachineDisk. + */ + public static MachineDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineDisk deserializedMachineDisk = new MachineDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityGB".equals(fieldName)) { + deserializedMachineDisk.capacityGB = reader.getNullable(JsonReader::getLong); + } else if ("connection".equals(fieldName)) { + deserializedMachineDisk.connection = MachineSkuDiskConnectionType.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedMachineDisk.type = DiskType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineDisk; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java index 184b66ee0ccac..3b99b4548c360 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The connection type of the rack SKU resource. */ +/** + * The connection type of the rack SKU resource. + */ public final class MachineSkuDiskConnectionType extends ExpandableStringEnum { - /** Static value PCIE for MachineSkuDiskConnectionType. */ + /** + * Static value PCIE for MachineSkuDiskConnectionType. + */ public static final MachineSkuDiskConnectionType PCIE = fromString("PCIE"); - /** Static value SATA for MachineSkuDiskConnectionType. */ + /** + * Static value SATA for MachineSkuDiskConnectionType. + */ public static final MachineSkuDiskConnectionType SATA = fromString("SATA"); - /** Static value RAID for MachineSkuDiskConnectionType. */ + /** + * Static value RAID for MachineSkuDiskConnectionType. + */ public static final MachineSkuDiskConnectionType RAID = fromString("RAID"); - /** Static value SAS for MachineSkuDiskConnectionType. */ + /** + * Static value SAS for MachineSkuDiskConnectionType. + */ public static final MachineSkuDiskConnectionType SAS = fromString("SAS"); /** * Creates a new instance of MachineSkuDiskConnectionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MachineSkuDiskConnectionType() { /** * Creates or finds a MachineSkuDiskConnectionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MachineSkuDiskConnectionType. */ - @JsonCreator public static MachineSkuDiskConnectionType fromString(String name) { return fromString(name, MachineSkuDiskConnectionType.class); } /** * Gets known MachineSkuDiskConnectionType values. - * + * * @return known MachineSkuDiskConnectionType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java index b6bba5a0558bf..0fa357d6c36e0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java @@ -5,36 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.MachineSkuProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** MachineSkuSlot represents a single SKU and rack slot associated with the machine. */ +/** + * MachineSkuSlot represents a single SKU and rack slot associated with the machine. + */ @Immutable -public final class MachineSkuSlot { +public final class MachineSkuSlot implements JsonSerializable { /* - * MachineSkuProperties represents the properties of the machine SKU. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private MachineSkuProperties innerProperties; /* * The position in the rack for the machine. */ - @JsonProperty(value = "rackSlot", access = JsonProperty.Access.WRITE_ONLY) private Long rackSlot; - /** Creates an instance of MachineSkuSlot class. */ + /** + * Creates an instance of MachineSkuSlot class. + */ public MachineSkuSlot() { } /** - * Get the innerProperties property: MachineSkuProperties represents the properties of the machine SKU. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private MachineSkuProperties innerProperties() { @@ -43,7 +45,7 @@ private MachineSkuProperties innerProperties() { /** * Get the rackSlot property: The position in the rack for the machine. - * + * * @return the rackSlot value. */ public Long rackSlot() { @@ -52,7 +54,7 @@ public Long rackSlot() { /** * Get the bootstrapProtocol property: The type of bootstrap protocol used. - * + * * @return the bootstrapProtocol value. */ public BootstrapProtocol bootstrapProtocol() { @@ -61,7 +63,7 @@ public BootstrapProtocol bootstrapProtocol() { /** * Get the cpuCores property: The count of CPU cores for this machine. - * + * * @return the cpuCores value. */ public Long cpuCores() { @@ -70,7 +72,7 @@ public Long cpuCores() { /** * Get the cpuSockets property: The count of CPU sockets for this machine. - * + * * @return the cpuSockets value. */ public Long cpuSockets() { @@ -79,7 +81,7 @@ public Long cpuSockets() { /** * Get the disks property: The list of disks. - * + * * @return the disks value. */ public List disks() { @@ -88,7 +90,7 @@ public List disks() { /** * Get the generation property: The generation of the architecture. - * + * * @return the generation value. */ public String generation() { @@ -97,7 +99,7 @@ public String generation() { /** * Get the hardwareVersion property: The hardware version of the machine. - * + * * @return the hardwareVersion value. */ public String hardwareVersion() { @@ -105,8 +107,8 @@ public String hardwareVersion() { } /** - * Get the memoryCapacityGB property: The maximum amount of memory in GB. - * + * Get the memoryCapacityGB property: The maximum amount of memory. Measured in gibibytes. + * * @return the memoryCapacityGB value. */ public Long memoryCapacityGB() { @@ -115,7 +117,7 @@ public Long memoryCapacityGB() { /** * Get the model property: The model of the machine. - * + * * @return the model value. */ public String model() { @@ -124,7 +126,7 @@ public String model() { /** * Get the networkInterfaces property: The list of network interfaces. - * + * * @return the networkInterfaces value. */ public List networkInterfaces() { @@ -133,7 +135,7 @@ public List networkInterfaces() { /** * Get the totalThreads property: The count of SMT and physical core threads for this machine. - * + * * @return the totalThreads value. */ public Long totalThreads() { @@ -142,7 +144,7 @@ public Long totalThreads() { /** * Get the vendor property: The make of the machine. - * + * * @return the vendor value. */ public String vendor() { @@ -151,7 +153,7 @@ public String vendor() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -159,4 +161,42 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineSkuSlot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineSkuSlot 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 MachineSkuSlot. + */ + public static MachineSkuSlot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineSkuSlot deserializedMachineSkuSlot = new MachineSkuSlot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedMachineSkuSlot.innerProperties = MachineSkuProperties.fromJson(reader); + } else if ("rackSlot".equals(fieldName)) { + deserializedMachineSkuSlot.rackSlot = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineSkuSlot; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java index 96992c0873719..daff2b545a696 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.networkcloud.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; -/** ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. */ +/** + * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. + */ @Fluent -public final class ManagedResourceGroupConfiguration { +public final class ManagedResourceGroupConfiguration implements JsonSerializable { /* * The location of the managed resource group. If not specified, the location of the parent resource is chosen. */ - @JsonProperty(value = "location") private String location; /* * The name for the managed resource group. If not specified, the unique name is automatically generated. */ - @JsonProperty(value = "name") private String name; - /** Creates an instance of ManagedResourceGroupConfiguration class. */ + /** + * Creates an instance of ManagedResourceGroupConfiguration class. + */ public ManagedResourceGroupConfiguration() { } /** * Get the location property: The location of the managed resource group. If not specified, the location of the * parent resource is chosen. - * + * * @return the location value. */ public String location() { @@ -39,7 +45,7 @@ public String location() { /** * Set the location property: The location of the managed resource group. If not specified, the location of the * parent resource is chosen. - * + * * @param location the location value to set. * @return the ManagedResourceGroupConfiguration object itself. */ @@ -51,7 +57,7 @@ public ManagedResourceGroupConfiguration withLocation(String location) { /** * Get the name property: The name for the managed resource group. If not specified, the unique name is * automatically generated. - * + * * @return the name value. */ public String name() { @@ -61,7 +67,7 @@ public String name() { /** * Set the name property: The name for the managed resource group. If not specified, the unique name is * automatically generated. - * + * * @param name the name value to set. * @return the ManagedResourceGroupConfiguration object itself. */ @@ -72,9 +78,49 @@ public ManagedResourceGroupConfiguration withName(String name) { /** * 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("location", this.location); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedResourceGroupConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedResourceGroupConfiguration 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 ManagedResourceGroupConfiguration. + */ + public static ManagedResourceGroupConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedResourceGroupConfiguration deserializedManagedResourceGroupConfiguration + = new ManagedResourceGroupConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.location = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedResourceGroupConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentity.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..fd486044d5175 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + 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 ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentitySelectorType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentitySelectorType.java new file mode 100644 index 0000000000000..19bdd386552d6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentitySelectorType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of managed identity that is being selected. + */ +public final class ManagedServiceIdentitySelectorType extends ExpandableStringEnum { + /** + * Static value SystemAssignedIdentity for ManagedServiceIdentitySelectorType. + */ + public static final ManagedServiceIdentitySelectorType SYSTEM_ASSIGNED_IDENTITY + = fromString("SystemAssignedIdentity"); + + /** + * Static value UserAssignedIdentity for ManagedServiceIdentitySelectorType. + */ + public static final ManagedServiceIdentitySelectorType USER_ASSIGNED_IDENTITY = fromString("UserAssignedIdentity"); + + /** + * Creates a new instance of ManagedServiceIdentitySelectorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentitySelectorType() { + } + + /** + * Creates or finds a ManagedServiceIdentitySelectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentitySelectorType. + */ + public static ManagedServiceIdentitySelectorType fromString(String name) { + return fromString(name, ManagedServiceIdentitySelectorType.class); + } + + /** + * Gets known ManagedServiceIdentitySelectorType values. + * + * @return known ManagedServiceIdentitySelectorType values. + */ + public static Collection values() { + return values(ManagedServiceIdentitySelectorType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentityType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..0af751383fb49 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java index 18b5746467d97..5310097e95072 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java @@ -8,45 +8,47 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of MetricsConfigurations. */ +/** + * Resource collection API of MetricsConfigurations. + */ public interface MetricsConfigurations { /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the 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 a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName); /** * List metrics configurations of the cluster. - * - *

Get a list of metrics configurations for the provided cluster. - * + * + * Get a list of metrics configurations for the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metrics configurations for the provided cluster as paginated response with {@link - * PagedIterable}. + * @return a list of metrics configurations for the provided cluster as paginated response with + * {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -61,9 +63,9 @@ Response getWithResponse(String resourceGroupName, /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -76,23 +78,24 @@ Response getWithResponse(String resourceGroupName, /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the 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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String metricsConfigurationName); + OperationStatusResult delete(String resourceGroupName, String clusterName, String metricsConfigurationName); /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param metricsConfigurationName The name of the metrics configuration for the cluster. @@ -100,14 +103,16 @@ Response getWithResponse(String resourceGroupName, * @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 current status of an async operation. */ - void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + OperationStatusResult delete(String resourceGroupName, String clusterName, String metricsConfigurationName, + Context context); /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,9 +123,9 @@ Response getWithResponse(String resourceGroupName, /** * Retrieve the metrics configuration of the cluster. - * - *

Get metrics configuration of the provided cluster. - * + * + * Get metrics configuration of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -132,32 +137,34 @@ Response getWithResponse(String resourceGroupName, /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the metrics configuration of the cluster. - * - *

Delete the metrics configuration of the provided cluster. - * + * + * Delete the metrics configuration of the provided cluster. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new ClusterMetricsConfiguration resource. - * + * * @param name resource name. * @return the first stage of the new ClusterMetricsConfiguration definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java index b127733374edf..8184d2325dd06 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java @@ -6,16 +6,21 @@ 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; -/** NetworkAttachment represents the single network attachment. */ +/** + * NetworkAttachment represents the single network attachment. + */ @Fluent -public final class NetworkAttachment { +public final class NetworkAttachment implements JsonSerializable { /* * The resource ID of the associated network attached to the virtual machine. * It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. */ - @JsonProperty(value = "attachedNetworkId", required = true) private String attachedNetworkId; /* @@ -23,7 +28,6 @@ public final class NetworkAttachment { * Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be * specified as True. */ - @JsonProperty(value = "defaultGateway") private DefaultGateway defaultGateway; /* @@ -31,14 +35,13 @@ public final class NetworkAttachment { * Dynamic and Static are only valid for l3Network which may also specify Disabled. * Otherwise, Disabled is the only permitted value. */ - @JsonProperty(value = "ipAllocationMethod", required = true) private VirtualMachineIpAllocationMethod ipAllocationMethod; /* * The IPv4 address of the virtual machine. - * + * * This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - * + * * If IPAllocationMethod is: * Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached * network. @@ -46,27 +49,24 @@ public final class NetworkAttachment { * attached network. * Disabled - this field will be empty. */ - @JsonProperty(value = "ipv4Address") private String ipv4Address; /* * The IPv6 address of the virtual machine. - * + * * This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - * + * * If IPAllocationMethod is: * Static - this field must contain an IPv6 address range from within the range specified in the attached network. * Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the * attached network. * Disabled - this field will be empty. */ - @JsonProperty(value = "ipv6Address") private String ipv6Address; /* * The MAC address of the interface for the virtual machine that corresponds to this network attachment. */ - @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) private String macAddress; /* @@ -76,17 +76,18 @@ public final class NetworkAttachment { * If the user doesn’t specify this value, the default interface name of the network resource will be used. * For a CloudServicesNetwork resource, this name will be ignored. */ - @JsonProperty(value = "networkAttachmentName") private String networkAttachmentName; - /** Creates an instance of NetworkAttachment class. */ + /** + * Creates an instance of NetworkAttachment class. + */ public NetworkAttachment() { } /** - * Get the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. It - * can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - * + * Get the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. + * It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + * * @return the attachedNetworkId value. */ public String attachedNetworkId() { @@ -94,9 +95,9 @@ public String attachedNetworkId() { } /** - * Set the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. It - * can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - * + * Set the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. + * It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + * * @param attachedNetworkId the attachedNetworkId value to set. * @return the NetworkAttachment object itself. */ @@ -106,9 +107,10 @@ public NetworkAttachment withAttachedNetworkId(String attachedNetworkId) { } /** - * Get the defaultGateway property: The indicator of whether this is the default gateway. Only one of the attached - * networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. - * + * Get the defaultGateway property: The indicator of whether this is the default gateway. + * Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be + * specified as True. + * * @return the defaultGateway value. */ public DefaultGateway defaultGateway() { @@ -116,9 +118,10 @@ public DefaultGateway defaultGateway() { } /** - * Set the defaultGateway property: The indicator of whether this is the default gateway. Only one of the attached - * networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. - * + * Set the defaultGateway property: The indicator of whether this is the default gateway. + * Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be + * specified as True. + * * @param defaultGateway the defaultGateway value to set. * @return the NetworkAttachment object itself. */ @@ -128,9 +131,10 @@ public NetworkAttachment withDefaultGateway(DefaultGateway defaultGateway) { } /** - * Get the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. Dynamic and Static are - * only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. - * + * Get the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. + * Dynamic and Static are only valid for l3Network which may also specify Disabled. + * Otherwise, Disabled is the only permitted value. + * * @return the ipAllocationMethod value. */ public VirtualMachineIpAllocationMethod ipAllocationMethod() { @@ -138,9 +142,10 @@ public VirtualMachineIpAllocationMethod ipAllocationMethod() { } /** - * Set the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. Dynamic and Static are - * only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. - * + * Set the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. + * Dynamic and Static are only valid for l3Network which may also specify Disabled. + * Otherwise, Disabled is the only permitted value. + * * @param ipAllocationMethod the ipAllocationMethod value to set. * @return the NetworkAttachment object itself. */ @@ -151,13 +156,16 @@ public NetworkAttachment withIpAllocationMethod(VirtualMachineIpAllocationMethod /** * Get the ipv4Address property: The IPv4 address of the virtual machine. - * - *

This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - * - *

If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the - * subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an - * address from within the subnet specified in the attached network. Disabled - this field will be empty. - * + * + * This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached + * network. + * Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + * * @return the ipv4Address value. */ public String ipv4Address() { @@ -166,13 +174,16 @@ public String ipv4Address() { /** * Set the ipv4Address property: The IPv4 address of the virtual machine. - * - *

This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - * - *

If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the - * subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an - * address from within the subnet specified in the attached network. Disabled - this field will be empty. - * + * + * This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached + * network. + * Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + * * @param ipv4Address the ipv4Address value to set. * @return the NetworkAttachment object itself. */ @@ -183,13 +194,15 @@ public NetworkAttachment withIpv4Address(String ipv4Address) { /** * Get the ipv6Address property: The IPv6 address of the virtual machine. - * - *

This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - * - *

If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range - * specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from - * within the subnet specified in the attached network. Disabled - this field will be empty. - * + * + * This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain an IPv6 address range from within the range specified in the attached network. + * Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + * * @return the ipv6Address value. */ public String ipv6Address() { @@ -198,13 +211,15 @@ public String ipv6Address() { /** * Set the ipv6Address property: The IPv6 address of the virtual machine. - * - *

This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - * - *

If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range - * specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from - * within the subnet specified in the attached network. Disabled - this field will be empty. - * + * + * This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain an IPv6 address range from within the range specified in the attached network. + * Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + * * @param ipv6Address the ipv6Address value to set. * @return the NetworkAttachment object itself. */ @@ -216,7 +231,7 @@ public NetworkAttachment withIpv6Address(String ipv6Address) { /** * Get the macAddress property: The MAC address of the interface for the virtual machine that corresponds to this * network attachment. - * + * * @return the macAddress value. */ public String macAddress() { @@ -224,11 +239,12 @@ public String macAddress() { } /** - * Get the networkAttachmentName property: The associated network's interface name. If specified, the network - * attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user - * doesn’t specify this value, the default interface name of the network resource will be used. For a - * CloudServicesNetwork resource, this name will be ignored. - * + * Get the networkAttachmentName property: The associated network's interface name. + * If specified, the network attachment name has a maximum length of 15 characters and must be unique to this + * virtual machine. + * If the user doesn’t specify this value, the default interface name of the network resource will be used. + * For a CloudServicesNetwork resource, this name will be ignored. + * * @return the networkAttachmentName value. */ public String networkAttachmentName() { @@ -236,11 +252,12 @@ public String networkAttachmentName() { } /** - * Set the networkAttachmentName property: The associated network's interface name. If specified, the network - * attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user - * doesn’t specify this value, the default interface name of the network resource will be used. For a - * CloudServicesNetwork resource, this name will be ignored. - * + * Set the networkAttachmentName property: The associated network's interface name. + * If specified, the network attachment name has a maximum length of 15 characters and must be unique to this + * virtual machine. + * If the user doesn’t specify this value, the default interface name of the network resource will be used. + * For a CloudServicesNetwork resource, this name will be ignored. + * * @param networkAttachmentName the networkAttachmentName value to set. * @return the NetworkAttachment object itself. */ @@ -251,19 +268,78 @@ public NetworkAttachment withNetworkAttachmentName(String networkAttachmentName) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (attachedNetworkId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property attachedNetworkId in model NetworkAttachment")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property attachedNetworkId in model NetworkAttachment")); } if (ipAllocationMethod() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property ipAllocationMethod in model NetworkAttachment")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipAllocationMethod in model NetworkAttachment")); } } private static final ClientLogger LOGGER = new ClientLogger(NetworkAttachment.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attachedNetworkId", this.attachedNetworkId); + jsonWriter.writeStringField("ipAllocationMethod", + this.ipAllocationMethod == null ? null : this.ipAllocationMethod.toString()); + jsonWriter.writeStringField("defaultGateway", + this.defaultGateway == null ? null : this.defaultGateway.toString()); + jsonWriter.writeStringField("ipv4Address", this.ipv4Address); + jsonWriter.writeStringField("ipv6Address", this.ipv6Address); + jsonWriter.writeStringField("networkAttachmentName", this.networkAttachmentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkAttachment 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 NetworkAttachment. + */ + public static NetworkAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkAttachment deserializedNetworkAttachment = new NetworkAttachment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attachedNetworkId".equals(fieldName)) { + deserializedNetworkAttachment.attachedNetworkId = reader.getString(); + } else if ("ipAllocationMethod".equals(fieldName)) { + deserializedNetworkAttachment.ipAllocationMethod + = VirtualMachineIpAllocationMethod.fromString(reader.getString()); + } else if ("defaultGateway".equals(fieldName)) { + deserializedNetworkAttachment.defaultGateway = DefaultGateway.fromString(reader.getString()); + } else if ("ipv4Address".equals(fieldName)) { + deserializedNetworkAttachment.ipv4Address = reader.getString(); + } else if ("ipv6Address".equals(fieldName)) { + deserializedNetworkAttachment.ipv6Address = reader.getString(); + } else if ("macAddress".equals(fieldName)) { + deserializedNetworkAttachment.macAddress = reader.getString(); + } else if ("networkAttachmentName".equals(fieldName)) { + deserializedNetworkAttachment.networkAttachmentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkAttachment; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkConfiguration.java index bf795ceef4071..d13e0443f66fd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkConfiguration.java @@ -6,73 +6,74 @@ 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; -/** NetworkConfiguration specifies the Kubernetes cluster network related configuration. */ +/** + * NetworkConfiguration specifies the Kubernetes cluster network related configuration. + */ @Fluent -public final class NetworkConfiguration { +public final class NetworkConfiguration implements JsonSerializable { /* - * AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - * * The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes * cluster. */ - @JsonProperty(value = "attachedNetworkConfiguration") private AttachedNetworkConfiguration attachedNetworkConfiguration; /* - * BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - * - * The configuration of the BGP service load balancer for this Kubernetes cluster. + * The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load + * balancer may be specified, either Layer 2 or BGP. */ - @JsonProperty(value = "bgpServiceLoadBalancerConfiguration") private BgpServiceLoadBalancerConfiguration bgpServiceLoadBalancerConfiguration; /* * The resource ID of the associated Cloud Services network. */ - @JsonProperty(value = "cloudServicesNetworkId", required = true) private String cloudServicesNetworkId; /* * The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. */ - @JsonProperty(value = "cniNetworkId", required = true) private String cniNetworkId; /* * The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range * specified in service CIDR. */ - @JsonProperty(value = "dnsServiceIp") private String dnsServiceIp; + /* + * The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load + * balancer may be specified, either Layer 2 or BGP. + */ + private L2ServiceLoadBalancerConfiguration l2ServiceLoadBalancerConfiguration; + /* * The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. * Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. */ - @JsonProperty(value = "podCidrs") private List podCidrs; /* * The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack * networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. */ - @JsonProperty(value = "serviceCidrs") private List serviceCidrs; - /** Creates an instance of NetworkConfiguration class. */ + /** + * Creates an instance of NetworkConfiguration class. + */ public NetworkConfiguration() { } /** - * Get the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the cluster for use by the workloads that run on this - * Kubernetes cluster. - * + * Get the attachedNetworkConfiguration property: The configuration of networks being attached to the cluster for + * use by the workloads that run on this Kubernetes cluster. + * * @return the attachedNetworkConfiguration value. */ public AttachedNetworkConfiguration attachedNetworkConfiguration() { @@ -80,12 +81,9 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { } /** - * Set the attachedNetworkConfiguration property: AttachedNetworkConfiguration represents the set of workload - * networks to attach to a resource. - * - *

The configuration of networks being attached to the cluster for use by the workloads that run on this - * Kubernetes cluster. - * + * Set the attachedNetworkConfiguration property: The configuration of networks being attached to the cluster for + * use by the workloads that run on this Kubernetes cluster. + * * @param attachedNetworkConfiguration the attachedNetworkConfiguration value to set. * @return the NetworkConfiguration object itself. */ @@ -96,11 +94,9 @@ public AttachedNetworkConfiguration attachedNetworkConfiguration() { } /** - * Get the bgpServiceLoadBalancerConfiguration property: BgpServiceLoadBalancerConfiguration represents the - * configuration of a BGP service load balancer. - * - *

The configuration of the BGP service load balancer for this Kubernetes cluster. - * + * Get the bgpServiceLoadBalancerConfiguration property: The configuration of the BGP service load balancer for this + * Kubernetes cluster. A maximum of one service load balancer may be specified, either Layer 2 or BGP. + * * @return the bgpServiceLoadBalancerConfiguration value. */ public BgpServiceLoadBalancerConfiguration bgpServiceLoadBalancerConfiguration() { @@ -108,11 +104,9 @@ public BgpServiceLoadBalancerConfiguration bgpServiceLoadBalancerConfiguration() } /** - * Set the bgpServiceLoadBalancerConfiguration property: BgpServiceLoadBalancerConfiguration represents the - * configuration of a BGP service load balancer. - * - *

The configuration of the BGP service load balancer for this Kubernetes cluster. - * + * Set the bgpServiceLoadBalancerConfiguration property: The configuration of the BGP service load balancer for this + * Kubernetes cluster. A maximum of one service load balancer may be specified, either Layer 2 or BGP. + * * @param bgpServiceLoadBalancerConfiguration the bgpServiceLoadBalancerConfiguration value to set. * @return the NetworkConfiguration object itself. */ @@ -124,7 +118,7 @@ public NetworkConfiguration withBgpServiceLoadBalancerConfiguration( /** * Get the cloudServicesNetworkId property: The resource ID of the associated Cloud Services network. - * + * * @return the cloudServicesNetworkId value. */ public String cloudServicesNetworkId() { @@ -133,7 +127,7 @@ public String cloudServicesNetworkId() { /** * Set the cloudServicesNetworkId property: The resource ID of the associated Cloud Services network. - * + * * @param cloudServicesNetworkId the cloudServicesNetworkId value to set. * @return the NetworkConfiguration object itself. */ @@ -145,7 +139,7 @@ public NetworkConfiguration withCloudServicesNetworkId(String cloudServicesNetwo /** * Get the cniNetworkId property: The resource ID of the Layer 3 network that is used for creation of the Container * Networking Interface network. - * + * * @return the cniNetworkId value. */ public String cniNetworkId() { @@ -155,7 +149,7 @@ public String cniNetworkId() { /** * Set the cniNetworkId property: The resource ID of the Layer 3 network that is used for creation of the Container * Networking Interface network. - * + * * @param cniNetworkId the cniNetworkId value to set. * @return the NetworkConfiguration object itself. */ @@ -167,7 +161,7 @@ public NetworkConfiguration withCniNetworkId(String cniNetworkId) { /** * Get the dnsServiceIp property: The IP address assigned to the Kubernetes DNS service. It must be within the * Kubernetes service address range specified in service CIDR. - * + * * @return the dnsServiceIp value. */ public String dnsServiceIp() { @@ -177,7 +171,7 @@ public String dnsServiceIp() { /** * Set the dnsServiceIp property: The IP address assigned to the Kubernetes DNS service. It must be within the * Kubernetes service address range specified in service CIDR. - * + * * @param dnsServiceIp the dnsServiceIp value to set. * @return the NetworkConfiguration object itself. */ @@ -186,11 +180,34 @@ public NetworkConfiguration withDnsServiceIp(String dnsServiceIp) { return this; } + /** + * Get the l2ServiceLoadBalancerConfiguration property: The configuration of the Layer 2 service load balancer for + * this Kubernetes cluster. A maximum of one service load balancer may be specified, either Layer 2 or BGP. + * + * @return the l2ServiceLoadBalancerConfiguration value. + */ + public L2ServiceLoadBalancerConfiguration l2ServiceLoadBalancerConfiguration() { + return this.l2ServiceLoadBalancerConfiguration; + } + + /** + * Set the l2ServiceLoadBalancerConfiguration property: The configuration of the Layer 2 service load balancer for + * this Kubernetes cluster. A maximum of one service load balancer may be specified, either Layer 2 or BGP. + * + * @param l2ServiceLoadBalancerConfiguration the l2ServiceLoadBalancerConfiguration value to set. + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration + withL2ServiceLoadBalancerConfiguration(L2ServiceLoadBalancerConfiguration l2ServiceLoadBalancerConfiguration) { + this.l2ServiceLoadBalancerConfiguration = l2ServiceLoadBalancerConfiguration; + return this; + } + /** * Get the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack * networking. - * + * * @return the podCidrs value. */ public List podCidrs() { @@ -201,7 +218,7 @@ public List podCidrs() { * Set the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack * networking. - * + * * @param podCidrs the podCidrs value to set. * @return the NetworkConfiguration object itself. */ @@ -214,7 +231,7 @@ public NetworkConfiguration withPodCidrs(List podCidrs) { * Get the serviceCidrs property: The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is * expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack * networking. - * + * * @return the serviceCidrs value. */ public List serviceCidrs() { @@ -225,7 +242,7 @@ public List serviceCidrs() { * Set the serviceCidrs property: The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is * expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack * networking. - * + * * @param serviceCidrs the serviceCidrs value to set. * @return the NetworkConfiguration object itself. */ @@ -236,7 +253,7 @@ public NetworkConfiguration withServiceCidrs(List serviceCidrs) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -247,14 +264,82 @@ public void validate() { bgpServiceLoadBalancerConfiguration().validate(); } if (cloudServicesNetworkId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property cloudServicesNetworkId in model NetworkConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cloudServicesNetworkId in model NetworkConfiguration")); } if (cniNetworkId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property cniNetworkId in model NetworkConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cniNetworkId in model NetworkConfiguration")); + } + if (l2ServiceLoadBalancerConfiguration() != null) { + l2ServiceLoadBalancerConfiguration().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(NetworkConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudServicesNetworkId", this.cloudServicesNetworkId); + jsonWriter.writeStringField("cniNetworkId", this.cniNetworkId); + jsonWriter.writeJsonField("attachedNetworkConfiguration", this.attachedNetworkConfiguration); + jsonWriter.writeJsonField("bgpServiceLoadBalancerConfiguration", this.bgpServiceLoadBalancerConfiguration); + jsonWriter.writeStringField("dnsServiceIp", this.dnsServiceIp); + jsonWriter.writeJsonField("l2ServiceLoadBalancerConfiguration", this.l2ServiceLoadBalancerConfiguration); + jsonWriter.writeArrayField("podCidrs", this.podCidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("serviceCidrs", this.serviceCidrs, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfiguration 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 NetworkConfiguration. + */ + public static NetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfiguration deserializedNetworkConfiguration = new NetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudServicesNetworkId".equals(fieldName)) { + deserializedNetworkConfiguration.cloudServicesNetworkId = reader.getString(); + } else if ("cniNetworkId".equals(fieldName)) { + deserializedNetworkConfiguration.cniNetworkId = reader.getString(); + } else if ("attachedNetworkConfiguration".equals(fieldName)) { + deserializedNetworkConfiguration.attachedNetworkConfiguration + = AttachedNetworkConfiguration.fromJson(reader); + } else if ("bgpServiceLoadBalancerConfiguration".equals(fieldName)) { + deserializedNetworkConfiguration.bgpServiceLoadBalancerConfiguration + = BgpServiceLoadBalancerConfiguration.fromJson(reader); + } else if ("dnsServiceIp".equals(fieldName)) { + deserializedNetworkConfiguration.dnsServiceIp = reader.getString(); + } else if ("l2ServiceLoadBalancerConfiguration".equals(fieldName)) { + deserializedNetworkConfiguration.l2ServiceLoadBalancerConfiguration + = L2ServiceLoadBalancerConfiguration.fromJson(reader); + } else if ("podCidrs".equals(fieldName)) { + List podCidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkConfiguration.podCidrs = podCidrs; + } else if ("serviceCidrs".equals(fieldName)) { + List serviceCidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkConfiguration.serviceCidrs = serviceCidrs; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java index fd75e0077f2ff..228606234d535 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** NetworkInterface represents properties of the network interface. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * NetworkInterface represents properties of the network interface. + */ @Immutable -public final class NetworkInterface { +public final class NetworkInterface implements JsonSerializable { /* * The partial address of Peripheral Component Interconnect (PCI). */ - @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) private String address; /* * The connection type of the device. */ - @JsonProperty(value = "deviceConnectionType", access = JsonProperty.Access.WRITE_ONLY) private DeviceConnectionType deviceConnectionType; /* * The model name of the device. */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) private String model; /* * The physical slot for this device. */ - @JsonProperty(value = "physicalSlot", access = JsonProperty.Access.WRITE_ONLY) private Long physicalSlot; /* * The number of ports on the device. */ - @JsonProperty(value = "portCount", access = JsonProperty.Access.WRITE_ONLY) private Long portCount; /* - * The maximum amount of data in GB that the line card transmits through a port at any given second. + * The maximum amount of data in gigabits that the line card transmits through a port at any given second. */ - @JsonProperty(value = "portSpeed", access = JsonProperty.Access.WRITE_ONLY) private Long portSpeed; /* * The vendor name of the device. */ - @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) private String vendor; - /** Creates an instance of NetworkInterface class. */ + /** + * Creates an instance of NetworkInterface class. + */ public NetworkInterface() { } /** * Get the address property: The partial address of Peripheral Component Interconnect (PCI). - * + * * @return the address value. */ public String address() { @@ -67,7 +68,7 @@ public String address() { /** * Get the deviceConnectionType property: The connection type of the device. - * + * * @return the deviceConnectionType value. */ public DeviceConnectionType deviceConnectionType() { @@ -76,7 +77,7 @@ public DeviceConnectionType deviceConnectionType() { /** * Get the model property: The model name of the device. - * + * * @return the model value. */ public String model() { @@ -85,7 +86,7 @@ public String model() { /** * Get the physicalSlot property: The physical slot for this device. - * + * * @return the physicalSlot value. */ public Long physicalSlot() { @@ -94,7 +95,7 @@ public Long physicalSlot() { /** * Get the portCount property: The number of ports on the device. - * + * * @return the portCount value. */ public Long portCount() { @@ -102,9 +103,9 @@ public Long portCount() { } /** - * Get the portSpeed property: The maximum amount of data in GB that the line card transmits through a port at any - * given second. - * + * Get the portSpeed property: The maximum amount of data in gigabits that the line card transmits through a port at + * any given second. + * * @return the portSpeed value. */ public Long portSpeed() { @@ -113,7 +114,7 @@ public Long portSpeed() { /** * Get the vendor property: The vendor name of the device. - * + * * @return the vendor value. */ public String vendor() { @@ -122,9 +123,57 @@ public String vendor() { /** * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterface 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 NetworkInterface. + */ + public static NetworkInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterface deserializedNetworkInterface = new NetworkInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedNetworkInterface.address = reader.getString(); + } else if ("deviceConnectionType".equals(fieldName)) { + deserializedNetworkInterface.deviceConnectionType + = DeviceConnectionType.fromString(reader.getString()); + } else if ("model".equals(fieldName)) { + deserializedNetworkInterface.model = reader.getString(); + } else if ("physicalSlot".equals(fieldName)) { + deserializedNetworkInterface.physicalSlot = reader.getNullable(JsonReader::getLong); + } else if ("portCount".equals(fieldName)) { + deserializedNetworkInterface.portCount = reader.getNullable(JsonReader::getLong); + } else if ("portSpeed".equals(fieldName)) { + deserializedNetworkInterface.portSpeed = reader.getNullable(JsonReader::getLong); + } else if ("vendor".equals(fieldName)) { + deserializedNetworkInterface.vendor = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterface; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java index e1ffb72901fed..c774de37610a9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.networkcloud.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; -/** Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. */ +/** + * Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + */ @Immutable -public final class Nic { +public final class Nic implements JsonSerializable { /* - * Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents the details about the device - * connected to the NIC. - * * The information about the device connected to this NIC. */ - @JsonProperty(value = "lldpNeighbor", access = JsonProperty.Access.WRITE_ONLY) private LldpNeighbor lldpNeighbor; /* * The MAC address associated with this NIC. */ - @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) private String macAddress; /* * The name of the NIC/interface. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; - /** Creates an instance of Nic class. */ + /** + * Creates an instance of Nic class. + */ public Nic() { } /** - * Get the lldpNeighbor property: Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents - * the details about the device connected to the NIC. - * - *

The information about the device connected to this NIC. - * + * Get the lldpNeighbor property: The information about the device connected to this NIC. + * * @return the lldpNeighbor value. */ public LldpNeighbor lldpNeighbor() { @@ -49,7 +48,7 @@ public LldpNeighbor lldpNeighbor() { /** * Get the macAddress property: The MAC address associated with this NIC. - * + * * @return the macAddress value. */ public String macAddress() { @@ -58,7 +57,7 @@ public String macAddress() { /** * Get the name property: The name of the NIC/interface. - * + * * @return the name value. */ public String name() { @@ -67,7 +66,7 @@ public String name() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -75,4 +74,43 @@ public void validate() { lldpNeighbor().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Nic from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Nic 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 Nic. + */ + public static Nic fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Nic deserializedNic = new Nic(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lldpNeighbor".equals(fieldName)) { + deserializedNic.lldpNeighbor = LldpNeighbor.fromJson(reader); + } else if ("macAddress".equals(fieldName)) { + deserializedNic.macAddress = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNic.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNic; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodePoolAdministratorConfigurationPatch.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodePoolAdministratorConfigurationPatch.java new file mode 100644 index 0000000000000..2f1d5d223058a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodePoolAdministratorConfigurationPatch.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + */ +@Fluent +public final class NodePoolAdministratorConfigurationPatch + implements JsonSerializable { + /* + * SshPublicKey represents the public key used to authenticate with a resource through SSH. + */ + private List sshPublicKeys; + + /** + * Creates an instance of NodePoolAdministratorConfigurationPatch class. + */ + public NodePoolAdministratorConfigurationPatch() { + } + + /** + * Get the sshPublicKeys property: SshPublicKey represents the public key used to authenticate with a resource + * through SSH. + * + * @return the sshPublicKeys value. + */ + public List sshPublicKeys() { + return this.sshPublicKeys; + } + + /** + * Set the sshPublicKeys property: SshPublicKey represents the public key used to authenticate with a resource + * through SSH. + * + * @param sshPublicKeys the sshPublicKeys value to set. + * @return the NodePoolAdministratorConfigurationPatch object itself. + */ + public NodePoolAdministratorConfigurationPatch withSshPublicKeys(List sshPublicKeys) { + this.sshPublicKeys = sshPublicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshPublicKeys() != null) { + sshPublicKeys().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sshPublicKeys", this.sshPublicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodePoolAdministratorConfigurationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodePoolAdministratorConfigurationPatch 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 NodePoolAdministratorConfigurationPatch. + */ + public static NodePoolAdministratorConfigurationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodePoolAdministratorConfigurationPatch deserializedNodePoolAdministratorConfigurationPatch + = new NodePoolAdministratorConfigurationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPublicKeys".equals(fieldName)) { + List sshPublicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedNodePoolAdministratorConfigurationPatch.sshPublicKeys = sshPublicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedNodePoolAdministratorConfigurationPatch; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java index a8094260521c4..ea71ec7e377e2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java index 570f1e40a76d1..c7493a7208d17 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.networkcloud.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. */ +/** + * 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; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,9 +87,50 @@ public String description() { /** * 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(); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java index ec41868b62e51..c076af51730bd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,26 +18,26 @@ * 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; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +46,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +55,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -59,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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationStatusResult.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationStatusResult.java index 0fe35dce0e50b..a472942dbff35 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationStatusResult.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationStatusResult.java @@ -9,75 +9,107 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of OperationStatusResult. */ +/** + * An immutable client-side representation of OperationStatusResult. + */ public interface OperationStatusResult { /** - * Gets the id property: Fully qualified ID for the async operation. - * - * @return the id value. + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. */ - String id(); + OffsetDateTime endTime(); /** - * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. + * Gets the error property: If present, details of the operation error. + * + * @return the error value. */ - String resourceId(); + ManagementError error(); + + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); /** * Gets the name property: Name of the async operation. - * + * * @return the name value. */ String name(); /** - * Gets the status property: Operation status. - * - * @return the status value. + * Gets the operations property: The operations list. + * + * @return the operations value. */ - String status(); + List operations(); /** * Gets the percentComplete property: Percent of the operation that is complete. - * + * * @return the percentComplete value. */ Float percentComplete(); + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + /** * Gets the startTime property: The start time of the operation. - * + * * @return the startTime value. */ OffsetDateTime startTime(); /** - * Gets the endTime property: The end time of the operation. - * - * @return the endTime value. + * Gets the status property: Operation status. + * + * @return the status value. */ - OffsetDateTime endTime(); + String status(); /** - * Gets the operations property: The operations list. - * - * @return the operations value. + * Gets the exitCode property: For actions that run commands or scripts, the exit code of the script execution. + * + * @return the exitCode value. */ - List operations(); + String exitCode(); /** - * Gets the error property: If present, details of the operation error. - * - * @return the error value. + * Gets the outputHead property: For actions that run commands or scripts, the leading bytes of the output of the + * script execution. + * + * @return the outputHead value. */ - ManagementError error(); + String outputHead(); + + /** + * Gets the resultRef property: For actions that run commands or scripts, a reference to the location of the result. + * + * @return the resultRef value. + */ + String resultRef(); + + /** + * Gets the resultUrl property: For actions that run commands or scripts, the URL where the full output of the + * script output can be retrieved. + * + * @return the resultUrl value. + */ + String resultUrl(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner object. - * + * * @return the inner object. */ OperationStatusResultInner innerModel(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java index 236d3e6af3151..74ee3123f93ae 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java @@ -7,14 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of all available resource provider operations as paginated response with {@link PagedIterable}. @@ -23,10 +24,9 @@ public interface Operations { /** * List resource provider operations. - * - *

Get a list of all available resource provider operations. It contains a URL link to get the next set of - * results. - * + * + * Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * * @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. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java index 454b563ddda38..42e86dd4d3f72 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java index a7131360ea556..fa2060db1e560 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.networkcloud.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; -/** OsDisk represents configuration of the boot disk. */ +/** + * OsDisk represents configuration of the boot disk. + */ @Fluent -public final class OsDisk { +public final class OsDisk implements JsonSerializable { /* * The strategy for creating the OS disk. */ - @JsonProperty(value = "createOption") private OsDiskCreateOption createOption; /* * The strategy for deleting the OS disk. */ - @JsonProperty(value = "deleteOption") private OsDiskDeleteOption deleteOption; /* - * The size of the disk in gigabytes. Required if the createOption is Ephemeral. + * The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. */ - @JsonProperty(value = "diskSizeGB", required = true) private long diskSizeGB; - /** Creates an instance of OsDisk class. */ + /** + * Creates an instance of OsDisk class. + */ public OsDisk() { } /** * Get the createOption property: The strategy for creating the OS disk. - * + * * @return the createOption value. */ public OsDiskCreateOption createOption() { @@ -43,7 +48,7 @@ public OsDiskCreateOption createOption() { /** * Set the createOption property: The strategy for creating the OS disk. - * + * * @param createOption the createOption value to set. * @return the OsDisk object itself. */ @@ -54,7 +59,7 @@ public OsDisk withCreateOption(OsDiskCreateOption createOption) { /** * Get the deleteOption property: The strategy for deleting the OS disk. - * + * * @return the deleteOption value. */ public OsDiskDeleteOption deleteOption() { @@ -63,7 +68,7 @@ public OsDiskDeleteOption deleteOption() { /** * Set the deleteOption property: The strategy for deleting the OS disk. - * + * * @param deleteOption the deleteOption value to set. * @return the OsDisk object itself. */ @@ -73,8 +78,9 @@ public OsDisk withDeleteOption(OsDiskDeleteOption deleteOption) { } /** - * Get the diskSizeGB property: The size of the disk in gigabytes. Required if the createOption is Ephemeral. - * + * Get the diskSizeGB property: The size of the disk. Required if the createOption is Ephemeral. Allocations are + * measured in gibibytes. + * * @return the diskSizeGB value. */ public long diskSizeGB() { @@ -82,8 +88,9 @@ public long diskSizeGB() { } /** - * Set the diskSizeGB property: The size of the disk in gigabytes. Required if the createOption is Ephemeral. - * + * Set the diskSizeGB property: The size of the disk. Required if the createOption is Ephemeral. Allocations are + * measured in gibibytes. + * * @param diskSizeGB the diskSizeGB value to set. * @return the OsDisk object itself. */ @@ -94,9 +101,52 @@ public OsDisk withDiskSizeGB(long diskSizeGB) { /** * 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.writeLongField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeStringField("createOption", this.createOption == null ? null : this.createOption.toString()); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OsDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OsDisk 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 OsDisk. + */ + public static OsDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OsDisk deserializedOsDisk = new OsDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskSizeGB".equals(fieldName)) { + deserializedOsDisk.diskSizeGB = reader.getLong(); + } else if ("createOption".equals(fieldName)) { + deserializedOsDisk.createOption = OsDiskCreateOption.fromString(reader.getString()); + } else if ("deleteOption".equals(fieldName)) { + deserializedOsDisk.deleteOption = OsDiskDeleteOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOsDisk; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java index 9791c86b5c1cf..e63cc87d1eefc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java @@ -5,17 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The strategy for creating the OS disk. */ +/** + * The strategy for creating the OS disk. + */ public final class OsDiskCreateOption extends ExpandableStringEnum { - /** Static value Ephemeral for OsDiskCreateOption. */ + /** + * Static value Ephemeral for OsDiskCreateOption. + */ public static final OsDiskCreateOption EPHEMERAL = fromString("Ephemeral"); + /** + * Static value Persistent for OsDiskCreateOption. + */ + public static final OsDiskCreateOption PERSISTENT = fromString("Persistent"); + /** * Creates a new instance of OsDiskCreateOption value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +32,17 @@ public OsDiskCreateOption() { /** * Creates or finds a OsDiskCreateOption from its string representation. - * + * * @param name a name to look for. * @return the corresponding OsDiskCreateOption. */ - @JsonCreator public static OsDiskCreateOption fromString(String name) { return fromString(name, OsDiskCreateOption.class); } /** * Gets known OsDiskCreateOption values. - * + * * @return known OsDiskCreateOption values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java index d6930fcd00236..abb8fcca80f28 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The strategy for deleting the OS disk. */ +/** + * The strategy for deleting the OS disk. + */ public final class OsDiskDeleteOption extends ExpandableStringEnum { - /** Static value Delete for OsDiskDeleteOption. */ + /** + * Static value Delete for OsDiskDeleteOption. + */ public static final OsDiskDeleteOption DELETE = fromString("Delete"); /** * Creates a new instance of OsDiskDeleteOption value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public OsDiskDeleteOption() { /** * Creates or finds a OsDiskDeleteOption from its string representation. - * + * * @param name a name to look for. * @return the corresponding OsDiskDeleteOption. */ - @JsonCreator public static OsDiskDeleteOption fromString(String name) { return fromString(name, OsDiskDeleteOption.class); } /** * Gets known OsDiskDeleteOption values. - * + * * @return known OsDiskDeleteOption values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java index 1435cf8c7f237..a94a9bf07e0a6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java @@ -10,56 +10,55 @@ import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; import java.util.Map; -/** An immutable client-side representation of Rack. */ +/** + * An immutable client-side representation of Rack. + */ public interface Rack { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -67,7 +66,7 @@ public interface Rack { /** * Gets the availabilityZone property: The value that will be used for machines in this rack to represent the * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. - * + * * @return the availabilityZone value. */ String availabilityZone(); @@ -75,28 +74,28 @@ public interface Rack { /** * Gets the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the * rack is created by the cluster. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The more detailed status of the rack. - * + * * @return the detailedStatus value. */ RackDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the provisioningState property: The provisioning state of the rack resource. - * + * * @return the provisioningState value. */ RackProvisioningState provisioningState(); @@ -104,7 +103,7 @@ public interface Rack { /** * Gets the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @return the rackLocation value. */ String rackLocation(); @@ -112,64 +111,72 @@ public interface Rack { /** * Gets the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @return the rackSerialNumber value. */ String rackSerialNumber(); /** * Gets the rackSkuId property: The SKU for the rack. - * + * * @return the rackSkuId value. */ String rackSkuId(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.RackInner object. - * + * * @return the inner object. */ RackInner innerModel(); - /** The entirety of the Rack definition. */ + /** + * The entirety of the Rack definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAvailabilityZone, DefinitionStages.WithRackLocation, DefinitionStages.WithRackSerialNumber, DefinitionStages.WithRackSkuId, DefinitionStages.WithCreate { } - /** The Rack definition stages. */ + /** + * The Rack definition stages. + */ interface DefinitionStages { - /** The first stage of the Rack definition. */ + /** + * The first stage of the Rack definition. + */ interface Blank extends WithLocation { } - /** The stage of the Rack definition allowing to specify location. */ + /** + * The stage of the Rack definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -177,84 +184,92 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Rack definition allowing to specify parent resource. */ + /** + * The stage of the Rack definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the Rack definition allowing to specify extendedLocation. */ + /** + * The stage of the Rack definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithAvailabilityZone withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the Rack definition allowing to specify availabilityZone. */ + /** + * The stage of the Rack definition allowing to specify availabilityZone. + */ interface WithAvailabilityZone { /** * Specifies the availabilityZone property: The value that will be used for machines in this rack to * represent the availability zones that can be referenced by Hybrid AKS Clusters for node arrangement.. - * + * * @param availabilityZone The value that will be used for machines in this rack to represent the - * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. * @return the next definition stage. */ WithRackLocation withAvailabilityZone(String availabilityZone); } - /** The stage of the Rack definition allowing to specify rackLocation. */ + /** + * The stage of the Rack definition allowing to specify rackLocation. + */ interface WithRackLocation { /** * Specifies the rackLocation property: The free-form description of the rack location. (e.g. “DTN * Datacenter, Floor 3, Isle 9, Rack 2B”). - * + * * @param rackLocation The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle - * 9, Rack 2B”). + * 9, Rack 2B”). * @return the next definition stage. */ WithRackSerialNumber withRackLocation(String rackLocation); } - /** The stage of the Rack definition allowing to specify rackSerialNumber. */ + /** + * The stage of the Rack definition allowing to specify rackSerialNumber. + */ interface WithRackSerialNumber { /** * Specifies the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. * An alternate unique alphanumeric value other than a serial number may be provided if desired.. - * + * * @param rackSerialNumber The unique identifier for the rack within Network Cloud cluster. An alternate - * unique alphanumeric value other than a serial number may be provided if desired. + * unique alphanumeric value other than a serial number may be provided if desired. * @return the next definition stage. */ WithRackSkuId withRackSerialNumber(String rackSerialNumber); } - /** The stage of the Rack definition allowing to specify rackSkuId. */ + /** + * The stage of the Rack definition allowing to specify rackSkuId. + */ interface WithRackSkuId { /** * Specifies the rackSkuId property: The SKU for the rack.. - * + * * @param rackSkuId The SKU for the rack. * @return the next definition stage. */ @@ -268,25 +283,27 @@ interface WithRackSkuId { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ Rack create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Rack create(Context context); } - /** The stage of the Rack definition allowing to specify tags. */ + /** + * The stage of the Rack definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -296,60 +313,70 @@ interface WithTags { /** * Begins update for the Rack resource. - * + * * @return the stage of resource update. */ Rack.Update update(); - /** The template for Rack update. */ + /** + * The template for Rack update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithRackLocation, UpdateStages.WithRackSerialNumber { /** * Executes the update request. - * + * * @return the updated resource. */ Rack apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Rack apply(Context context); } - /** The Rack update stages. */ + /** + * The Rack update stages. + */ interface UpdateStages { - /** The stage of the Rack update allowing to specify tags. */ + /** + * The stage of the Rack update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Rack update allowing to specify rackLocation. */ + /** + * The stage of the Rack update allowing to specify rackLocation. + */ interface WithRackLocation { /** * Specifies the rackLocation property: The free-form description of the rack location. (e.g. “DTN * Datacenter, Floor 3, Isle 9, Rack 2B”). - * + * * @param rackLocation The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle - * 9, Rack 2B”). + * 9, Rack 2B”). * @return the next definition stage. */ Update withRackLocation(String rackLocation); } - /** The stage of the Rack update allowing to specify rackSerialNumber. */ + /** + * The stage of the Rack update allowing to specify rackSerialNumber. + */ interface WithRackSerialNumber { /** * Specifies the rackSerialNumber property: The globally unique identifier for the rack.. - * + * * @param rackSerialNumber The globally unique identifier for the rack. * @return the next definition stage. */ @@ -359,14 +386,14 @@ interface WithRackSerialNumber { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Rack refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java index 0dd522b9515df..2fbdeb929c82e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java @@ -6,63 +6,64 @@ 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; -/** RackDefinition represents details regarding the rack. */ +/** + * RackDefinition represents details regarding the rack. + */ @Fluent -public final class RackDefinition { +public final class RackDefinition implements JsonSerializable { /* * The zone name used for this rack when created. Availability zones are used for workload placement. */ - @JsonProperty(value = "availabilityZone") private String availabilityZone; /* * The unordered list of bare metal machine configuration. */ - @JsonProperty(value = "bareMetalMachineConfigurationData") private List bareMetalMachineConfigurationData; /* * The resource ID of the network rack that matches this rack definition. */ - @JsonProperty(value = "networkRackId", required = true) private String networkRackId; /* * The free-form description of the rack's location. */ - @JsonProperty(value = "rackLocation") private String rackLocation; /* * The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other * than a serial number may be provided if desired. */ - @JsonProperty(value = "rackSerialNumber", required = true) private String rackSerialNumber; /* * The resource ID of the sku for the rack being added. */ - @JsonProperty(value = "rackSkuId", required = true) private String rackSkuId; /* * The list of storage appliance configuration data for this rack. */ - @JsonProperty(value = "storageApplianceConfigurationData") private List storageApplianceConfigurationData; - /** Creates an instance of RackDefinition class. */ + /** + * Creates an instance of RackDefinition class. + */ public RackDefinition() { } /** * Get the availabilityZone property: The zone name used for this rack when created. Availability zones are used for * workload placement. - * + * * @return the availabilityZone value. */ public String availabilityZone() { @@ -72,7 +73,7 @@ public String availabilityZone() { /** * Set the availabilityZone property: The zone name used for this rack when created. Availability zones are used for * workload placement. - * + * * @param availabilityZone the availabilityZone value to set. * @return the RackDefinition object itself. */ @@ -83,7 +84,7 @@ public RackDefinition withAvailabilityZone(String availabilityZone) { /** * Get the bareMetalMachineConfigurationData property: The unordered list of bare metal machine configuration. - * + * * @return the bareMetalMachineConfigurationData value. */ public List bareMetalMachineConfigurationData() { @@ -92,7 +93,7 @@ public List bareMetalMachineConfigurationData /** * Set the bareMetalMachineConfigurationData property: The unordered list of bare metal machine configuration. - * + * * @param bareMetalMachineConfigurationData the bareMetalMachineConfigurationData value to set. * @return the RackDefinition object itself. */ @@ -104,7 +105,7 @@ public RackDefinition withBareMetalMachineConfigurationData( /** * Get the networkRackId property: The resource ID of the network rack that matches this rack definition. - * + * * @return the networkRackId value. */ public String networkRackId() { @@ -113,7 +114,7 @@ public String networkRackId() { /** * Set the networkRackId property: The resource ID of the network rack that matches this rack definition. - * + * * @param networkRackId the networkRackId value to set. * @return the RackDefinition object itself. */ @@ -124,7 +125,7 @@ public RackDefinition withNetworkRackId(String networkRackId) { /** * Get the rackLocation property: The free-form description of the rack's location. - * + * * @return the rackLocation value. */ public String rackLocation() { @@ -133,7 +134,7 @@ public String rackLocation() { /** * Set the rackLocation property: The free-form description of the rack's location. - * + * * @param rackLocation the rackLocation value to set. * @return the RackDefinition object itself. */ @@ -145,7 +146,7 @@ public RackDefinition withRackLocation(String rackLocation) { /** * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @return the rackSerialNumber value. */ public String rackSerialNumber() { @@ -155,7 +156,7 @@ public String rackSerialNumber() { /** * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate * unique alphanumeric value other than a serial number may be provided if desired. - * + * * @param rackSerialNumber the rackSerialNumber value to set. * @return the RackDefinition object itself. */ @@ -166,7 +167,7 @@ public RackDefinition withRackSerialNumber(String rackSerialNumber) { /** * Get the rackSkuId property: The resource ID of the sku for the rack being added. - * + * * @return the rackSkuId value. */ public String rackSkuId() { @@ -175,7 +176,7 @@ public String rackSkuId() { /** * Set the rackSkuId property: The resource ID of the sku for the rack being added. - * + * * @param rackSkuId the rackSkuId value to set. * @return the RackDefinition object itself. */ @@ -187,7 +188,7 @@ public RackDefinition withRackSkuId(String rackSkuId) { /** * Get the storageApplianceConfigurationData property: The list of storage appliance configuration data for this * rack. - * + * * @return the storageApplianceConfigurationData value. */ public List storageApplianceConfigurationData() { @@ -197,7 +198,7 @@ public List storageApplianceConfigurationData /** * Set the storageApplianceConfigurationData property: The list of storage appliance configuration data for this * rack. - * + * * @param storageApplianceConfigurationData the storageApplianceConfigurationData value to set. * @return the RackDefinition object itself. */ @@ -209,7 +210,7 @@ public RackDefinition withStorageApplianceConfigurationData( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -217,16 +218,17 @@ public void validate() { bareMetalMachineConfigurationData().forEach(e -> e.validate()); } if (networkRackId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property networkRackId in model RackDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property networkRackId in model RackDefinition")); } if (rackSerialNumber() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackSerialNumber in model RackDefinition")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property rackSerialNumber in model RackDefinition")); } if (rackSkuId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property rackSkuId in model RackDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rackSkuId in model RackDefinition")); } if (storageApplianceConfigurationData() != null) { storageApplianceConfigurationData().forEach(e -> e.validate()); @@ -234,4 +236,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(RackDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkRackId", this.networkRackId); + jsonWriter.writeStringField("rackSerialNumber", this.rackSerialNumber); + jsonWriter.writeStringField("rackSkuId", this.rackSkuId); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeArrayField("bareMetalMachineConfigurationData", this.bareMetalMachineConfigurationData, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("rackLocation", this.rackLocation); + jsonWriter.writeArrayField("storageApplianceConfigurationData", this.storageApplianceConfigurationData, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackDefinition 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 RackDefinition. + */ + public static RackDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackDefinition deserializedRackDefinition = new RackDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkRackId".equals(fieldName)) { + deserializedRackDefinition.networkRackId = reader.getString(); + } else if ("rackSerialNumber".equals(fieldName)) { + deserializedRackDefinition.rackSerialNumber = reader.getString(); + } else if ("rackSkuId".equals(fieldName)) { + deserializedRackDefinition.rackSkuId = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedRackDefinition.availabilityZone = reader.getString(); + } else if ("bareMetalMachineConfigurationData".equals(fieldName)) { + List bareMetalMachineConfigurationData + = reader.readArray(reader1 -> BareMetalMachineConfigurationData.fromJson(reader1)); + deserializedRackDefinition.bareMetalMachineConfigurationData = bareMetalMachineConfigurationData; + } else if ("rackLocation".equals(fieldName)) { + deserializedRackDefinition.rackLocation = reader.getString(); + } else if ("storageApplianceConfigurationData".equals(fieldName)) { + List storageApplianceConfigurationData + = reader.readArray(reader1 -> StorageApplianceConfigurationData.fromJson(reader1)); + deserializedRackDefinition.storageApplianceConfigurationData = storageApplianceConfigurationData; + } else { + reader.skipChildren(); + } + } + + return deserializedRackDefinition; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java index 17299e967c053..cb53809ba1cb8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the rack. */ +/** + * The more detailed status of the rack. + */ public final class RackDetailedStatus extends ExpandableStringEnum { - /** Static value Error for RackDetailedStatus. */ + /** + * Static value Error for RackDetailedStatus. + */ public static final RackDetailedStatus ERROR = fromString("Error"); - /** Static value Available for RackDetailedStatus. */ + /** + * Static value Available for RackDetailedStatus. + */ public static final RackDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for RackDetailedStatus. */ + /** + * Static value Provisioning for RackDetailedStatus. + */ public static final RackDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of RackDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public RackDetailedStatus() { /** * Creates or finds a RackDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding RackDetailedStatus. */ - @JsonCreator public static RackDetailedStatus fromString(String name) { return fromString(name, RackDetailedStatus.class); } /** * Gets known RackDetailedStatus values. - * + * * @return known RackDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java index 689372ecad3fd..766d6a20a3259 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.RackInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** RackList represents a list of racks. */ +/** + * RackList represents a list of racks. + */ @Fluent -public final class RackList { +public final class RackList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of racks. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of RackList class. */ + /** + * Creates an instance of RackList class. + */ public RackList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the RackList object itself. */ @@ -50,7 +56,7 @@ public RackList withNextLink(String nextLink) { /** * Get the value property: The list of racks. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of racks. - * + * * @param value the value value to set. * @return the RackList object itself. */ @@ -70,7 +76,7 @@ public RackList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackList 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 RackList. + */ + public static RackList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackList deserializedRackList = new RackList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRackList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RackInner.fromJson(reader1)); + deserializedRackList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRackList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java index 9084fdf222566..4c76488bd4b26 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.RacksPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** RackPatchParameters represents the body of the request to patch the rack properties. */ +/** + * RackPatchParameters represents the body of the request to patch the rack properties. + */ @Fluent -public final class RackPatchParameters { +public final class RackPatchParameters implements JsonSerializable { /* - * RacksPatchProperties represents the properties of the rack during patching. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private RacksPatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of RackPatchParameters class. */ + /** + * Creates an instance of RackPatchParameters class. + */ public RackPatchParameters() { } /** - * Get the innerProperties property: RacksPatchProperties represents the properties of the rack during patching. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private RacksPatchProperties innerProperties() { @@ -45,7 +45,7 @@ private RacksPatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -54,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the RackPatchParameters object itself. */ @@ -66,7 +66,7 @@ public RackPatchParameters withTags(Map tags) { /** * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @return the rackLocation value. */ public String rackLocation() { @@ -76,7 +76,7 @@ public String rackLocation() { /** * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, * Isle 9, Rack 2B”). - * + * * @param rackLocation the rackLocation value to set. * @return the RackPatchParameters object itself. */ @@ -90,7 +90,7 @@ public RackPatchParameters withRackLocation(String rackLocation) { /** * Get the rackSerialNumber property: The globally unique identifier for the rack. - * + * * @return the rackSerialNumber value. */ public String rackSerialNumber() { @@ -99,7 +99,7 @@ public String rackSerialNumber() { /** * Set the rackSerialNumber property: The globally unique identifier for the rack. - * + * * @param rackSerialNumber the rackSerialNumber value to set. * @return the RackPatchParameters object itself. */ @@ -113,7 +113,7 @@ public RackPatchParameters withRackSerialNumber(String rackSerialNumber) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -121,4 +121,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackPatchParameters 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 RackPatchParameters. + */ + public static RackPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackPatchParameters deserializedRackPatchParameters = new RackPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRackPatchParameters.innerProperties = RacksPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRackPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRackPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java index a85bda5be5441..79eca3e7266b5 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the rack resource. */ +/** + * The provisioning state of the rack resource. + */ public final class RackProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for RackProvisioningState. */ + /** + * Static value Succeeded for RackProvisioningState. + */ public static final RackProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for RackProvisioningState. */ + /** + * Static value Failed for RackProvisioningState. + */ public static final RackProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for RackProvisioningState. */ + /** + * Static value Canceled for RackProvisioningState. + */ public static final RackProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for RackProvisioningState. */ + /** + * Static value Provisioning for RackProvisioningState. + */ public static final RackProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for RackProvisioningState. */ + /** + * Static value Accepted for RackProvisioningState. + */ public static final RackProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of RackProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public RackProvisioningState() { /** * Creates or finds a RackProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding RackProvisioningState. */ - @JsonCreator public static RackProvisioningState fromString(String name) { return fromString(name, RackProvisioningState.class); } /** * Gets known RackProvisioningState values. - * + * * @return known RackProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java index c9854e67f111c..2416b2766e062 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java @@ -8,32 +8,34 @@ import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; import java.util.List; -/** An immutable client-side representation of RackSku. */ +/** + * An immutable client-side representation of RackSku. + */ public interface RackSku { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -41,7 +43,7 @@ public interface RackSku { /** * Gets the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated * machines in this rack model. - * + * * @return the computeMachines value. */ List computeMachines(); @@ -49,14 +51,14 @@ public interface RackSku { /** * Gets the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane * dedicated machines in this rack model. - * + * * @return the controllerMachines value. */ List controllerMachines(); /** * Gets the description property: The free-form text describing the rack. - * + * * @return the description value. */ String description(); @@ -64,21 +66,21 @@ public interface RackSku { /** * Gets the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this * is a compute rack or a rack for a single rack cluster(rackType="Single"). - * + * * @return the maxClusterSlots value. */ Long maxClusterSlots(); /** * Gets the provisioningState property: The provisioning state of the rack SKU resource. - * + * * @return the provisioningState value. */ RackSkuProvisioningState provisioningState(); /** * Gets the rackType property: The type of the rack. - * + * * @return the rackType value. */ RackSkuType rackType(); @@ -86,21 +88,21 @@ public interface RackSku { /** * Gets the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage * appliance(s) in this rack model. - * + * * @return the storageAppliances value. */ List storageAppliances(); /** * Gets the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. - * + * * @return the supportedRackSkuIds value. */ List supportedRackSkuIds(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner object. - * + * * @return the inner object. */ RackSkuInner innerModel(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java index b7a96c5881c3a..aa8647ecb48ec 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.RackSkuInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** RackSkuList represents a list of rack SKUs. */ +/** + * RackSkuList represents a list of rack SKUs. + */ @Fluent -public final class RackSkuList { +public final class RackSkuList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of Rack SKUs. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of RackSkuList class. */ + /** + * Creates an instance of RackSkuList class. + */ public RackSkuList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the RackSkuList object itself. */ @@ -50,7 +56,7 @@ public RackSkuList withNextLink(String nextLink) { /** * Get the value property: The list of Rack SKUs. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of Rack SKUs. - * + * * @param value the value value to set. * @return the RackSkuList object itself. */ @@ -70,7 +76,7 @@ public RackSkuList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RackSkuList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RackSkuList 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 RackSkuList. + */ + public static RackSkuList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RackSkuList deserializedRackSkuList = new RackSkuList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRackSkuList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RackSkuInner.fromJson(reader1)); + deserializedRackSkuList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRackSkuList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java index 8dd77b3f9b4f6..4ccffee8fda36 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java @@ -5,17 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the rack SKU resource. */ +/** + * The provisioning state of the rack SKU resource. + */ public final class RackSkuProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for RackSkuProvisioningState. */ + /** + * Static value Canceled for RackSkuProvisioningState. + */ + public static final RackSkuProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for RackSkuProvisioningState. + */ + public static final RackSkuProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Succeeded for RackSkuProvisioningState. + */ public static final RackSkuProvisioningState SUCCEEDED = fromString("Succeeded"); /** * Creates a new instance of RackSkuProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +37,17 @@ public RackSkuProvisioningState() { /** * Creates or finds a RackSkuProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding RackSkuProvisioningState. */ - @JsonCreator public static RackSkuProvisioningState fromString(String name) { return fromString(name, RackSkuProvisioningState.class); } /** * Gets known RackSkuProvisioningState values. - * + * * @return known RackSkuProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java index c836943874900..8704a88d2135c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the rack. */ +/** + * The type of the rack. + */ public final class RackSkuType extends ExpandableStringEnum { - /** Static value Aggregator for RackSkuType. */ + /** + * Static value Aggregator for RackSkuType. + */ public static final RackSkuType AGGREGATOR = fromString("Aggregator"); - /** Static value Compute for RackSkuType. */ + /** + * Static value Compute for RackSkuType. + */ public static final RackSkuType COMPUTE = fromString("Compute"); - /** Static value Single for RackSkuType. */ + /** + * Static value Single for RackSkuType. + */ public static final RackSkuType SINGLE = fromString("Single"); /** * Creates a new instance of RackSkuType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public RackSkuType() { /** * Creates or finds a RackSkuType from its string representation. - * + * * @param name a name to look for. * @return the corresponding RackSkuType. */ - @JsonCreator public static RackSkuType fromString(String name) { return fromString(name, RackSkuType.class); } /** * Gets known RackSkuType values. - * + * * @return known RackSkuType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java index 5f2471ad4b25a..4b71b3d587f65 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of RackSkus. */ +/** + * Resource collection API of RackSkus. + */ public interface RackSkus { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface RackSkus { /** * List rack SKUs in the subscription. - * - *

Get a list of rack SKUs in the provided subscription. - * + * + * Get a list of rack SKUs in the provided subscription. + * * @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. @@ -36,9 +38,9 @@ public interface RackSkus { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,9 +52,9 @@ public interface RackSkus { /** * Retrieve the rack SKU. - * - *

Get the properties of the provided rack SKU. - * + * + * Get the properties of the provided rack SKU. + * * @param rackSkuName The name of the rack SKU. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java index 6154c42700e45..eec2e786a13f6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Racks. */ +/** + * Resource collection API of Racks. + */ public interface Racks { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of racks in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface Racks { /** * List racks in the subscription. - * - *

Get a list of racks in the provided subscription. - * + * + * Get a list of racks in the provided subscription. + * * @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. @@ -36,9 +38,9 @@ public interface Racks { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,9 +51,9 @@ public interface Racks { /** * List racks in the resource group. - * - *

Get a list of racks in the provided resource group. - * + * + * Get a list of racks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,9 +65,9 @@ public interface Racks { /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @param context The context to associate with this operation. @@ -78,9 +80,9 @@ public interface Racks { /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,38 +94,40 @@ public interface Racks { /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String rackName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String rackName); /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rackName The name of the rack. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String rackName, Context context); + OperationStatusResult delete(String resourceGroupName, String rackName, Context context); /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,9 +138,9 @@ public interface Racks { /** * Retrieve the rack. - * - *

Get properties of the provided rack. - * + * + * Get properties of the provided rack. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,34 +152,36 @@ public interface Racks { /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the rack. - * - *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource - * is managed by the system. - * + * + * Delete the provided rack. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Rack resource. - * + * * @param name resource name. * @return the first stage of the new Rack definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java index ac40894cb5cf6..7b1adf8170273 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the storage appliance supports remote vendor management. */ +/** + * The indicator of whether the storage appliance supports remote vendor management. + */ public final class RemoteVendorManagementFeature extends ExpandableStringEnum { - /** Static value Supported for RemoteVendorManagementFeature. */ + /** + * Static value Supported for RemoteVendorManagementFeature. + */ public static final RemoteVendorManagementFeature SUPPORTED = fromString("Supported"); - /** Static value Unsupported for RemoteVendorManagementFeature. */ + /** + * Static value Unsupported for RemoteVendorManagementFeature. + */ public static final RemoteVendorManagementFeature UNSUPPORTED = fromString("Unsupported"); /** * Creates a new instance of RemoteVendorManagementFeature value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public RemoteVendorManagementFeature() { /** * Creates or finds a RemoteVendorManagementFeature from its string representation. - * + * * @param name a name to look for. * @return the corresponding RemoteVendorManagementFeature. */ - @JsonCreator public static RemoteVendorManagementFeature fromString(String name) { return fromString(name, RemoteVendorManagementFeature.class); } /** * Gets known RemoteVendorManagementFeature values. - * + * * @return known RemoteVendorManagementFeature values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java index 0e9f92e02a1d1..b51aeee40853e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * unsupported feature. */ public final class RemoteVendorManagementStatus extends ExpandableStringEnum { - /** Static value Enabled for RemoteVendorManagementStatus. */ + /** + * Static value Enabled for RemoteVendorManagementStatus. + */ public static final RemoteVendorManagementStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for RemoteVendorManagementStatus. */ + /** + * Static value Disabled for RemoteVendorManagementStatus. + */ public static final RemoteVendorManagementStatus DISABLED = fromString("Disabled"); - /** Static value Unsupported for RemoteVendorManagementStatus. */ + /** + * Static value Unsupported for RemoteVendorManagementStatus. + */ public static final RemoteVendorManagementStatus UNSUPPORTED = fromString("Unsupported"); /** * Creates a new instance of RemoteVendorManagementStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public RemoteVendorManagementStatus() { /** * Creates or finds a RemoteVendorManagementStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding RemoteVendorManagementStatus. */ - @JsonCreator public static RemoteVendorManagementStatus fromString(String name) { return fromString(name, RemoteVendorManagementStatus.class); } /** * Gets known RemoteVendorManagementStatus values. - * + * * @return known RemoteVendorManagementStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionConfiguration.java new file mode 100644 index 0000000000000..3eb20762df59b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. + */ +@Fluent +public final class RuntimeProtectionConfiguration implements JsonSerializable { + /* + * The mode of operation for runtime protection. + */ + private RuntimeProtectionEnforcementLevel enforcementLevel; + + /** + * Creates an instance of RuntimeProtectionConfiguration class. + */ + public RuntimeProtectionConfiguration() { + } + + /** + * Get the enforcementLevel property: The mode of operation for runtime protection. + * + * @return the enforcementLevel value. + */ + public RuntimeProtectionEnforcementLevel enforcementLevel() { + return this.enforcementLevel; + } + + /** + * Set the enforcementLevel property: The mode of operation for runtime protection. + * + * @param enforcementLevel the enforcementLevel value to set. + * @return the RuntimeProtectionConfiguration object itself. + */ + public RuntimeProtectionConfiguration withEnforcementLevel(RuntimeProtectionEnforcementLevel enforcementLevel) { + this.enforcementLevel = enforcementLevel; + 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("enforcementLevel", + this.enforcementLevel == null ? null : this.enforcementLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeProtectionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeProtectionConfiguration 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 RuntimeProtectionConfiguration. + */ + public static RuntimeProtectionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeProtectionConfiguration deserializedRuntimeProtectionConfiguration + = new RuntimeProtectionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enforcementLevel".equals(fieldName)) { + deserializedRuntimeProtectionConfiguration.enforcementLevel + = RuntimeProtectionEnforcementLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeProtectionConfiguration; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionEnforcementLevel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionEnforcementLevel.java new file mode 100644 index 0000000000000..de9255168bc47 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionEnforcementLevel.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode of operation for runtime protection. + */ +public final class RuntimeProtectionEnforcementLevel extends ExpandableStringEnum { + /** + * Static value Audit for RuntimeProtectionEnforcementLevel. + */ + public static final RuntimeProtectionEnforcementLevel AUDIT = fromString("Audit"); + + /** + * Static value Disabled for RuntimeProtectionEnforcementLevel. + */ + public static final RuntimeProtectionEnforcementLevel DISABLED = fromString("Disabled"); + + /** + * Static value OnDemand for RuntimeProtectionEnforcementLevel. + */ + public static final RuntimeProtectionEnforcementLevel ON_DEMAND = fromString("OnDemand"); + + /** + * Static value Passive for RuntimeProtectionEnforcementLevel. + */ + public static final RuntimeProtectionEnforcementLevel PASSIVE = fromString("Passive"); + + /** + * Static value RealTime for RuntimeProtectionEnforcementLevel. + */ + public static final RuntimeProtectionEnforcementLevel REAL_TIME = fromString("RealTime"); + + /** + * Creates a new instance of RuntimeProtectionEnforcementLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuntimeProtectionEnforcementLevel() { + } + + /** + * Creates or finds a RuntimeProtectionEnforcementLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuntimeProtectionEnforcementLevel. + */ + public static RuntimeProtectionEnforcementLevel fromString(String name) { + return fromString(name, RuntimeProtectionEnforcementLevel.class); + } + + /** + * Gets known RuntimeProtectionEnforcementLevel values. + * + * @return known RuntimeProtectionEnforcementLevel values. + */ + public static Collection values() { + return values(RuntimeProtectionEnforcementLevel.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionStatus.java new file mode 100644 index 0000000000000..4f16058558496 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RuntimeProtectionStatus.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. + */ +@Immutable +public final class RuntimeProtectionStatus implements JsonSerializable { + /* + * The timestamp when the malware definitions were last updated. + */ + private OffsetDateTime definitionsLastUpdated; + + /* + * The version of the malware definitions. + */ + private String definitionsVersion; + + /* + * The timestamp of the most recently completed scan, or empty if there has never been a scan. + */ + private OffsetDateTime scanCompletedTime; + + /* + * The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + */ + private OffsetDateTime scanScheduledTime; + + /* + * The timestamp of the most recently started scan, or empty if there has never been a scan. + */ + private OffsetDateTime scanStartedTime; + + /** + * Creates an instance of RuntimeProtectionStatus class. + */ + public RuntimeProtectionStatus() { + } + + /** + * Get the definitionsLastUpdated property: The timestamp when the malware definitions were last updated. + * + * @return the definitionsLastUpdated value. + */ + public OffsetDateTime definitionsLastUpdated() { + return this.definitionsLastUpdated; + } + + /** + * Get the definitionsVersion property: The version of the malware definitions. + * + * @return the definitionsVersion value. + */ + public String definitionsVersion() { + return this.definitionsVersion; + } + + /** + * Get the scanCompletedTime property: The timestamp of the most recently completed scan, or empty if there has + * never been a scan. + * + * @return the scanCompletedTime value. + */ + public OffsetDateTime scanCompletedTime() { + return this.scanCompletedTime; + } + + /** + * Get the scanScheduledTime property: The timestamp of the most recently scheduled scan, or empty if no scan has + * been scheduled. + * + * @return the scanScheduledTime value. + */ + public OffsetDateTime scanScheduledTime() { + return this.scanScheduledTime; + } + + /** + * Get the scanStartedTime property: The timestamp of the most recently started scan, or empty if there has never + * been a scan. + * + * @return the scanStartedTime value. + */ + public OffsetDateTime scanStartedTime() { + return this.scanStartedTime; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeProtectionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeProtectionStatus 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 RuntimeProtectionStatus. + */ + public static RuntimeProtectionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeProtectionStatus deserializedRuntimeProtectionStatus = new RuntimeProtectionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("definitionsLastUpdated".equals(fieldName)) { + deserializedRuntimeProtectionStatus.definitionsLastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("definitionsVersion".equals(fieldName)) { + deserializedRuntimeProtectionStatus.definitionsVersion = reader.getString(); + } else if ("scanCompletedTime".equals(fieldName)) { + deserializedRuntimeProtectionStatus.scanCompletedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scanScheduledTime".equals(fieldName)) { + deserializedRuntimeProtectionStatus.scanScheduledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scanStartedTime".equals(fieldName)) { + deserializedRuntimeProtectionStatus.scanStartedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeProtectionStatus; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveReference.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveReference.java new file mode 100644 index 0000000000000..c4edf0c2f9df7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveReference.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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 java.io.IOException; + +/** + * SecretArchiveReference represents the reference to a secret in a key vault. + */ +@Immutable +public final class SecretArchiveReference implements JsonSerializable { + /* + * The resource ID of the key vault containing the secret. + */ + private String keyVaultId; + + /* + * The name of the secret in the key vault. + */ + private String secretName; + + /* + * The version of the secret in the key vault. + */ + private String secretVersion; + + /** + * Creates an instance of SecretArchiveReference class. + */ + public SecretArchiveReference() { + } + + /** + * Get the keyVaultId property: The resource ID of the key vault containing the secret. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Get the secretName property: The name of the secret in the key vault. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Get the secretVersion property: The version of the secret in the key vault. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretArchiveReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretArchiveReference 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 SecretArchiveReference. + */ + public static SecretArchiveReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretArchiveReference deserializedSecretArchiveReference = new SecretArchiveReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultId".equals(fieldName)) { + deserializedSecretArchiveReference.keyVaultId = reader.getString(); + } else if ("secretName".equals(fieldName)) { + deserializedSecretArchiveReference.secretName = reader.getString(); + } else if ("secretVersion".equals(fieldName)) { + deserializedSecretArchiveReference.secretVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretArchiveReference; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveSettings.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveSettings.java new file mode 100644 index 0000000000000..e5ea289798354 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretArchiveSettings.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + */ +@Fluent +public final class SecretArchiveSettings implements JsonSerializable { + /* + * The selection of the managed identity to use with this vault URI. The identity type must be either system + * assigned or user assigned. + */ + private IdentitySelector associatedIdentity; + + /* + * The URI for the key vault used as the secret archive. + */ + private String vaultUri; + + /** + * Creates an instance of SecretArchiveSettings class. + */ + public SecretArchiveSettings() { + } + + /** + * Get the associatedIdentity property: The selection of the managed identity to use with this vault URI. The + * identity type must be either system assigned or user assigned. + * + * @return the associatedIdentity value. + */ + public IdentitySelector associatedIdentity() { + return this.associatedIdentity; + } + + /** + * Set the associatedIdentity property: The selection of the managed identity to use with this vault URI. The + * identity type must be either system assigned or user assigned. + * + * @param associatedIdentity the associatedIdentity value to set. + * @return the SecretArchiveSettings object itself. + */ + public SecretArchiveSettings withAssociatedIdentity(IdentitySelector associatedIdentity) { + this.associatedIdentity = associatedIdentity; + return this; + } + + /** + * Get the vaultUri property: The URI for the key vault used as the secret archive. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: The URI for the key vault used as the secret archive. + * + * @param vaultUri the vaultUri value to set. + * @return the SecretArchiveSettings object itself. + */ + public SecretArchiveSettings withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedIdentity() != null) { + associatedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("associatedIdentity", this.associatedIdentity); + jsonWriter.writeStringField("vaultUri", this.vaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretArchiveSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretArchiveSettings 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 SecretArchiveSettings. + */ + public static SecretArchiveSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretArchiveSettings deserializedSecretArchiveSettings = new SecretArchiveSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("associatedIdentity".equals(fieldName)) { + deserializedSecretArchiveSettings.associatedIdentity = IdentitySelector.fromJson(reader); + } else if ("vaultUri".equals(fieldName)) { + deserializedSecretArchiveSettings.vaultUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretArchiveSettings; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretRotationStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretRotationStatus.java new file mode 100644 index 0000000000000..eccbfd6fb9bd5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SecretRotationStatus.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * SecretRotationStatus represents the status of a secret rotation. + */ +@Immutable +public final class SecretRotationStatus implements JsonSerializable { + /* + * The maximum number of days the secret may be used before it must be changed. + */ + private Long expirePeriodDays; + + /* + * The date and time when the secret was last changed. + */ + private OffsetDateTime lastRotationTime; + + /* + * The number of days a secret exists before rotations will be attempted. + */ + private Long rotationPeriodDays; + + /* + * The reference to the secret in a key vault. + */ + private SecretArchiveReference secretArchiveReference; + + /* + * The type name used to identify the purpose of the secret. + */ + private String secretType; + + /** + * Creates an instance of SecretRotationStatus class. + */ + public SecretRotationStatus() { + } + + /** + * Get the expirePeriodDays property: The maximum number of days the secret may be used before it must be changed. + * + * @return the expirePeriodDays value. + */ + public Long expirePeriodDays() { + return this.expirePeriodDays; + } + + /** + * Get the lastRotationTime property: The date and time when the secret was last changed. + * + * @return the lastRotationTime value. + */ + public OffsetDateTime lastRotationTime() { + return this.lastRotationTime; + } + + /** + * Get the rotationPeriodDays property: The number of days a secret exists before rotations will be attempted. + * + * @return the rotationPeriodDays value. + */ + public Long rotationPeriodDays() { + return this.rotationPeriodDays; + } + + /** + * Get the secretArchiveReference property: The reference to the secret in a key vault. + * + * @return the secretArchiveReference value. + */ + public SecretArchiveReference secretArchiveReference() { + return this.secretArchiveReference; + } + + /** + * Get the secretType property: The type name used to identify the purpose of the secret. + * + * @return the secretType value. + */ + public String secretType() { + return this.secretType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretArchiveReference() != null) { + secretArchiveReference().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretRotationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretRotationStatus 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 SecretRotationStatus. + */ + public static SecretRotationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretRotationStatus deserializedSecretRotationStatus = new SecretRotationStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirePeriodDays".equals(fieldName)) { + deserializedSecretRotationStatus.expirePeriodDays = reader.getNullable(JsonReader::getLong); + } else if ("lastRotationTime".equals(fieldName)) { + deserializedSecretRotationStatus.lastRotationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("rotationPeriodDays".equals(fieldName)) { + deserializedSecretRotationStatus.rotationPeriodDays = reader.getNullable(JsonReader::getLong); + } else if ("secretArchiveReference".equals(fieldName)) { + deserializedSecretRotationStatus.secretArchiveReference = SecretArchiveReference.fromJson(reader); + } else if ("secretType".equals(fieldName)) { + deserializedSecretRotationStatus.secretType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretRotationStatus; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServiceLoadBalancerBgpPeer.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServiceLoadBalancerBgpPeer.java index caa352dc647f9..002b0e51d290e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServiceLoadBalancerBgpPeer.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServiceLoadBalancerBgpPeer.java @@ -6,80 +6,78 @@ 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; /** * ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. */ @Fluent -public final class ServiceLoadBalancerBgpPeer { +public final class ServiceLoadBalancerBgpPeer implements JsonSerializable { /* * The indicator of BFD enablement for this BgpPeer. */ - @JsonProperty(value = "bfdEnabled") private BfdEnabled bfdEnabled; /* * The indicator to enable multi-hop peering support. */ - @JsonProperty(value = "bgpMultiHop") private BgpMultiHop bgpMultiHop; /* + * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. * The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. */ - @JsonProperty(value = "holdTime") private String holdTime; /* + * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. * The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. */ - @JsonProperty(value = "keepAliveTime") private String keepAliveTime; /* * The autonomous system number used for the local end of the BGP session. */ - @JsonProperty(value = "myAsn") private Long myAsn; /* * The name used to identify this BGP peer for association with a BGP advertisement. */ - @JsonProperty(value = "name", required = true) private String name; /* * The authentication password for routers enforcing TCP MD5 authenticated sessions. */ - @JsonProperty(value = "password") private String password; /* * The IPv4 or IPv6 address used to connect this BGP session. */ - @JsonProperty(value = "peerAddress", required = true) private String peerAddress; /* * The autonomous system number expected from the remote end of the BGP session. */ - @JsonProperty(value = "peerAsn", required = true) private long peerAsn; /* * The port used to connect this BGP session. */ - @JsonProperty(value = "peerPort") private Long peerPort; - /** Creates an instance of ServiceLoadBalancerBgpPeer class. */ + /** + * Creates an instance of ServiceLoadBalancerBgpPeer class. + */ public ServiceLoadBalancerBgpPeer() { } /** * Get the bfdEnabled property: The indicator of BFD enablement for this BgpPeer. - * + * * @return the bfdEnabled value. */ public BfdEnabled bfdEnabled() { @@ -88,7 +86,7 @@ public BfdEnabled bfdEnabled() { /** * Set the bfdEnabled property: The indicator of BFD enablement for this BgpPeer. - * + * * @param bfdEnabled the bfdEnabled value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -99,7 +97,7 @@ public ServiceLoadBalancerBgpPeer withBfdEnabled(BfdEnabled bfdEnabled) { /** * Get the bgpMultiHop property: The indicator to enable multi-hop peering support. - * + * * @return the bgpMultiHop value. */ public BgpMultiHop bgpMultiHop() { @@ -108,7 +106,7 @@ public BgpMultiHop bgpMultiHop() { /** * Set the bgpMultiHop property: The indicator to enable multi-hop peering support. - * + * * @param bgpMultiHop the bgpMultiHop value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -118,9 +116,10 @@ public ServiceLoadBalancerBgpPeer withBgpMultiHop(BgpMultiHop bgpMultiHop) { } /** - * Get the holdTime property: The requested BGP hold time value. This field uses ISO 8601 duration format, for + * Get the holdTime property: Field Deprecated. The field was previously optional, now it will have no defined + * behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for * example P1H. - * + * * @return the holdTime value. */ public String holdTime() { @@ -128,9 +127,10 @@ public String holdTime() { } /** - * Set the holdTime property: The requested BGP hold time value. This field uses ISO 8601 duration format, for + * Set the holdTime property: Field Deprecated. The field was previously optional, now it will have no defined + * behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for * example P1H. - * + * * @param holdTime the holdTime value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -140,9 +140,10 @@ public ServiceLoadBalancerBgpPeer withHoldTime(String holdTime) { } /** - * Get the keepAliveTime property: The requested BGP keepalive time value. This field uses ISO 8601 duration format, + * Get the keepAliveTime property: Field Deprecated. The field was previously optional, now it will have no defined + * behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, * for example P1H. - * + * * @return the keepAliveTime value. */ public String keepAliveTime() { @@ -150,9 +151,10 @@ public String keepAliveTime() { } /** - * Set the keepAliveTime property: The requested BGP keepalive time value. This field uses ISO 8601 duration format, + * Set the keepAliveTime property: Field Deprecated. The field was previously optional, now it will have no defined + * behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, * for example P1H. - * + * * @param keepAliveTime the keepAliveTime value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -163,7 +165,7 @@ public ServiceLoadBalancerBgpPeer withKeepAliveTime(String keepAliveTime) { /** * Get the myAsn property: The autonomous system number used for the local end of the BGP session. - * + * * @return the myAsn value. */ public Long myAsn() { @@ -172,7 +174,7 @@ public Long myAsn() { /** * Set the myAsn property: The autonomous system number used for the local end of the BGP session. - * + * * @param myAsn the myAsn value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -183,7 +185,7 @@ public ServiceLoadBalancerBgpPeer withMyAsn(Long myAsn) { /** * Get the name property: The name used to identify this BGP peer for association with a BGP advertisement. - * + * * @return the name value. */ public String name() { @@ -192,7 +194,7 @@ public String name() { /** * Set the name property: The name used to identify this BGP peer for association with a BGP advertisement. - * + * * @param name the name value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -203,7 +205,7 @@ public ServiceLoadBalancerBgpPeer withName(String name) { /** * Get the password property: The authentication password for routers enforcing TCP MD5 authenticated sessions. - * + * * @return the password value. */ public String password() { @@ -212,7 +214,7 @@ public String password() { /** * Set the password property: The authentication password for routers enforcing TCP MD5 authenticated sessions. - * + * * @param password the password value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -223,7 +225,7 @@ public ServiceLoadBalancerBgpPeer withPassword(String password) { /** * Get the peerAddress property: The IPv4 or IPv6 address used to connect this BGP session. - * + * * @return the peerAddress value. */ public String peerAddress() { @@ -232,7 +234,7 @@ public String peerAddress() { /** * Set the peerAddress property: The IPv4 or IPv6 address used to connect this BGP session. - * + * * @param peerAddress the peerAddress value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -243,7 +245,7 @@ public ServiceLoadBalancerBgpPeer withPeerAddress(String peerAddress) { /** * Get the peerAsn property: The autonomous system number expected from the remote end of the BGP session. - * + * * @return the peerAsn value. */ public long peerAsn() { @@ -252,7 +254,7 @@ public long peerAsn() { /** * Set the peerAsn property: The autonomous system number expected from the remote end of the BGP session. - * + * * @param peerAsn the peerAsn value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -263,7 +265,7 @@ public ServiceLoadBalancerBgpPeer withPeerAsn(long peerAsn) { /** * Get the peerPort property: The port used to connect this BGP session. - * + * * @return the peerPort value. */ public Long peerPort() { @@ -272,7 +274,7 @@ public Long peerPort() { /** * Set the peerPort property: The port used to connect this BGP session. - * + * * @param peerPort the peerPort value to set. * @return the ServiceLoadBalancerBgpPeer object itself. */ @@ -283,19 +285,85 @@ public ServiceLoadBalancerBgpPeer withPeerPort(Long peerPort) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ServiceLoadBalancerBgpPeer")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property name in model ServiceLoadBalancerBgpPeer")); } if (peerAddress() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property peerAddress in model ServiceLoadBalancerBgpPeer")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property peerAddress in model ServiceLoadBalancerBgpPeer")); } } private static final ClientLogger LOGGER = new ClientLogger(ServiceLoadBalancerBgpPeer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("peerAddress", this.peerAddress); + jsonWriter.writeLongField("peerAsn", this.peerAsn); + jsonWriter.writeStringField("bfdEnabled", this.bfdEnabled == null ? null : this.bfdEnabled.toString()); + jsonWriter.writeStringField("bgpMultiHop", this.bgpMultiHop == null ? null : this.bgpMultiHop.toString()); + jsonWriter.writeStringField("holdTime", this.holdTime); + jsonWriter.writeStringField("keepAliveTime", this.keepAliveTime); + jsonWriter.writeNumberField("myAsn", this.myAsn); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeNumberField("peerPort", this.peerPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceLoadBalancerBgpPeer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceLoadBalancerBgpPeer 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 ServiceLoadBalancerBgpPeer. + */ + public static ServiceLoadBalancerBgpPeer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceLoadBalancerBgpPeer deserializedServiceLoadBalancerBgpPeer = new ServiceLoadBalancerBgpPeer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.name = reader.getString(); + } else if ("peerAddress".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.peerAddress = reader.getString(); + } else if ("peerAsn".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.peerAsn = reader.getLong(); + } else if ("bfdEnabled".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.bfdEnabled = BfdEnabled.fromString(reader.getString()); + } else if ("bgpMultiHop".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.bgpMultiHop = BgpMultiHop.fromString(reader.getString()); + } else if ("holdTime".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.holdTime = reader.getString(); + } else if ("keepAliveTime".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.keepAliveTime = reader.getString(); + } else if ("myAsn".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.myAsn = reader.getNullable(JsonReader::getLong); + } else if ("password".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.password = reader.getString(); + } else if ("peerPort".equals(fieldName)) { + deserializedServiceLoadBalancerBgpPeer.peerPort = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceLoadBalancerBgpPeer; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java index 66e2fb7f2b986..0dcd6fc87a47a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java @@ -6,45 +6,47 @@ 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; /** * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc * Appliance installation. */ @Fluent -public final class ServicePrincipalInformation { +public final class ServicePrincipalInformation implements JsonSerializable { /* * The application ID, also known as client ID, of the service principal. */ - @JsonProperty(value = "applicationId", required = true) private String applicationId; /* * The password of the service principal. */ - @JsonProperty(value = "password") private String password; /* * The principal ID, also known as the object ID, of the service principal. */ - @JsonProperty(value = "principalId", required = true) private String principalId; /* * The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. */ - @JsonProperty(value = "tenantId", required = true) private String tenantId; - /** Creates an instance of ServicePrincipalInformation class. */ + /** + * Creates an instance of ServicePrincipalInformation class. + */ public ServicePrincipalInformation() { } /** * Get the applicationId property: The application ID, also known as client ID, of the service principal. - * + * * @return the applicationId value. */ public String applicationId() { @@ -53,7 +55,7 @@ public String applicationId() { /** * Set the applicationId property: The application ID, also known as client ID, of the service principal. - * + * * @param applicationId the applicationId value to set. * @return the ServicePrincipalInformation object itself. */ @@ -64,7 +66,7 @@ public ServicePrincipalInformation withApplicationId(String applicationId) { /** * Get the password property: The password of the service principal. - * + * * @return the password value. */ public String password() { @@ -73,7 +75,7 @@ public String password() { /** * Set the password property: The password of the service principal. - * + * * @param password the password value to set. * @return the ServicePrincipalInformation object itself. */ @@ -84,7 +86,7 @@ public ServicePrincipalInformation withPassword(String password) { /** * Get the principalId property: The principal ID, also known as the object ID, of the service principal. - * + * * @return the principalId value. */ public String principalId() { @@ -93,7 +95,7 @@ public String principalId() { /** * Set the principalId property: The principal ID, also known as the object ID, of the service principal. - * + * * @param principalId the principalId value to set. * @return the ServicePrincipalInformation object itself. */ @@ -105,7 +107,7 @@ public ServicePrincipalInformation withPrincipalId(String principalId) { /** * Get the tenantId property: The tenant ID, also known as the directory ID, of the tenant in which the service * principal is created. - * + * * @return the tenantId value. */ public String tenantId() { @@ -115,7 +117,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant ID, also known as the directory ID, of the tenant in which the service * principal is created. - * + * * @param tenantId the tenantId value to set. * @return the ServicePrincipalInformation object itself. */ @@ -126,27 +128,77 @@ public ServicePrincipalInformation withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (applicationId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property applicationId in model ServicePrincipalInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property applicationId in model ServicePrincipalInformation")); } if (password() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property password in model ServicePrincipalInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property password in model ServicePrincipalInformation")); } if (principalId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property principalId in model ServicePrincipalInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property principalId in model ServicePrincipalInformation")); } if (tenantId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property tenantId in model ServicePrincipalInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tenantId in model ServicePrincipalInformation")); } } private static final ClientLogger LOGGER = new ClientLogger(ServicePrincipalInformation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationId", this.applicationId); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalInformation 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 ServicePrincipalInformation. + */ + public static ServicePrincipalInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalInformation deserializedServicePrincipalInformation = new ServicePrincipalInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationId".equals(fieldName)) { + deserializedServicePrincipalInformation.applicationId = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedServicePrincipalInformation.password = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedServicePrincipalInformation.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedServicePrincipalInformation.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalInformation; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java index 7613464ea9ce3..961df4fc1d0be 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. */ +/** + * The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. + */ public final class SkipShutdown extends ExpandableStringEnum { - /** Static value True for SkipShutdown. */ + /** + * Static value True for SkipShutdown. + */ public static final SkipShutdown TRUE = fromString("True"); - /** Static value False for SkipShutdown. */ + /** + * Static value False for SkipShutdown. + */ public static final SkipShutdown FALSE = fromString("False"); /** * Creates a new instance of SkipShutdown value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SkipShutdown() { /** * Creates or finds a SkipShutdown from its string representation. - * + * * @param name a name to look for. * @return the corresponding SkipShutdown. */ - @JsonCreator public static SkipShutdown fromString(String name) { return fromString(name, SkipShutdown.class); } /** * Gets known SkipShutdown values. - * + * * @return known SkipShutdown values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java index 1d2614c5329e2..76471e05b5fd4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java @@ -6,24 +6,31 @@ 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; -/** SshPublicKey represents the public key used to authenticate with a resource through SSH. */ +/** + * SshPublicKey represents the public key used to authenticate with a resource through SSH. + */ @Fluent -public final class SshPublicKey { +public final class SshPublicKey implements JsonSerializable { /* * The SSH public key data. */ - @JsonProperty(value = "keyData", required = true) private String keyData; - /** Creates an instance of SshPublicKey class. */ + /** + * Creates an instance of SshPublicKey class. + */ public SshPublicKey() { } /** * Get the keyData property: The SSH public key data. - * + * * @return the keyData value. */ public String keyData() { @@ -32,7 +39,7 @@ public String keyData() { /** * Set the keyData property: The SSH public key data. - * + * * @param keyData the keyData value to set. * @return the SshPublicKey object itself. */ @@ -43,15 +50,52 @@ public SshPublicKey withKeyData(String keyData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (keyData() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyData in model SshPublicKey")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyData in model SshPublicKey")); } } private static final ClientLogger LOGGER = new ClientLogger(SshPublicKey.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyData", this.keyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey 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 SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyData".equals(fieldName)) { + deserializedSshPublicKey.keyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java index 0ee6251332e63..a62151cf54bc7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java @@ -8,131 +8,144 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import java.util.List; import java.util.Map; -/** An immutable client-side representation of StorageAppliance. */ +/** + * An immutable client-side representation of StorageAppliance. + */ public interface StorageAppliance { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** - * Gets the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the - * device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Gets the administratorCredentials property: The credentials of the administrative interface on this storage + * appliance. + * * @return the administratorCredentials value. */ AdministrativeCredentials administratorCredentials(); /** - * Gets the capacity property: The total capacity of the storage appliance. - * + * Gets the capacity property: The total capacity of the storage appliance. Measured in GiB. + * * @return the capacity value. */ Long capacity(); /** * Gets the capacityUsed property: The amount of storage consumed. - * + * * @return the capacityUsed value. */ Long capacityUsed(); /** - * Gets the clusterId property: The resource ID of the cluster this storage appliance is associated with. - * + * Gets the clusterId property: The resource ID of the cluster this storage appliance is associated with. Measured + * in GiB. + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The detailed status of the storage appliance. - * + * * @return the detailedStatus value. */ StorageApplianceDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the managementIpv4Address property: The endpoint for the management interface of the storage appliance. - * + * * @return the managementIpv4Address value. */ String managementIpv4Address(); + /** + * Gets the manufacturer property: The manufacturer of the storage appliance. + * + * @return the manufacturer value. + */ + String manufacturer(); + + /** + * Gets the model property: The model of the storage appliance. + * + * @return the model value. + */ + String model(); + /** * Gets the provisioningState property: The provisioning state of the storage appliance. - * + * * @return the provisioningState value. */ StorageApplianceProvisioningState provisioningState(); /** * Gets the rackId property: The resource ID of the rack where this storage appliance resides. - * + * * @return the rackId value. */ String rackId(); /** * Gets the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. - * + * * @return the rackSlot value. */ long rackSlot(); @@ -140,7 +153,7 @@ public interface StorageAppliance { /** * Gets the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote * vendor management. - * + * * @return the remoteVendorManagementFeature value. */ RemoteVendorManagementFeature remoteVendorManagementFeature(); @@ -148,71 +161,93 @@ public interface StorageAppliance { /** * Gets the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is * enabled or disabled, or unsupported if it is an unsupported feature. - * + * * @return the remoteVendorManagementStatus value. */ RemoteVendorManagementStatus remoteVendorManagementStatus(); + /** + * Gets the secretRotationStatus property: The list of statuses that represent secret rotation activity. + * + * @return the secretRotationStatus value. + */ + List secretRotationStatus(); + /** * Gets the serialNumber property: The serial number for the storage appliance. - * + * * @return the serialNumber value. */ String serialNumber(); /** * Gets the storageApplianceSkuId property: The SKU for the storage appliance. - * + * * @return the storageApplianceSkuId value. */ String storageApplianceSkuId(); + /** + * Gets the version property: The version of the storage appliance. + * + * @return the version value. + */ + String version(); + /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner object. - * + * * @return the inner object. */ StorageApplianceInner innerModel(); - /** The entirety of the StorageAppliance definition. */ + /** + * The entirety of the StorageAppliance definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAdministratorCredentials, DefinitionStages.WithRackId, DefinitionStages.WithRackSlot, DefinitionStages.WithSerialNumber, DefinitionStages.WithStorageApplianceSkuId, DefinitionStages.WithCreate { } - /** The StorageAppliance definition stages. */ + /** + * The StorageAppliance definition stages. + */ interface DefinitionStages { - /** The first stage of the StorageAppliance definition. */ + /** + * The first stage of the StorageAppliance definition. + */ interface Blank extends WithLocation { } - /** The stage of the StorageAppliance definition allowing to specify location. */ + /** + * The stage of the StorageAppliance definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -220,95 +255,102 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the StorageAppliance definition allowing to specify parent resource. */ + /** + * The stage of the StorageAppliance definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the StorageAppliance definition allowing to specify extendedLocation. */ + /** + * The stage of the StorageAppliance definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithAdministratorCredentials withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the StorageAppliance definition allowing to specify administratorCredentials. */ + /** + * The stage of the StorageAppliance definition allowing to specify administratorCredentials. + */ interface WithAdministratorCredentials { /** - * Specifies the administratorCredentials property: AdministrativeCredentials represents the admin - * credentials for the device requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance.. - * - * @param administratorCredentials AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - *

The credentials of the administrative interface on this storage appliance. + * Specifies the administratorCredentials property: The credentials of the administrative interface on this + * storage appliance.. + * + * @param administratorCredentials The credentials of the administrative interface on this storage + * appliance. * @return the next definition stage. */ WithRackId withAdministratorCredentials(AdministrativeCredentials administratorCredentials); } - /** The stage of the StorageAppliance definition allowing to specify rackId. */ + /** + * The stage of the StorageAppliance definition allowing to specify rackId. + */ interface WithRackId { /** * Specifies the rackId property: The resource ID of the rack where this storage appliance resides.. - * + * * @param rackId The resource ID of the rack where this storage appliance resides. * @return the next definition stage. */ WithRackSlot withRackId(String rackId); } - /** The stage of the StorageAppliance definition allowing to specify rackSlot. */ + /** + * The stage of the StorageAppliance definition allowing to specify rackSlot. + */ interface WithRackSlot { /** * Specifies the rackSlot property: The slot the storage appliance is in the rack based on the BOM * configuration.. - * + * * @param rackSlot The slot the storage appliance is in the rack based on the BOM configuration. * @return the next definition stage. */ WithSerialNumber withRackSlot(long rackSlot); } - /** The stage of the StorageAppliance definition allowing to specify serialNumber. */ + /** + * The stage of the StorageAppliance definition allowing to specify serialNumber. + */ interface WithSerialNumber { /** * Specifies the serialNumber property: The serial number for the storage appliance.. - * + * * @param serialNumber The serial number for the storage appliance. * @return the next definition stage. */ WithStorageApplianceSkuId withSerialNumber(String serialNumber); } - /** The stage of the StorageAppliance definition allowing to specify storageApplianceSkuId. */ + /** + * The stage of the StorageAppliance definition allowing to specify storageApplianceSkuId. + */ interface WithStorageApplianceSkuId { /** * Specifies the storageApplianceSkuId property: The SKU for the storage appliance.. - * + * * @param storageApplianceSkuId The SKU for the storage appliance. * @return the next definition stage. */ @@ -322,25 +364,27 @@ interface WithStorageApplianceSkuId { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ StorageAppliance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ StorageAppliance create(Context context); } - /** The stage of the StorageAppliance definition allowing to specify tags. */ + /** + * The stage of the StorageAppliance definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -350,47 +394,55 @@ interface WithTags { /** * Begins update for the StorageAppliance resource. - * + * * @return the stage of resource update. */ StorageAppliance.Update update(); - /** The template for StorageAppliance update. */ + /** + * The template for StorageAppliance update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithSerialNumber { /** * Executes the update request. - * + * * @return the updated resource. */ StorageAppliance apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ StorageAppliance apply(Context context); } - /** The StorageAppliance update stages. */ + /** + * The StorageAppliance update stages. + */ interface UpdateStages { - /** The stage of the StorageAppliance update allowing to specify tags. */ + /** + * The stage of the StorageAppliance update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the StorageAppliance update allowing to specify serialNumber. */ + /** + * The stage of the StorageAppliance update allowing to specify serialNumber. + */ interface WithSerialNumber { /** * Specifies the serialNumber property: The serial number for the storage appliance.. - * + * * @param serialNumber The serial number for the storage appliance. * @return the next definition stage. */ @@ -400,14 +452,14 @@ interface WithSerialNumber { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ StorageAppliance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -415,9 +467,9 @@ interface WithSerialNumber { /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @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 current status of an async operation. @@ -426,9 +478,9 @@ interface WithSerialNumber { /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @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. @@ -439,9 +491,9 @@ interface WithSerialNumber { /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @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 current status of an async operation. @@ -450,9 +502,9 @@ interface WithSerialNumber { /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param storageApplianceEnableRemoteVendorManagementParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java index bc0325539866c..17c81727a2035 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java @@ -6,48 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** StorageApplianceConfigurationData represents configuration for the storage application. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * StorageApplianceConfigurationData represents configuration for the storage application. + */ @Fluent -public final class StorageApplianceConfigurationData { +public final class StorageApplianceConfigurationData implements JsonSerializable { /* - * AdministrativeCredentials represents the admin credentials for the device requiring password-based - * authentication. - * - * The credentials of the administrative interface on this storage appliance. + * The credentials of the administrative interface on this storage appliance. The password field is expected to be + * an Azure Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the secret + * archive settings, the actual password value should be provided instead. */ - @JsonProperty(value = "adminCredentials", required = true) private AdministrativeCredentials adminCredentials; /* * The slot that storage appliance is in the rack based on the BOM configuration. */ - @JsonProperty(value = "rackSlot", required = true) private long rackSlot; /* * The serial number of the appliance. */ - @JsonProperty(value = "serialNumber", required = true) private String serialNumber; /* * The user-provided name for the storage appliance that will be created from this specification. */ - @JsonProperty(value = "storageApplianceName") private String storageApplianceName; - /** Creates an instance of StorageApplianceConfigurationData class. */ + /** + * Creates an instance of StorageApplianceConfigurationData class. + */ public StorageApplianceConfigurationData() { } /** - * Get the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Get the adminCredentials property: The credentials of the administrative interface on this storage appliance. The + * password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to utilize managed + * identity by setting the secret archive settings, the actual password value should be provided instead. + * * @return the adminCredentials value. */ public AdministrativeCredentials adminCredentials() { @@ -55,11 +57,10 @@ public AdministrativeCredentials adminCredentials() { } /** - * Set the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device - * requiring password-based authentication. - * - *

The credentials of the administrative interface on this storage appliance. - * + * Set the adminCredentials property: The credentials of the administrative interface on this storage appliance. The + * password field is expected to be an Azure Key Vault key URL. Until the cluster is converted to utilize managed + * identity by setting the secret archive settings, the actual password value should be provided instead. + * * @param adminCredentials the adminCredentials value to set. * @return the StorageApplianceConfigurationData object itself. */ @@ -70,7 +71,7 @@ public StorageApplianceConfigurationData withAdminCredentials(AdministrativeCred /** * Get the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration. - * + * * @return the rackSlot value. */ public long rackSlot() { @@ -79,7 +80,7 @@ public long rackSlot() { /** * Set the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration. - * + * * @param rackSlot the rackSlot value to set. * @return the StorageApplianceConfigurationData object itself. */ @@ -90,7 +91,7 @@ public StorageApplianceConfigurationData withRackSlot(long rackSlot) { /** * Get the serialNumber property: The serial number of the appliance. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -99,7 +100,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number of the appliance. - * + * * @param serialNumber the serialNumber value to set. * @return the StorageApplianceConfigurationData object itself. */ @@ -111,7 +112,7 @@ public StorageApplianceConfigurationData withSerialNumber(String serialNumber) { /** * Get the storageApplianceName property: The user-provided name for the storage appliance that will be created from * this specification. - * + * * @return the storageApplianceName value. */ public String storageApplianceName() { @@ -121,7 +122,7 @@ public String storageApplianceName() { /** * Set the storageApplianceName property: The user-provided name for the storage appliance that will be created from * this specification. - * + * * @param storageApplianceName the storageApplianceName value to set. * @return the StorageApplianceConfigurationData object itself. */ @@ -132,21 +133,71 @@ public StorageApplianceConfigurationData withStorageApplianceName(String storage /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (adminCredentials() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property adminCredentials in model StorageApplianceConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property adminCredentials in model StorageApplianceConfigurationData")); } else { adminCredentials().validate(); } if (serialNumber() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property serialNumber in model StorageApplianceConfigurationData")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serialNumber in model StorageApplianceConfigurationData")); } } private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceConfigurationData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("adminCredentials", this.adminCredentials); + jsonWriter.writeLongField("rackSlot", this.rackSlot); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("storageApplianceName", this.storageApplianceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceConfigurationData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceConfigurationData 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 StorageApplianceConfigurationData. + */ + public static StorageApplianceConfigurationData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceConfigurationData deserializedStorageApplianceConfigurationData + = new StorageApplianceConfigurationData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminCredentials".equals(fieldName)) { + deserializedStorageApplianceConfigurationData.adminCredentials + = AdministrativeCredentials.fromJson(reader); + } else if ("rackSlot".equals(fieldName)) { + deserializedStorageApplianceConfigurationData.rackSlot = reader.getLong(); + } else if ("serialNumber".equals(fieldName)) { + deserializedStorageApplianceConfigurationData.serialNumber = reader.getString(); + } else if ("storageApplianceName".equals(fieldName)) { + deserializedStorageApplianceConfigurationData.storageApplianceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceConfigurationData; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java index 77c5a6fb010f4..d5652ae77f815 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java @@ -5,23 +5,35 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The detailed status of the storage appliance. */ +/** + * The detailed status of the storage appliance. + */ public final class StorageApplianceDetailedStatus extends ExpandableStringEnum { - /** Static value Error for StorageApplianceDetailedStatus. */ - public static final StorageApplianceDetailedStatus ERROR = fromString("Error"); - - /** Static value Available for StorageApplianceDetailedStatus. */ + /** + * Static value Available for StorageApplianceDetailedStatus. + */ public static final StorageApplianceDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for StorageApplianceDetailedStatus. */ + /** + * Static value Degraded for StorageApplianceDetailedStatus. + */ + public static final StorageApplianceDetailedStatus DEGRADED = fromString("Degraded"); + + /** + * Static value Error for StorageApplianceDetailedStatus. + */ + public static final StorageApplianceDetailedStatus ERROR = fromString("Error"); + + /** + * Static value Provisioning for StorageApplianceDetailedStatus. + */ public static final StorageApplianceDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of StorageApplianceDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +42,17 @@ public StorageApplianceDetailedStatus() { /** * Creates or finds a StorageApplianceDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding StorageApplianceDetailedStatus. */ - @JsonCreator public static StorageApplianceDetailedStatus fromString(String name) { return fromString(name, StorageApplianceDetailedStatus.class); } /** * Gets known StorageApplianceDetailedStatus values. - * + * * @return known StorageApplianceDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java index e5b867d66a7bd..8ed0ea3352e6d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.networkcloud.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; /** @@ -13,16 +17,18 @@ * management of a storage appliance. */ @Fluent -public final class StorageApplianceEnableRemoteVendorManagementParameters { +public final class StorageApplianceEnableRemoteVendorManagementParameters + implements JsonSerializable { /* * Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR - * format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to - * turn on the remote vendor management. + * format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn + * on the remote vendor management. */ - @JsonProperty(value = "supportEndpoints") private List supportEndpoints; - /** Creates an instance of StorageApplianceEnableRemoteVendorManagementParameters class. */ + /** + * Creates an instance of StorageApplianceEnableRemoteVendorManagementParameters class. + */ public StorageApplianceEnableRemoteVendorManagementParameters() { } @@ -30,7 +36,7 @@ public StorageApplianceEnableRemoteVendorManagementParameters() { * Get the supportEndpoints property: Field Deprecated. This field is not used and will be rejected if provided. The * list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance * needs accessible in order to turn on the remote vendor management. - * + * * @return the supportEndpoints value. */ public List supportEndpoints() { @@ -41,7 +47,7 @@ public List supportEndpoints() { * Set the supportEndpoints property: Field Deprecated. This field is not used and will be rejected if provided. The * list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance * needs accessible in order to turn on the remote vendor management. - * + * * @param supportEndpoints the supportEndpoints value to set. * @return the StorageApplianceEnableRemoteVendorManagementParameters object itself. */ @@ -52,9 +58,50 @@ public StorageApplianceEnableRemoteVendorManagementParameters withSupportEndpoin /** * 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.writeArrayField("supportEndpoints", this.supportEndpoints, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceEnableRemoteVendorManagementParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceEnableRemoteVendorManagementParameters 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 StorageApplianceEnableRemoteVendorManagementParameters. + */ + public static StorageApplianceEnableRemoteVendorManagementParameters fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceEnableRemoteVendorManagementParameters deserializedStorageApplianceEnableRemoteVendorManagementParameters + = new StorageApplianceEnableRemoteVendorManagementParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportEndpoints".equals(fieldName)) { + List supportEndpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedStorageApplianceEnableRemoteVendorManagementParameters.supportEndpoints + = supportEndpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceEnableRemoteVendorManagementParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java index 458a8b626def5..62197756a04e1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.StorageApplianceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** StorageApplianceList represents a list of storage appliances. */ +/** + * StorageApplianceList represents a list of storage appliances. + */ @Fluent -public final class StorageApplianceList { +public final class StorageApplianceList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of storage appliances. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of StorageApplianceList class. */ + /** + * Creates an instance of StorageApplianceList class. + */ public StorageApplianceList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the StorageApplianceList object itself. */ @@ -50,7 +56,7 @@ public StorageApplianceList withNextLink(String nextLink) { /** * Get the value property: The list of storage appliances. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of storage appliances. - * + * * @param value the value value to set. * @return the StorageApplianceList object itself. */ @@ -70,7 +76,7 @@ public StorageApplianceList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceList 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 StorageApplianceList. + */ + public static StorageApplianceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceList deserializedStorageApplianceList = new StorageApplianceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedStorageApplianceList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageApplianceInner.fromJson(reader1)); + deserializedStorageApplianceList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java index 5f766ced025ad..a50fac8138f78 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java @@ -5,39 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.StorageAppliancePatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. */ +/** + * StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + */ @Fluent -public final class StorageAppliancePatchParameters { +public final class StorageAppliancePatchParameters implements JsonSerializable { /* - * StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private StorageAppliancePatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of StorageAppliancePatchParameters class. */ + /** + * Creates an instance of StorageAppliancePatchParameters class. + */ public StorageAppliancePatchParameters() { } /** - * Get the innerProperties property: StorageAppliancePatchProperties represents the properties of the storage - * appliance that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private StorageAppliancePatchProperties innerProperties() { @@ -46,7 +45,7 @@ private StorageAppliancePatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the StorageAppliancePatchParameters object itself. */ @@ -66,7 +65,7 @@ public StorageAppliancePatchParameters withTags(Map tags) { /** * Get the serialNumber property: The serial number for the storage appliance. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -75,7 +74,7 @@ public String serialNumber() { /** * Set the serialNumber property: The serial number for the storage appliance. - * + * * @param serialNumber the serialNumber value to set. * @return the StorageAppliancePatchParameters object itself. */ @@ -89,7 +88,7 @@ public StorageAppliancePatchParameters withSerialNumber(String serialNumber) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -97,4 +96,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAppliancePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAppliancePatchParameters 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 StorageAppliancePatchParameters. + */ + public static StorageAppliancePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAppliancePatchParameters deserializedStorageAppliancePatchParameters + = new StorageAppliancePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageAppliancePatchParameters.innerProperties + = StorageAppliancePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAppliancePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAppliancePatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java index 184664b16cac3..4c71dd11ac5ba 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the storage appliance. */ +/** + * The provisioning state of the storage appliance. + */ public final class StorageApplianceProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for StorageApplianceProvisioningState. */ + /** + * Static value Succeeded for StorageApplianceProvisioningState. + */ public static final StorageApplianceProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for StorageApplianceProvisioningState. */ + /** + * Static value Failed for StorageApplianceProvisioningState. + */ public static final StorageApplianceProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for StorageApplianceProvisioningState. */ + /** + * Static value Canceled for StorageApplianceProvisioningState. + */ public static final StorageApplianceProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for StorageApplianceProvisioningState. */ + /** + * Static value Provisioning for StorageApplianceProvisioningState. + */ public static final StorageApplianceProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for StorageApplianceProvisioningState. */ + /** + * Static value Accepted for StorageApplianceProvisioningState. + */ public static final StorageApplianceProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of StorageApplianceProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public StorageApplianceProvisioningState() { /** * Creates or finds a StorageApplianceProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding StorageApplianceProvisioningState. */ - @JsonCreator public static StorageApplianceProvisioningState fromString(String name) { return fromString(name, StorageApplianceProvisioningState.class); } /** * Gets known StorageApplianceProvisioningState values. - * + * * @return known StorageApplianceProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java index 723c89c1552df..bc81fd9508214 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java @@ -5,36 +5,37 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.StorageApplianceSkuProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. */ +/** + * StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + */ @Immutable -public final class StorageApplianceSkuSlot { +public final class StorageApplianceSkuSlot implements JsonSerializable { /* - * StorageApplianceSkuProperties represents the properties of the storage appliance SKU. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private StorageApplianceSkuProperties innerProperties; /* * The position in the rack for the storage appliance. */ - @JsonProperty(value = "rackSlot", access = JsonProperty.Access.WRITE_ONLY) private Long rackSlot; - /** Creates an instance of StorageApplianceSkuSlot class. */ + /** + * Creates an instance of StorageApplianceSkuSlot class. + */ public StorageApplianceSkuSlot() { } /** - * Get the innerProperties property: StorageApplianceSkuProperties represents the properties of the storage - * appliance SKU. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private StorageApplianceSkuProperties innerProperties() { @@ -43,7 +44,7 @@ private StorageApplianceSkuProperties innerProperties() { /** * Get the rackSlot property: The position in the rack for the storage appliance. - * + * * @return the rackSlot value. */ public Long rackSlot() { @@ -51,8 +52,8 @@ public Long rackSlot() { } /** - * Get the capacityGB property: The maximum capacity of the storage appliance. - * + * Get the capacityGB property: The maximum capacity of the storage appliance. Measured in gibibytes. + * * @return the capacityGB value. */ public Long capacityGB() { @@ -61,7 +62,7 @@ public Long capacityGB() { /** * Get the model property: The model of the storage appliance. - * + * * @return the model value. */ public String model() { @@ -70,7 +71,7 @@ public String model() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +79,43 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageApplianceSkuSlot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageApplianceSkuSlot 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 StorageApplianceSkuSlot. + */ + public static StorageApplianceSkuSlot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageApplianceSkuSlot deserializedStorageApplianceSkuSlot = new StorageApplianceSkuSlot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageApplianceSkuSlot.innerProperties + = StorageApplianceSkuProperties.fromJson(reader); + } else if ("rackSlot".equals(fieldName)) { + deserializedStorageApplianceSkuSlot.rackSlot = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageApplianceSkuSlot; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java index 9075e1695bcfe..a0fb212972783 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java @@ -8,68 +8,70 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of StorageAppliances. */ +/** + * Resource collection API of StorageAppliances. + */ public interface StorageAppliances { /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List storage appliances in the subscription. - * - *

Get a list of storage appliances in the provided subscription. - * + * + * Get a list of storage appliances in the provided subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided subscription as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List storage appliances in the resource group. - * - *

Get a list of storage appliances in the provided resource group. - * + * + * Get a list of storage appliances in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of storage appliances in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of storage appliances in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -83,9 +85,9 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,38 +99,40 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String storageApplianceName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String storageApplianceName); /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String storageApplianceName, Context context); + OperationStatusResult delete(String resourceGroupName, String storageApplianceName, Context context); /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,9 +144,9 @@ Response getByResourceGroupWithResponse(String resourceGroupNa /** * Turn off remote vendor management for a storage appliance, if supported. - * - *

Disable remote vendor management of the provided storage appliance. - * + * + * Disable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param context The context to associate with this operation. @@ -156,9 +160,9 @@ OperationStatusResult disableRemoteVendorManagement(String resourceGroupName, St /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -170,9 +174,9 @@ OperationStatusResult disableRemoteVendorManagement(String resourceGroupName, St /** * Turn on remote vendor management for a storage appliance, if supported. - * - *

Enable remote vendor management of the provided storage appliance. - * + * + * Enable remote vendor management of the provided storage appliance. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageApplianceName The name of the storage appliance. * @param storageApplianceEnableRemoteVendorManagementParameters The request body. @@ -188,9 +192,9 @@ OperationStatusResult enableRemoteVendorManagement(String resourceGroupName, Str /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -201,9 +205,9 @@ OperationStatusResult enableRemoteVendorManagement(String resourceGroupName, Str /** * Retrieve the storage appliance. - * - *

Get properties of the provided storage appliance. - * + * + * Get properties of the provided storage appliance. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -215,34 +219,36 @@ OperationStatusResult enableRemoteVendorManagement(String resourceGroupName, Str /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the storage appliance. - * - *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of - * this resource is managed by the system. - * + * + * Delete the provided storage appliance. + * All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new StorageAppliance resource. - * + * * @param name resource name. * @return the first stage of the new StorageAppliance definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java index fba2b6d375ad4..a7bcf914a4584 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java @@ -6,35 +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; -/** StorageProfile represents information about a disk. */ +/** + * StorageProfile represents information about a disk. + */ @Fluent -public final class StorageProfile { +public final class StorageProfile implements JsonSerializable { /* - * OsDisk represents configuration of the boot disk. - * * The disk to use with this virtual machine. */ - @JsonProperty(value = "osDisk", required = true) private OsDisk osDisk; /* * The resource IDs of volumes that are requested to be attached to the virtual machine. */ - @JsonProperty(value = "volumeAttachments") private List volumeAttachments; - /** Creates an instance of StorageProfile class. */ + /** + * Creates an instance of StorageProfile class. + */ public StorageProfile() { } /** - * Get the osDisk property: OsDisk represents configuration of the boot disk. - * - *

The disk to use with this virtual machine. - * + * Get the osDisk property: The disk to use with this virtual machine. + * * @return the osDisk value. */ public OsDisk osDisk() { @@ -42,10 +44,8 @@ public OsDisk osDisk() { } /** - * Set the osDisk property: OsDisk represents configuration of the boot disk. - * - *

The disk to use with this virtual machine. - * + * Set the osDisk property: The disk to use with this virtual machine. + * * @param osDisk the osDisk value to set. * @return the StorageProfile object itself. */ @@ -57,7 +57,7 @@ public StorageProfile withOsDisk(OsDisk osDisk) { /** * Get the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual * machine. - * + * * @return the volumeAttachments value. */ public List volumeAttachments() { @@ -67,7 +67,7 @@ public List volumeAttachments() { /** * Set the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual * machine. - * + * * @param volumeAttachments the volumeAttachments value to set. * @return the StorageProfile object itself. */ @@ -78,17 +78,59 @@ public StorageProfile withVolumeAttachments(List volumeAttachments) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (osDisk() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property osDisk in model StorageProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property osDisk in model StorageProfile")); } else { osDisk().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(StorageProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("osDisk", this.osDisk); + jsonWriter.writeArrayField("volumeAttachments", this.volumeAttachments, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfile 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 StorageProfile. + */ + public static StorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfile deserializedStorageProfile = new StorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osDisk".equals(fieldName)) { + deserializedStorageProfile.osDisk = OsDisk.fromJson(reader); + } else if ("volumeAttachments".equals(fieldName)) { + List volumeAttachments = reader.readArray(reader1 -> reader1.getString()); + deserializedStorageProfile.volumeAttachments = volumeAttachments; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfile; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StringKeyValuePair.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StringKeyValuePair.java new file mode 100644 index 0000000000000..ff0b5c91a938a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StringKeyValuePair.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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; + +/** + * StringKeyValuePair represents a single entry in a mapping of keys to values. + */ +@Fluent +public final class StringKeyValuePair implements JsonSerializable { + /* + * The key to the mapped value. + */ + private String key; + + /* + * The value of the mapping key. + */ + private String value; + + /** + * Creates an instance of StringKeyValuePair class. + */ + public StringKeyValuePair() { + } + + /** + * Get the key property: The key to the mapped value. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key to the mapped value. + * + * @param key the key value to set. + * @return the StringKeyValuePair object itself. + */ + public StringKeyValuePair withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of the mapping key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the mapping key. + * + * @param value the value value to set. + * @return the StringKeyValuePair object itself. + */ + public StringKeyValuePair withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (key() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property key in model StringKeyValuePair")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model StringKeyValuePair")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StringKeyValuePair.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StringKeyValuePair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StringKeyValuePair 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 StringKeyValuePair. + */ + public static StringKeyValuePair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StringKeyValuePair deserializedStringKeyValuePair = new StringKeyValuePair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedStringKeyValuePair.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedStringKeyValuePair.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStringKeyValuePair; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java index d700f518b5a21..6c87f707fe617 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of TrunkedNetwork. */ +/** + * An immutable client-side representation of TrunkedNetwork. + */ public interface TrunkedNetwork { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,7 +67,7 @@ public interface TrunkedNetwork { /** * Gets the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources * that have attached this network. - * + * * @return the associatedResourceIds value. */ List associatedResourceIds(); @@ -76,21 +75,21 @@ public interface TrunkedNetwork { /** * Gets the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated * with. - * + * * @return the clusterId value. */ String clusterId(); /** * Gets the detailedStatus property: The more detailed status of the trunked network. - * + * * @return the detailedStatus value. */ TrunkedNetworkDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -98,7 +97,7 @@ public interface TrunkedNetwork { /** * Gets the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list * of Hybrid AKS cluster resource IDs that are associated with this trunked network. - * + * * @return the hybridAksClustersAssociatedIds value. */ List hybridAksClustersAssociatedIds(); @@ -106,7 +105,7 @@ public interface TrunkedNetwork { /** * Gets the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no * defined behavior and will be ignored. The network plugin type for Hybrid AKS. - * + * * @return the hybridAksPluginType value. */ HybridAksPluginType hybridAksPluginType(); @@ -114,7 +113,7 @@ public interface TrunkedNetwork { /** * Gets the interfaceName property: The default interface name for this trunked network in the virtual machine. This * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. - * + * * @return the interfaceName value. */ String interfaceName(); @@ -122,14 +121,14 @@ public interface TrunkedNetwork { /** * Gets the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. - * + * * @return the isolationDomainIds value. */ List isolationDomainIds(); /** * Gets the provisioningState property: The provisioning state of the trunked network. - * + * * @return the provisioningState value. */ TrunkedNetworkProvisioningState provisioningState(); @@ -138,63 +137,71 @@ public interface TrunkedNetwork { * Gets the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked * network. - * + * * @return the virtualMachinesAssociatedIds value. */ List virtualMachinesAssociatedIds(); /** * Gets the vlans property: The list of vlans that are selected from the isolation domains for trunking. - * + * * @return the vlans value. */ List vlans(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner object. - * + * * @return the inner object. */ TrunkedNetworkInner innerModel(); - /** The entirety of the TrunkedNetwork definition. */ + /** + * The entirety of the TrunkedNetwork definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithIsolationDomainIds, DefinitionStages.WithVlans, DefinitionStages.WithCreate { } - /** The TrunkedNetwork definition stages. */ + /** + * The TrunkedNetwork definition stages. + */ interface DefinitionStages { - /** The first stage of the TrunkedNetwork definition. */ + /** + * The first stage of the TrunkedNetwork definition. + */ interface Blank extends WithLocation { } - /** The stage of the TrunkedNetwork definition allowing to specify location. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -202,59 +209,63 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the TrunkedNetwork definition allowing to specify parent resource. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the TrunkedNetwork definition allowing to specify extendedLocation. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithIsolationDomainIds withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the TrunkedNetwork definition allowing to specify isolationDomainIds. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify isolationDomainIds. + */ interface WithIsolationDomainIds { /** * Specifies the isolationDomainIds property: The list of resource IDs representing the Network Fabric * isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.. - * + * * @param isolationDomainIds The list of resource IDs representing the Network Fabric isolation domains. It - * can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * can be any combination of l2IsolationDomain and l3IsolationDomain resources. * @return the next definition stage. */ WithVlans withIsolationDomainIds(List isolationDomainIds); } - /** The stage of the TrunkedNetwork definition allowing to specify vlans. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify vlans. + */ interface WithVlans { /** * Specifies the vlans property: The list of vlans that are selected from the isolation domains for * trunking.. - * + * * @param vlans The list of vlans that are selected from the isolation domains for trunking. * @return the next definition stage. */ @@ -269,54 +280,60 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithHyb DefinitionStages.WithInterfaceName { /** * Executes the create request. - * + * * @return the created resource. */ TrunkedNetwork create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ TrunkedNetwork create(Context context); } - /** The stage of the TrunkedNetwork definition allowing to specify tags. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the TrunkedNetwork definition allowing to specify hybridAksPluginType. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify hybridAksPluginType. + */ interface WithHybridAksPluginType { /** * Specifies the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it * will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.. - * + * * @param hybridAksPluginType Field Deprecated. The field was previously optional, now it will have no - * defined behavior and will be ignored. The network plugin type for Hybrid AKS. + * defined behavior and will be ignored. The network plugin type for Hybrid AKS. * @return the next definition stage. */ WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); } - /** The stage of the TrunkedNetwork definition allowing to specify interfaceName. */ + /** + * The stage of the TrunkedNetwork definition allowing to specify interfaceName. + */ interface WithInterfaceName { /** * Specifies the interfaceName property: The default interface name for this trunked network in the virtual * machine. This name can be overridden by the name supplied in the network attachment configuration of that * virtual machine.. - * + * * @param interfaceName The default interface name for this trunked network in the virtual machine. This - * name can be overridden by the name supplied in the network attachment configuration of that virtual - * machine. + * name can be overridden by the name supplied in the network attachment configuration of that virtual + * machine. * @return the next definition stage. */ WithCreate withInterfaceName(String interfaceName); @@ -325,36 +342,42 @@ interface WithInterfaceName { /** * Begins update for the TrunkedNetwork resource. - * + * * @return the stage of resource update. */ TrunkedNetwork.Update update(); - /** The template for TrunkedNetwork update. */ + /** + * The template for TrunkedNetwork update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ TrunkedNetwork apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ TrunkedNetwork apply(Context context); } - /** The TrunkedNetwork update stages. */ + /** + * The TrunkedNetwork update stages. + */ interface UpdateStages { - /** The stage of the TrunkedNetwork update allowing to specify tags. */ + /** + * The stage of the TrunkedNetwork update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ @@ -364,14 +387,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ TrunkedNetwork refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkAttachmentConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkAttachmentConfiguration.java index 6d519ce41e5a6..ea903a6134a53 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkAttachmentConfiguration.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkAttachmentConfiguration.java @@ -6,30 +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; -/** TrunkedNetworkAttachmentConfiguration represents the configuration of the attachment of a trunked network. */ +/** + * TrunkedNetworkAttachmentConfiguration represents the configuration of the attachment of a trunked network. + */ @Fluent -public final class TrunkedNetworkAttachmentConfiguration { +public final class TrunkedNetworkAttachmentConfiguration + implements JsonSerializable { /* * The resource ID of the network that is being configured for attachment. */ - @JsonProperty(value = "networkId", required = true) private String networkId; /* * The indicator of how this network will be utilized by the Kubernetes cluster. */ - @JsonProperty(value = "pluginType") private KubernetesPluginType pluginType; - /** Creates an instance of TrunkedNetworkAttachmentConfiguration class. */ + /** + * Creates an instance of TrunkedNetworkAttachmentConfiguration class. + */ public TrunkedNetworkAttachmentConfiguration() { } /** * Get the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @return the networkId value. */ public String networkId() { @@ -38,7 +45,7 @@ public String networkId() { /** * Set the networkId property: The resource ID of the network that is being configured for attachment. - * + * * @param networkId the networkId value to set. * @return the TrunkedNetworkAttachmentConfiguration object itself. */ @@ -49,7 +56,7 @@ public TrunkedNetworkAttachmentConfiguration withNetworkId(String networkId) { /** * Get the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @return the pluginType value. */ public KubernetesPluginType pluginType() { @@ -58,7 +65,7 @@ public KubernetesPluginType pluginType() { /** * Set the pluginType property: The indicator of how this network will be utilized by the Kubernetes cluster. - * + * * @param pluginType the pluginType value to set. * @return the TrunkedNetworkAttachmentConfiguration object itself. */ @@ -69,15 +76,58 @@ public TrunkedNetworkAttachmentConfiguration withPluginType(KubernetesPluginType /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (networkId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property networkId in model TrunkedNetworkAttachmentConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkId in model TrunkedNetworkAttachmentConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworkAttachmentConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkId", this.networkId); + jsonWriter.writeStringField("pluginType", this.pluginType == null ? null : this.pluginType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrunkedNetworkAttachmentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrunkedNetworkAttachmentConfiguration 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 TrunkedNetworkAttachmentConfiguration. + */ + public static TrunkedNetworkAttachmentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrunkedNetworkAttachmentConfiguration deserializedTrunkedNetworkAttachmentConfiguration + = new TrunkedNetworkAttachmentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkId".equals(fieldName)) { + deserializedTrunkedNetworkAttachmentConfiguration.networkId = reader.getString(); + } else if ("pluginType".equals(fieldName)) { + deserializedTrunkedNetworkAttachmentConfiguration.pluginType + = KubernetesPluginType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTrunkedNetworkAttachmentConfiguration; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java index a090bdc911879..85a3117b98851 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the trunked network. */ +/** + * The more detailed status of the trunked network. + */ public final class TrunkedNetworkDetailedStatus extends ExpandableStringEnum { - /** Static value Error for TrunkedNetworkDetailedStatus. */ + /** + * Static value Error for TrunkedNetworkDetailedStatus. + */ public static final TrunkedNetworkDetailedStatus ERROR = fromString("Error"); - /** Static value Available for TrunkedNetworkDetailedStatus. */ + /** + * Static value Available for TrunkedNetworkDetailedStatus. + */ public static final TrunkedNetworkDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Provisioning for TrunkedNetworkDetailedStatus. */ + /** + * Static value Provisioning for TrunkedNetworkDetailedStatus. + */ public static final TrunkedNetworkDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of TrunkedNetworkDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public TrunkedNetworkDetailedStatus() { /** * Creates or finds a TrunkedNetworkDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding TrunkedNetworkDetailedStatus. */ - @JsonCreator public static TrunkedNetworkDetailedStatus fromString(String name) { return fromString(name, TrunkedNetworkDetailedStatus.class); } /** * Gets known TrunkedNetworkDetailedStatus values. - * + * * @return known TrunkedNetworkDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java index 4f184604726a2..adfca50fff8b0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.TrunkedNetworkInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** TrunkedNetworkList represents a list of trunked networks. */ +/** + * TrunkedNetworkList represents a list of trunked networks. + */ @Fluent -public final class TrunkedNetworkList { +public final class TrunkedNetworkList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of trunked networks. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of TrunkedNetworkList class. */ + /** + * Creates an instance of TrunkedNetworkList class. + */ public TrunkedNetworkList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the TrunkedNetworkList object itself. */ @@ -50,7 +56,7 @@ public TrunkedNetworkList withNextLink(String nextLink) { /** * Get the value property: The list of trunked networks. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of trunked networks. - * + * * @param value the value value to set. * @return the TrunkedNetworkList object itself. */ @@ -70,7 +76,7 @@ public TrunkedNetworkList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrunkedNetworkList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrunkedNetworkList 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 TrunkedNetworkList. + */ + public static TrunkedNetworkList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrunkedNetworkList deserializedTrunkedNetworkList = new TrunkedNetworkList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedTrunkedNetworkList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TrunkedNetworkInner.fromJson(reader1)); + deserializedTrunkedNetworkList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedTrunkedNetworkList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java index 708afa433d568..474a305dd7901 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. */ +/** + * TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. + */ @Fluent -public final class TrunkedNetworkPatchParameters { +public final class TrunkedNetworkPatchParameters implements JsonSerializable { /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of TrunkedNetworkPatchParameters class. */ + /** + * Creates an instance of TrunkedNetworkPatchParameters class. + */ public TrunkedNetworkPatchParameters() { } /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the TrunkedNetworkPatchParameters object itself. */ @@ -45,9 +50,47 @@ public TrunkedNetworkPatchParameters withTags(Map tags) { /** * 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.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrunkedNetworkPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrunkedNetworkPatchParameters 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 TrunkedNetworkPatchParameters. + */ + public static TrunkedNetworkPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrunkedNetworkPatchParameters deserializedTrunkedNetworkPatchParameters + = new TrunkedNetworkPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTrunkedNetworkPatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTrunkedNetworkPatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java index d24fe21e6c093..4fa946ee377f4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the trunked network. */ +/** + * The provisioning state of the trunked network. + */ public final class TrunkedNetworkProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for TrunkedNetworkProvisioningState. */ + /** + * Static value Succeeded for TrunkedNetworkProvisioningState. + */ public static final TrunkedNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for TrunkedNetworkProvisioningState. */ + /** + * Static value Failed for TrunkedNetworkProvisioningState. + */ public static final TrunkedNetworkProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for TrunkedNetworkProvisioningState. */ + /** + * Static value Canceled for TrunkedNetworkProvisioningState. + */ public static final TrunkedNetworkProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for TrunkedNetworkProvisioningState. */ + /** + * Static value Provisioning for TrunkedNetworkProvisioningState. + */ public static final TrunkedNetworkProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for TrunkedNetworkProvisioningState. */ + /** + * Static value Accepted for TrunkedNetworkProvisioningState. + */ public static final TrunkedNetworkProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of TrunkedNetworkProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public TrunkedNetworkProvisioningState() { /** * Creates or finds a TrunkedNetworkProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding TrunkedNetworkProvisioningState. */ - @JsonCreator public static TrunkedNetworkProvisioningState fromString(String name) { return fromString(name, TrunkedNetworkProvisioningState.class); } /** * Gets known TrunkedNetworkProvisioningState values. - * + * * @return known TrunkedNetworkProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java index ef1ddb6265734..28615f5591830 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of TrunkedNetworks. */ +/** + * Resource collection API of TrunkedNetworks. + */ public interface TrunkedNetworks { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface TrunkedNetworks { /** * List trunked networks in the subscription. - * - *

Get a list of trunked networks in the provided subscription. - * + * + * Get a list of trunked networks in the provided subscription. + * * @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. @@ -36,38 +38,38 @@ public interface TrunkedNetworks { /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List trunked networks in the resource group. - * - *

Get a list of trunked networks in the provided resource group. - * + * + * Get a list of trunked networks in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of trunked networks in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of trunked networks in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @param context The context to associate with this operation. @@ -81,9 +83,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,36 +97,38 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName); /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param trunkedNetworkName The name of the trunked network. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String trunkedNetworkName, Context context); + OperationStatusResult delete(String resourceGroupName, String trunkedNetworkName, Context context); /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -135,9 +139,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the trunked network. - * - *

Get properties of the provided trunked network. - * + * + * Get properties of the provided trunked network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -149,32 +153,34 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the trunked network. - * - *

Delete the provided trunked network. - * + * + * Delete the provided trunked network. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new TrunkedNetwork resource. - * + * * @param name resource name. * @return the first stage of the new TrunkedNetwork definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/UserAssignedIdentity.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..e93c47ce1edc0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.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 java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java index 3e88f2c5615ee..c2b15defb5627 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java @@ -6,36 +6,41 @@ 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; -/** ValidationThreshold indicates allowed machine and node hardware and deployment failures. */ +/** + * ValidationThreshold indicates allowed machine and node hardware and deployment failures. + */ @Fluent -public final class ValidationThreshold { +public final class ValidationThreshold implements JsonSerializable { /* * Selection of how the type evaluation is applied to the cluster calculation. */ - @JsonProperty(value = "grouping", required = true) private ValidationThresholdGrouping grouping; /* * Selection of how the threshold should be evaluated. */ - @JsonProperty(value = "type", required = true) private ValidationThresholdType type; /* * The numeric threshold value. */ - @JsonProperty(value = "value", required = true) private long value; - /** Creates an instance of ValidationThreshold class. */ + /** + * Creates an instance of ValidationThreshold class. + */ public ValidationThreshold() { } /** * Get the grouping property: Selection of how the type evaluation is applied to the cluster calculation. - * + * * @return the grouping value. */ public ValidationThresholdGrouping grouping() { @@ -44,7 +49,7 @@ public ValidationThresholdGrouping grouping() { /** * Set the grouping property: Selection of how the type evaluation is applied to the cluster calculation. - * + * * @param grouping the grouping value to set. * @return the ValidationThreshold object itself. */ @@ -55,7 +60,7 @@ public ValidationThreshold withGrouping(ValidationThresholdGrouping grouping) { /** * Get the type property: Selection of how the threshold should be evaluated. - * + * * @return the type value. */ public ValidationThresholdType type() { @@ -64,7 +69,7 @@ public ValidationThresholdType type() { /** * Set the type property: Selection of how the threshold should be evaluated. - * + * * @param type the type value to set. * @return the ValidationThreshold object itself. */ @@ -75,7 +80,7 @@ public ValidationThreshold withType(ValidationThresholdType type) { /** * Get the value property: The numeric threshold value. - * + * * @return the value value. */ public long value() { @@ -84,7 +89,7 @@ public long value() { /** * Set the value property: The numeric threshold value. - * + * * @param value the value value to set. * @return the ValidationThreshold object itself. */ @@ -95,19 +100,63 @@ public ValidationThreshold withValue(long value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (grouping() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property grouping in model ValidationThreshold")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property grouping in model ValidationThreshold")); } if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ValidationThreshold")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ValidationThreshold")); } } private static final ClientLogger LOGGER = new ClientLogger(ValidationThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("grouping", this.grouping == null ? null : this.grouping.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeLongField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationThreshold 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 ValidationThreshold. + */ + public static ValidationThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationThreshold deserializedValidationThreshold = new ValidationThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("grouping".equals(fieldName)) { + deserializedValidationThreshold.grouping + = ValidationThresholdGrouping.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedValidationThreshold.type = ValidationThresholdType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedValidationThreshold.value = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationThreshold; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java index 4c09228d2e8d3..9a1d9412f112f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Selection of how the type evaluation is applied to the cluster calculation. */ +/** + * Selection of how the type evaluation is applied to the cluster calculation. + */ public final class ValidationThresholdGrouping extends ExpandableStringEnum { - /** Static value PerCluster for ValidationThresholdGrouping. */ + /** + * Static value PerCluster for ValidationThresholdGrouping. + */ public static final ValidationThresholdGrouping PER_CLUSTER = fromString("PerCluster"); - /** Static value PerRack for ValidationThresholdGrouping. */ + /** + * Static value PerRack for ValidationThresholdGrouping. + */ public static final ValidationThresholdGrouping PER_RACK = fromString("PerRack"); /** * Creates a new instance of ValidationThresholdGrouping value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ValidationThresholdGrouping() { /** * Creates or finds a ValidationThresholdGrouping from its string representation. - * + * * @param name a name to look for. * @return the corresponding ValidationThresholdGrouping. */ - @JsonCreator public static ValidationThresholdGrouping fromString(String name) { return fromString(name, ValidationThresholdGrouping.class); } /** * Gets known ValidationThresholdGrouping values. - * + * * @return known ValidationThresholdGrouping values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java index 59b5a9e9c7566..be1c070383b35 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Selection of how the threshold should be evaluated. */ +/** + * Selection of how the threshold should be evaluated. + */ public final class ValidationThresholdType extends ExpandableStringEnum { - /** Static value CountSuccess for ValidationThresholdType. */ + /** + * Static value CountSuccess for ValidationThresholdType. + */ public static final ValidationThresholdType COUNT_SUCCESS = fromString("CountSuccess"); - /** Static value PercentSuccess for ValidationThresholdType. */ + /** + * Static value PercentSuccess for ValidationThresholdType. + */ public static final ValidationThresholdType PERCENT_SUCCESS = fromString("PercentSuccess"); /** * Creates a new instance of ValidationThresholdType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ValidationThresholdType() { /** * Creates or finds a ValidationThresholdType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ValidationThresholdType. */ - @JsonCreator public static ValidationThresholdType fromString(String name) { return fromString(name, ValidationThresholdType.class); } /** * Gets known ValidationThresholdType values. - * + * * @return known ValidationThresholdType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java index 62d95327d8218..b363d5cf046d6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of VirtualMachine. */ +/** + * An immutable client-side representation of VirtualMachine. + */ public interface VirtualMachine { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,66 +67,71 @@ public interface VirtualMachine { /** * Gets the adminUsername property: The name of the administrator to which the ssh public keys will be added into * the authorized keys. - * + * * @return the adminUsername value. */ String adminUsername(); /** * Gets the availabilityZone property: The cluster availability zone containing this virtual machine. - * + * * @return the availabilityZone value. */ String availabilityZone(); /** - * Gets the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed - * to. - * + * Gets the bareMetalMachineId property: The resource ID of the bare metal machine that hosts the virtual machine. + * * @return the bareMetalMachineId value. */ String bareMetalMachineId(); /** * Gets the bootMethod property: Selects the boot method for the virtual machine. - * + * * @return the bootMethod value. */ VirtualMachineBootMethod bootMethod(); /** - * Gets the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine. - * + * Gets the cloudServicesNetworkAttachment property: The cloud service network that provides platform-level services + * for the virtual machine. + * * @return the cloudServicesNetworkAttachment value. */ NetworkAttachment cloudServicesNetworkAttachment(); /** * Gets the clusterId property: The resource ID of the cluster the virtual machine is created for. - * + * * @return the clusterId value. */ String clusterId(); + /** + * Gets the consoleExtendedLocation property: The extended location to use for creation of a VM console resource. + * + * @return the consoleExtendedLocation value. + */ + ExtendedLocation consoleExtendedLocation(); + /** * Gets the cpuCores property: The number of CPU cores in the virtual machine. - * + * * @return the cpuCores value. */ long cpuCores(); /** * Gets the detailedStatus property: The more detailed status of the virtual machine. - * + * * @return the detailedStatus value. */ VirtualMachineDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); @@ -135,49 +139,49 @@ public interface VirtualMachine { /** * Gets the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator * of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. - * + * * @return the isolateEmulatorThread value. */ VirtualMachineIsolateEmulatorThread isolateEmulatorThread(); /** - * Gets the memorySizeGB property: The memory size of the virtual machine in GB. - * + * Gets the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in gibibytes. + * * @return the memorySizeGB value. */ long memorySizeGB(); /** * Gets the networkAttachments property: The list of network attachments to the virtual machine. - * + * * @return the networkAttachments value. */ List networkAttachments(); /** * Gets the networkData property: The Base64 encoded cloud-init network data. - * + * * @return the networkData value. */ String networkData(); /** * Gets the placementHints property: The scheduling hints for the virtual machine. - * + * * @return the placementHints value. */ List placementHints(); /** * Gets the powerState property: The power state of the virtual machine. - * + * * @return the powerState value. */ VirtualMachinePowerState powerState(); /** * Gets the provisioningState property: The provisioning state of the virtual machine. - * + * * @return the provisioningState value. */ VirtualMachineProvisioningState provisioningState(); @@ -185,23 +189,22 @@ public interface VirtualMachine { /** * Gets the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using * the cloud-init ssh_authorized_keys mechanism for the adminUsername. - * + * * @return the sshPublicKeys value. */ List sshPublicKeys(); /** - * Gets the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. - * + * Gets the storageProfile property: The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. + * * @return the storageProfile value. */ StorageProfile storageProfile(); /** * Gets the userData property: The Base64 encoded cloud-init user data. - * + * * @return the userData value. */ String userData(); @@ -209,14 +212,14 @@ public interface VirtualMachine { /** * Gets the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio * interface. - * + * * @return the virtioInterface value. */ VirtualMachineVirtioInterfaceType virtioInterface(); /** * Gets the vmDeviceModel property: The type of the device model to use. - * + * * @return the vmDeviceModel value. */ VirtualMachineDeviceModelType vmDeviceModel(); @@ -224,57 +227,57 @@ public interface VirtualMachine { /** * Gets the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full * url and tag notation used to pull the image. - * + * * @return the vmImage value. */ String vmImage(); /** - * Gets the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Gets the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @return the vmImageRepositoryCredentials value. */ ImageRepositoryCredentials vmImageRepositoryCredentials(); /** * Gets the volumes property: The resource IDs of volumes that are attached to the virtual machine. - * + * * @return the volumes value. */ List volumes(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner object. - * + * * @return the inner object. */ VirtualMachineInner innerModel(); - /** The entirety of the VirtualMachine definition. */ + /** + * The entirety of the VirtualMachine definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithAdminUsername, DefinitionStages.WithCloudServicesNetworkAttachment, DefinitionStages.WithCpuCores, @@ -282,17 +285,23 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocati DefinitionStages.WithCreate { } - /** The VirtualMachine definition stages. */ + /** + * The VirtualMachine definition stages. + */ interface DefinitionStages { - /** The first stage of the VirtualMachine definition. */ + /** + * The first stage of the VirtualMachine definition. + */ interface Blank extends WithLocation { } - /** The stage of the VirtualMachine definition allowing to specify location. */ + /** + * The stage of the VirtualMachine definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -300,114 +309,122 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the VirtualMachine definition allowing to specify parent resource. */ + /** + * The stage of the VirtualMachine definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the VirtualMachine definition allowing to specify extendedLocation. */ + /** + * The stage of the VirtualMachine definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithAdminUsername withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the VirtualMachine definition allowing to specify adminUsername. */ + /** + * The stage of the VirtualMachine definition allowing to specify adminUsername. + */ interface WithAdminUsername { /** * Specifies the adminUsername property: The name of the administrator to which the ssh public keys will be * added into the authorized keys.. - * + * * @param adminUsername The name of the administrator to which the ssh public keys will be added into the - * authorized keys. + * authorized keys. * @return the next definition stage. */ WithCloudServicesNetworkAttachment withAdminUsername(String adminUsername); } - /** The stage of the VirtualMachine definition allowing to specify cloudServicesNetworkAttachment. */ + /** + * The stage of the VirtualMachine definition allowing to specify cloudServicesNetworkAttachment. + */ interface WithCloudServicesNetworkAttachment { /** - * Specifies the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network - * attachment. - * - *

The cloud service network that provides platform-level services for the virtual machine.. - * - * @param cloudServicesNetworkAttachment NetworkAttachment represents the single network attachment. - *

The cloud service network that provides platform-level services for the virtual machine. + * Specifies the cloudServicesNetworkAttachment property: The cloud service network that provides + * platform-level services for the virtual machine.. + * + * @param cloudServicesNetworkAttachment The cloud service network that provides platform-level services for + * the virtual machine. * @return the next definition stage. */ WithCpuCores withCloudServicesNetworkAttachment(NetworkAttachment cloudServicesNetworkAttachment); } - /** The stage of the VirtualMachine definition allowing to specify cpuCores. */ + /** + * The stage of the VirtualMachine definition allowing to specify cpuCores. + */ interface WithCpuCores { /** * Specifies the cpuCores property: The number of CPU cores in the virtual machine.. - * + * * @param cpuCores The number of CPU cores in the virtual machine. * @return the next definition stage. */ WithMemorySizeGB withCpuCores(long cpuCores); } - /** The stage of the VirtualMachine definition allowing to specify memorySizeGB. */ + /** + * The stage of the VirtualMachine definition allowing to specify memorySizeGB. + */ interface WithMemorySizeGB { /** - * Specifies the memorySizeGB property: The memory size of the virtual machine in GB.. - * - * @param memorySizeGB The memory size of the virtual machine in GB. + * Specifies the memorySizeGB property: The memory size of the virtual machine. Allocations are measured in + * gibibytes.. + * + * @param memorySizeGB The memory size of the virtual machine. Allocations are measured in gibibytes. * @return the next definition stage. */ WithStorageProfile withMemorySizeGB(long memorySizeGB); } - /** The stage of the VirtualMachine definition allowing to specify storageProfile. */ + /** + * The stage of the VirtualMachine definition allowing to specify storageProfile. + */ interface WithStorageProfile { /** - * Specifies the storageProfile property: StorageProfile represents information about a disk. - * - *

The storage profile that specifies size and other parameters about the disks related to the virtual - * machine.. - * - * @param storageProfile StorageProfile represents information about a disk. - *

The storage profile that specifies size and other parameters about the disks related to the - * virtual machine. + * Specifies the storageProfile property: The storage profile that specifies size and other parameters about + * the disks related to the virtual machine.. + * + * @param storageProfile The storage profile that specifies size and other parameters about the disks + * related to the virtual machine. * @return the next definition stage. */ WithVmImage withStorageProfile(StorageProfile storageProfile); } - /** The stage of the VirtualMachine definition allowing to specify vmImage. */ + /** + * The stage of the VirtualMachine definition allowing to specify vmImage. + */ interface WithVmImage { /** * Specifies the vmImage property: The virtual machine image that is currently provisioned to the OS disk, * using the full url and tag notation used to pull the image.. - * + * * @param vmImage The virtual machine image that is currently provisioned to the OS disk, using the full url - * and tag notation used to pull the image. + * and tag notation used to pull the image. * @return the next definition stage. */ WithCreate withVmImage(String vmImage); @@ -418,155 +435,188 @@ interface WithVmImage { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithBootMethod, - DefinitionStages.WithIsolateEmulatorThread, DefinitionStages.WithNetworkAttachments, - DefinitionStages.WithNetworkData, DefinitionStages.WithPlacementHints, DefinitionStages.WithSshPublicKeys, - DefinitionStages.WithUserData, DefinitionStages.WithVirtioInterface, DefinitionStages.WithVmDeviceModel, + DefinitionStages.WithConsoleExtendedLocation, DefinitionStages.WithIsolateEmulatorThread, + DefinitionStages.WithNetworkAttachments, DefinitionStages.WithNetworkData, + DefinitionStages.WithPlacementHints, DefinitionStages.WithSshPublicKeys, DefinitionStages.WithUserData, + DefinitionStages.WithVirtioInterface, DefinitionStages.WithVmDeviceModel, DefinitionStages.WithVmImageRepositoryCredentials { /** * Executes the create request. - * + * * @return the created resource. */ VirtualMachine create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ VirtualMachine create(Context context); } - /** The stage of the VirtualMachine definition allowing to specify tags. */ + /** + * The stage of the VirtualMachine definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the VirtualMachine definition allowing to specify bootMethod. */ + /** + * The stage of the VirtualMachine definition allowing to specify bootMethod. + */ interface WithBootMethod { /** * Specifies the bootMethod property: Selects the boot method for the virtual machine.. - * + * * @param bootMethod Selects the boot method for the virtual machine. * @return the next definition stage. */ WithCreate withBootMethod(VirtualMachineBootMethod bootMethod); } - /** The stage of the VirtualMachine definition allowing to specify isolateEmulatorThread. */ + /** + * The stage of the VirtualMachine definition allowing to specify consoleExtendedLocation. + */ + interface WithConsoleExtendedLocation { + /** + * Specifies the consoleExtendedLocation property: The extended location to use for creation of a VM console + * resource.. + * + * @param consoleExtendedLocation The extended location to use for creation of a VM console resource. + * @return the next definition stage. + */ + WithCreate withConsoleExtendedLocation(ExtendedLocation consoleExtendedLocation); + } + + /** + * The stage of the VirtualMachine definition allowing to specify isolateEmulatorThread. + */ interface WithIsolateEmulatorThread { /** * Specifies the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. * The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this * virtual machine.. - * + * * @param isolateEmulatorThread Field Deprecated, the value will be ignored if provided. The indicator of - * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual - * machine. + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. * @return the next definition stage. */ WithCreate withIsolateEmulatorThread(VirtualMachineIsolateEmulatorThread isolateEmulatorThread); } - /** The stage of the VirtualMachine definition allowing to specify networkAttachments. */ + /** + * The stage of the VirtualMachine definition allowing to specify networkAttachments. + */ interface WithNetworkAttachments { /** * Specifies the networkAttachments property: The list of network attachments to the virtual machine.. - * + * * @param networkAttachments The list of network attachments to the virtual machine. * @return the next definition stage. */ WithCreate withNetworkAttachments(List networkAttachments); } - /** The stage of the VirtualMachine definition allowing to specify networkData. */ + /** + * The stage of the VirtualMachine definition allowing to specify networkData. + */ interface WithNetworkData { /** * Specifies the networkData property: The Base64 encoded cloud-init network data.. - * + * * @param networkData The Base64 encoded cloud-init network data. * @return the next definition stage. */ WithCreate withNetworkData(String networkData); } - /** The stage of the VirtualMachine definition allowing to specify placementHints. */ + /** + * The stage of the VirtualMachine definition allowing to specify placementHints. + */ interface WithPlacementHints { /** * Specifies the placementHints property: The scheduling hints for the virtual machine.. - * + * * @param placementHints The scheduling hints for the virtual machine. * @return the next definition stage. */ WithCreate withPlacementHints(List placementHints); } - /** The stage of the VirtualMachine definition allowing to specify sshPublicKeys. */ + /** + * The stage of the VirtualMachine definition allowing to specify sshPublicKeys. + */ interface WithSshPublicKeys { /** * Specifies the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual * machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.. - * + * * @param sshPublicKeys The list of ssh public keys. Each key will be added to the virtual machine using the - * cloud-init ssh_authorized_keys mechanism for the adminUsername. + * cloud-init ssh_authorized_keys mechanism for the adminUsername. * @return the next definition stage. */ WithCreate withSshPublicKeys(List sshPublicKeys); } - /** The stage of the VirtualMachine definition allowing to specify userData. */ + /** + * The stage of the VirtualMachine definition allowing to specify userData. + */ interface WithUserData { /** * Specifies the userData property: The Base64 encoded cloud-init user data.. - * + * * @param userData The Base64 encoded cloud-init user data. * @return the next definition stage. */ WithCreate withUserData(String userData); } - /** The stage of the VirtualMachine definition allowing to specify virtioInterface. */ + /** + * The stage of the VirtualMachine definition allowing to specify virtioInterface. + */ interface WithVirtioInterface { /** * Specifies the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of * the virtio interface.. - * + * * @param virtioInterface Field Deprecated, use virtualizationModel instead. The type of the virtio - * interface. + * interface. * @return the next definition stage. */ WithCreate withVirtioInterface(VirtualMachineVirtioInterfaceType virtioInterface); } - /** The stage of the VirtualMachine definition allowing to specify vmDeviceModel. */ + /** + * The stage of the VirtualMachine definition allowing to specify vmDeviceModel. + */ interface WithVmDeviceModel { /** * Specifies the vmDeviceModel property: The type of the device model to use.. - * + * * @param vmDeviceModel The type of the device model to use. * @return the next definition stage. */ WithCreate withVmDeviceModel(VirtualMachineDeviceModelType vmDeviceModel); } - /** The stage of the VirtualMachine definition allowing to specify vmImageRepositoryCredentials. */ + /** + * The stage of the VirtualMachine definition allowing to specify vmImageRepositoryCredentials. + */ interface WithVmImageRepositoryCredentials { /** - * Specifies the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the - * credentials used to login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image.. - * - * @param vmImageRepositoryCredentials ImageRepositoryCredentials represents the credentials used to login - * to the image repository. - *

The credentials used to login to the image repository that has access to the specified image. + * Specifies the vmImageRepositoryCredentials property: The credentials used to login to the image + * repository that has access to the specified image.. + * + * @param vmImageRepositoryCredentials The credentials used to login to the image repository that has access + * to the specified image. * @return the next definition stage. */ WithCreate withVmImageRepositoryCredentials(ImageRepositoryCredentials vmImageRepositoryCredentials); @@ -575,53 +625,58 @@ interface WithVmImageRepositoryCredentials { /** * Begins update for the VirtualMachine resource. - * + * * @return the stage of resource update. */ VirtualMachine.Update update(); - /** The template for VirtualMachine update. */ + /** + * The template for VirtualMachine update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithVmImageRepositoryCredentials { /** * Executes the update request. - * + * * @return the updated resource. */ VirtualMachine apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ VirtualMachine apply(Context context); } - /** The VirtualMachine update stages. */ + /** + * The VirtualMachine update stages. + */ interface UpdateStages { - /** The stage of the VirtualMachine update allowing to specify tags. */ + /** + * The stage of the VirtualMachine update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the VirtualMachine update allowing to specify vmImageRepositoryCredentials. */ + /** + * The stage of the VirtualMachine update allowing to specify vmImageRepositoryCredentials. + */ interface WithVmImageRepositoryCredentials { /** - * Specifies the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the - * credentials used to login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image.. - * - * @param vmImageRepositoryCredentials ImageRepositoryCredentials represents the credentials used to login - * to the image repository. - *

The credentials used to login to the image repository that has access to the specified image. + * Specifies the vmImageRepositoryCredentials property: The credentials used to login to the image + * repository that has access to the specified image.. + * + * @param vmImageRepositoryCredentials The credentials used to login to the image repository that has access + * to the specified image. * @return the next definition stage. */ Update withVmImageRepositoryCredentials(ImageRepositoryCredentials vmImageRepositoryCredentials); @@ -630,14 +685,14 @@ interface WithVmImageRepositoryCredentials { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ VirtualMachine refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -645,9 +700,9 @@ interface WithVmImageRepositoryCredentials { /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @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 current status of an async operation. @@ -656,9 +711,9 @@ interface WithVmImageRepositoryCredentials { /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param virtualMachinePowerOffParameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -670,9 +725,9 @@ interface WithVmImageRepositoryCredentials { /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @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 current status of an async operation. @@ -681,9 +736,9 @@ interface WithVmImageRepositoryCredentials { /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -694,9 +749,9 @@ interface WithVmImageRepositoryCredentials { /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @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 current status of an async operation. @@ -705,9 +760,9 @@ interface WithVmImageRepositoryCredentials { /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -718,9 +773,9 @@ interface WithVmImageRepositoryCredentials { /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @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 current status of an async operation. @@ -729,9 +784,9 @@ interface WithVmImageRepositoryCredentials { /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java index 384a79fa1098f..d1d12eaee076c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Selects the boot method for the virtual machine. */ +/** + * Selects the boot method for the virtual machine. + */ public final class VirtualMachineBootMethod extends ExpandableStringEnum { - /** Static value UEFI for VirtualMachineBootMethod. */ + /** + * Static value UEFI for VirtualMachineBootMethod. + */ public static final VirtualMachineBootMethod UEFI = fromString("UEFI"); - /** Static value BIOS for VirtualMachineBootMethod. */ + /** + * Static value BIOS for VirtualMachineBootMethod. + */ public static final VirtualMachineBootMethod BIOS = fromString("BIOS"); /** * Creates a new instance of VirtualMachineBootMethod value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VirtualMachineBootMethod() { /** * Creates or finds a VirtualMachineBootMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineBootMethod. */ - @JsonCreator public static VirtualMachineBootMethod fromString(String name) { return fromString(name, VirtualMachineBootMethod.class); } /** * Gets known VirtualMachineBootMethod values. - * + * * @return known VirtualMachineBootMethod values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java index 2205add6ef38e..8da7471a173b4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the virtual machine. */ +/** + * The more detailed status of the virtual machine. + */ public final class VirtualMachineDetailedStatus extends ExpandableStringEnum { - /** Static value Available for VirtualMachineDetailedStatus. */ + /** + * Static value Available for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus AVAILABLE = fromString("Available"); - /** Static value Error for VirtualMachineDetailedStatus. */ + /** + * Static value Error for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus ERROR = fromString("Error"); - /** Static value Provisioning for VirtualMachineDetailedStatus. */ + /** + * Static value Provisioning for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus PROVISIONING = fromString("Provisioning"); - /** Static value Running for VirtualMachineDetailedStatus. */ + /** + * Static value Running for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus RUNNING = fromString("Running"); - /** Static value Scheduling for VirtualMachineDetailedStatus. */ + /** + * Static value Scheduling for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus SCHEDULING = fromString("Scheduling"); - /** Static value Stopped for VirtualMachineDetailedStatus. */ + /** + * Static value Stopped for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus STOPPED = fromString("Stopped"); - /** Static value Terminating for VirtualMachineDetailedStatus. */ + /** + * Static value Terminating for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus TERMINATING = fromString("Terminating"); - /** Static value Unknown for VirtualMachineDetailedStatus. */ + /** + * Static value Unknown for VirtualMachineDetailedStatus. + */ public static final VirtualMachineDetailedStatus UNKNOWN = fromString("Unknown"); /** * Creates a new instance of VirtualMachineDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public VirtualMachineDetailedStatus() { /** * Creates or finds a VirtualMachineDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineDetailedStatus. */ - @JsonCreator public static VirtualMachineDetailedStatus fromString(String name) { return fromString(name, VirtualMachineDetailedStatus.class); } /** * Gets known VirtualMachineDetailedStatus values. - * + * * @return known VirtualMachineDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java index 34d50057b2ec8..63bde2c2ad60d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java @@ -5,20 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the device model to use. */ +/** + * The type of the device model to use. + */ public final class VirtualMachineDeviceModelType extends ExpandableStringEnum { - /** Static value T1 for VirtualMachineDeviceModelType. */ + /** + * Static value T1 for VirtualMachineDeviceModelType. + */ public static final VirtualMachineDeviceModelType T1 = fromString("T1"); - /** Static value T2 for VirtualMachineDeviceModelType. */ + /** + * Static value T2 for VirtualMachineDeviceModelType. + */ public static final VirtualMachineDeviceModelType T2 = fromString("T2"); + /** + * Static value T3 for VirtualMachineDeviceModelType. + */ + public static final VirtualMachineDeviceModelType T3 = fromString("T3"); + /** * Creates a new instance of VirtualMachineDeviceModelType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +37,17 @@ public VirtualMachineDeviceModelType() { /** * Creates or finds a VirtualMachineDeviceModelType from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineDeviceModelType. */ - @JsonCreator public static VirtualMachineDeviceModelType fromString(String name) { return fromString(name, VirtualMachineDeviceModelType.class); } /** * Gets known VirtualMachineDeviceModelType values. - * + * * @return known VirtualMachineDeviceModelType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java index 88a9a107883fc..1248dcd332856 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java @@ -5,26 +5,32 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also - * specify Disabled. Otherwise, Disabled is the only permitted value. + * The IP allocation mechanism for the virtual machine. + * Dynamic and Static are only valid for l3Network which may also specify Disabled. + * Otherwise, Disabled is the only permitted value. */ public final class VirtualMachineIpAllocationMethod extends ExpandableStringEnum { - /** Static value Dynamic for VirtualMachineIpAllocationMethod. */ + /** + * Static value Dynamic for VirtualMachineIpAllocationMethod. + */ public static final VirtualMachineIpAllocationMethod DYNAMIC = fromString("Dynamic"); - /** Static value Static for VirtualMachineIpAllocationMethod. */ + /** + * Static value Static for VirtualMachineIpAllocationMethod. + */ public static final VirtualMachineIpAllocationMethod STATIC = fromString("Static"); - /** Static value Disabled for VirtualMachineIpAllocationMethod. */ + /** + * Static value Disabled for VirtualMachineIpAllocationMethod. + */ public static final VirtualMachineIpAllocationMethod DISABLED = fromString("Disabled"); /** * Creates a new instance of VirtualMachineIpAllocationMethod value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +39,17 @@ public VirtualMachineIpAllocationMethod() { /** * Creates or finds a VirtualMachineIpAllocationMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineIpAllocationMethod. */ - @JsonCreator public static VirtualMachineIpAllocationMethod fromString(String name) { return fromString(name, VirtualMachineIpAllocationMethod.class); } /** * Gets known VirtualMachineIpAllocationMethod values. - * + * * @return known VirtualMachineIpAllocationMethod values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java index d82a983dfc494..1c9183dbc1c28 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -14,15 +13,19 @@ */ public final class VirtualMachineIsolateEmulatorThread extends ExpandableStringEnum { - /** Static value True for VirtualMachineIsolateEmulatorThread. */ + /** + * Static value True for VirtualMachineIsolateEmulatorThread. + */ public static final VirtualMachineIsolateEmulatorThread TRUE = fromString("True"); - /** Static value False for VirtualMachineIsolateEmulatorThread. */ + /** + * Static value False for VirtualMachineIsolateEmulatorThread. + */ public static final VirtualMachineIsolateEmulatorThread FALSE = fromString("False"); /** * Creates a new instance of VirtualMachineIsolateEmulatorThread value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +34,17 @@ public VirtualMachineIsolateEmulatorThread() { /** * Creates or finds a VirtualMachineIsolateEmulatorThread from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineIsolateEmulatorThread. */ - @JsonCreator public static VirtualMachineIsolateEmulatorThread fromString(String name) { return fromString(name, VirtualMachineIsolateEmulatorThread.class); } /** * Gets known VirtualMachineIsolateEmulatorThread values. - * + * * @return known VirtualMachineIsolateEmulatorThread values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java index 60a185ed8316d..54c6819880a70 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.VirtualMachineInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** VirtualMachineList represents a list of virtual machines. */ +/** + * VirtualMachineList represents a list of virtual machines. + */ @Fluent -public final class VirtualMachineList { +public final class VirtualMachineList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of virtual machines. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of VirtualMachineList class. */ + /** + * Creates an instance of VirtualMachineList class. + */ public VirtualMachineList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the VirtualMachineList object itself. */ @@ -50,7 +56,7 @@ public VirtualMachineList withNextLink(String nextLink) { /** * Get the value property: The list of virtual machines. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of virtual machines. - * + * * @param value the value value to set. * @return the VirtualMachineList object itself. */ @@ -70,7 +76,7 @@ public VirtualMachineList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineList 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 VirtualMachineList. + */ + public static VirtualMachineList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineList deserializedVirtualMachineList = new VirtualMachineList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedVirtualMachineList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualMachineInner.fromJson(reader1)); + deserializedVirtualMachineList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java index ce4a06df6e283..4abf52bcfbe9d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java @@ -5,39 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.VirtualMachinePatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. */ +/** + * VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + */ @Fluent -public final class VirtualMachinePatchParameters { +public final class VirtualMachinePatchParameters implements JsonSerializable { /* - * VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - * * The list of the resource properties. */ - @JsonProperty(value = "properties") private VirtualMachinePatchProperties innerProperties; /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of VirtualMachinePatchParameters class. */ + /** + * Creates an instance of VirtualMachinePatchParameters class. + */ public VirtualMachinePatchParameters() { } /** - * Get the innerProperties property: VirtualMachinePatchProperties represents the properties of the virtual machine - * that can be patched. - * - *

The list of the resource properties. - * + * Get the innerProperties property: The list of the resource properties. + * * @return the innerProperties value. */ private VirtualMachinePatchProperties innerProperties() { @@ -46,7 +45,7 @@ private VirtualMachinePatchProperties innerProperties() { /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -55,7 +54,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the VirtualMachinePatchParameters object itself. */ @@ -65,11 +64,9 @@ public VirtualMachinePatchParameters withTags(Map tags) { } /** - * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Get the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @return the vmImageRepositoryCredentials value. */ public ImageRepositoryCredentials vmImageRepositoryCredentials() { @@ -77,11 +74,9 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { } /** - * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to - * login to the image repository. - * - *

The credentials used to login to the image repository that has access to the specified image. - * + * Set the vmImageRepositoryCredentials property: The credentials used to login to the image repository that has + * access to the specified image. + * * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. * @return the VirtualMachinePatchParameters object itself. */ @@ -96,7 +91,7 @@ public ImageRepositoryCredentials vmImageRepositoryCredentials() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -104,4 +99,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePatchParameters 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 VirtualMachinePatchParameters. + */ + public static VirtualMachinePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePatchParameters deserializedVirtualMachinePatchParameters + = new VirtualMachinePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedVirtualMachinePatchParameters.innerProperties + = VirtualMachinePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualMachinePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java index 2df203bb80f92..24d3b92d0b52f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java @@ -6,45 +6,49 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + */ @Fluent -public final class VirtualMachinePlacementHint { +public final class VirtualMachinePlacementHint implements JsonSerializable { /* * The specification of whether this hint supports affinity or anti-affinity with the referenced resources. */ - @JsonProperty(value = "hintType", required = true) private VirtualMachinePlacementHintType hintType; /* * The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node * to host the virtual machine. */ - @JsonProperty(value = "resourceId", required = true) private String resourceId; /* * The indicator of whether the hint is a hard or soft requirement during scheduling. */ - @JsonProperty(value = "schedulingExecution", required = true) private VirtualMachineSchedulingExecution schedulingExecution; /* * The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the * case of node affinity. */ - @JsonProperty(value = "scope", required = true) private VirtualMachinePlacementHintPodAffinityScope scope; - /** Creates an instance of VirtualMachinePlacementHint class. */ + /** + * Creates an instance of VirtualMachinePlacementHint class. + */ public VirtualMachinePlacementHint() { } /** * Get the hintType property: The specification of whether this hint supports affinity or anti-affinity with the * referenced resources. - * + * * @return the hintType value. */ public VirtualMachinePlacementHintType hintType() { @@ -54,7 +58,7 @@ public VirtualMachinePlacementHintType hintType() { /** * Set the hintType property: The specification of whether this hint supports affinity or anti-affinity with the * referenced resources. - * + * * @param hintType the hintType value to set. * @return the VirtualMachinePlacementHint object itself. */ @@ -66,7 +70,7 @@ public VirtualMachinePlacementHint withHintType(VirtualMachinePlacementHintType /** * Get the resourceId property: The resource ID of the target object that the placement hints will be checked * against, e.g., the bare metal node to host the virtual machine. - * + * * @return the resourceId value. */ public String resourceId() { @@ -76,7 +80,7 @@ public String resourceId() { /** * Set the resourceId property: The resource ID of the target object that the placement hints will be checked * against, e.g., the bare metal node to host the virtual machine. - * + * * @param resourceId the resourceId value to set. * @return the VirtualMachinePlacementHint object itself. */ @@ -88,7 +92,7 @@ public VirtualMachinePlacementHint withResourceId(String resourceId) { /** * Get the schedulingExecution property: The indicator of whether the hint is a hard or soft requirement during * scheduling. - * + * * @return the schedulingExecution value. */ public VirtualMachineSchedulingExecution schedulingExecution() { @@ -98,7 +102,7 @@ public VirtualMachineSchedulingExecution schedulingExecution() { /** * Set the schedulingExecution property: The indicator of whether the hint is a hard or soft requirement during * scheduling. - * + * * @param schedulingExecution the schedulingExecution value to set. * @return the VirtualMachinePlacementHint object itself. */ @@ -110,7 +114,7 @@ public VirtualMachinePlacementHint withSchedulingExecution(VirtualMachineSchedul /** * Get the scope property: The scope for the virtual machine affinity or anti-affinity placement hint. It should * always be "Machine" in the case of node affinity. - * + * * @return the scope value. */ public VirtualMachinePlacementHintPodAffinityScope scope() { @@ -120,7 +124,7 @@ public VirtualMachinePlacementHintPodAffinityScope scope() { /** * Set the scope property: The scope for the virtual machine affinity or anti-affinity placement hint. It should * always be "Machine" in the case of node affinity. - * + * * @param scope the scope value to set. * @return the VirtualMachinePlacementHint object itself. */ @@ -131,27 +135,81 @@ public VirtualMachinePlacementHint withScope(VirtualMachinePlacementHintPodAffin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (hintType() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property hintType in model VirtualMachinePlacementHint")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hintType in model VirtualMachinePlacementHint")); } if (resourceId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property resourceId in model VirtualMachinePlacementHint")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceId in model VirtualMachinePlacementHint")); } if (schedulingExecution() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property schedulingExecution in model VirtualMachinePlacementHint")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property schedulingExecution in model VirtualMachinePlacementHint")); } if (scope() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property scope in model VirtualMachinePlacementHint")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model VirtualMachinePlacementHint")); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinePlacementHint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hintType", this.hintType == null ? null : this.hintType.toString()); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("schedulingExecution", + this.schedulingExecution == null ? null : this.schedulingExecution.toString()); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePlacementHint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePlacementHint 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 VirtualMachinePlacementHint. + */ + public static VirtualMachinePlacementHint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePlacementHint deserializedVirtualMachinePlacementHint = new VirtualMachinePlacementHint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hintType".equals(fieldName)) { + deserializedVirtualMachinePlacementHint.hintType + = VirtualMachinePlacementHintType.fromString(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedVirtualMachinePlacementHint.resourceId = reader.getString(); + } else if ("schedulingExecution".equals(fieldName)) { + deserializedVirtualMachinePlacementHint.schedulingExecution + = VirtualMachineSchedulingExecution.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedVirtualMachinePlacementHint.scope + = VirtualMachinePlacementHintPodAffinityScope.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePlacementHint; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java index 23b690ba41699..a3fc3ba804bcb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -14,15 +13,19 @@ */ public final class VirtualMachinePlacementHintPodAffinityScope extends ExpandableStringEnum { - /** Static value Rack for VirtualMachinePlacementHintPodAffinityScope. */ + /** + * Static value Rack for VirtualMachinePlacementHintPodAffinityScope. + */ public static final VirtualMachinePlacementHintPodAffinityScope RACK = fromString("Rack"); - /** Static value Machine for VirtualMachinePlacementHintPodAffinityScope. */ + /** + * Static value Machine for VirtualMachinePlacementHintPodAffinityScope. + */ public static final VirtualMachinePlacementHintPodAffinityScope MACHINE = fromString("Machine"); /** * Creates a new instance of VirtualMachinePlacementHintPodAffinityScope value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +34,17 @@ public VirtualMachinePlacementHintPodAffinityScope() { /** * Creates or finds a VirtualMachinePlacementHintPodAffinityScope from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachinePlacementHintPodAffinityScope. */ - @JsonCreator public static VirtualMachinePlacementHintPodAffinityScope fromString(String name) { return fromString(name, VirtualMachinePlacementHintPodAffinityScope.class); } /** * Gets known VirtualMachinePlacementHintPodAffinityScope values. - * + * * @return known VirtualMachinePlacementHintPodAffinityScope values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java index 76c05662e1b9d..6c50a1ed9f547 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The specification of whether this hint supports affinity or anti-affinity with the referenced resources. */ +/** + * The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + */ public final class VirtualMachinePlacementHintType extends ExpandableStringEnum { - /** Static value Affinity for VirtualMachinePlacementHintType. */ + /** + * Static value Affinity for VirtualMachinePlacementHintType. + */ public static final VirtualMachinePlacementHintType AFFINITY = fromString("Affinity"); - /** Static value AntiAffinity for VirtualMachinePlacementHintType. */ + /** + * Static value AntiAffinity for VirtualMachinePlacementHintType. + */ public static final VirtualMachinePlacementHintType ANTI_AFFINITY = fromString("AntiAffinity"); /** * Creates a new instance of VirtualMachinePlacementHintType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VirtualMachinePlacementHintType() { /** * Creates or finds a VirtualMachinePlacementHintType from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachinePlacementHintType. */ - @JsonCreator public static VirtualMachinePlacementHintType fromString(String name) { return fromString(name, VirtualMachinePlacementHintType.class); } /** * Gets known VirtualMachinePlacementHintType values. - * + * * @return known VirtualMachinePlacementHintType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java index 87a1f65ba7467..9eb2294898fca 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. */ +/** + * VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. + */ @Fluent -public final class VirtualMachinePowerOffParameters { +public final class VirtualMachinePowerOffParameters implements JsonSerializable { /* * The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. */ - @JsonProperty(value = "skipShutdown") private SkipShutdown skipShutdown; - /** Creates an instance of VirtualMachinePowerOffParameters class. */ + /** + * Creates an instance of VirtualMachinePowerOffParameters class. + */ public VirtualMachinePowerOffParameters() { } /** * Get the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the * virtual machine immediately. - * + * * @return the skipShutdown value. */ public SkipShutdown skipShutdown() { @@ -33,7 +40,7 @@ public SkipShutdown skipShutdown() { /** * Set the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the * virtual machine immediately. - * + * * @param skipShutdown the skipShutdown value to set. * @return the VirtualMachinePowerOffParameters object itself. */ @@ -44,9 +51,47 @@ public VirtualMachinePowerOffParameters withSkipShutdown(SkipShutdown skipShutdo /** * 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("skipShutdown", this.skipShutdown == null ? null : this.skipShutdown.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePowerOffParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePowerOffParameters 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 VirtualMachinePowerOffParameters. + */ + public static VirtualMachinePowerOffParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePowerOffParameters deserializedVirtualMachinePowerOffParameters + = new VirtualMachinePowerOffParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skipShutdown".equals(fieldName)) { + deserializedVirtualMachinePowerOffParameters.skipShutdown + = SkipShutdown.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePowerOffParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java index 997794d072aae..dc1d2572c5fda 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The power state of the virtual machine. */ +/** + * The power state of the virtual machine. + */ public final class VirtualMachinePowerState extends ExpandableStringEnum { - /** Static value On for VirtualMachinePowerState. */ + /** + * Static value On for VirtualMachinePowerState. + */ public static final VirtualMachinePowerState ON = fromString("On"); - /** Static value Off for VirtualMachinePowerState. */ + /** + * Static value Off for VirtualMachinePowerState. + */ public static final VirtualMachinePowerState OFF = fromString("Off"); - /** Static value Unknown for VirtualMachinePowerState. */ + /** + * Static value Unknown for VirtualMachinePowerState. + */ public static final VirtualMachinePowerState UNKNOWN = fromString("Unknown"); /** * Creates a new instance of VirtualMachinePowerState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public VirtualMachinePowerState() { /** * Creates or finds a VirtualMachinePowerState from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachinePowerState. */ - @JsonCreator public static VirtualMachinePowerState fromString(String name) { return fromString(name, VirtualMachinePowerState.class); } /** * Gets known VirtualMachinePowerState values. - * + * * @return known VirtualMachinePowerState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java index a9be8f4c227de..72dd841379448 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the virtual machine. */ +/** + * The provisioning state of the virtual machine. + */ public final class VirtualMachineProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for VirtualMachineProvisioningState. */ + /** + * Static value Succeeded for VirtualMachineProvisioningState. + */ public static final VirtualMachineProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for VirtualMachineProvisioningState. */ + /** + * Static value Failed for VirtualMachineProvisioningState. + */ public static final VirtualMachineProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for VirtualMachineProvisioningState. */ + /** + * Static value Canceled for VirtualMachineProvisioningState. + */ public static final VirtualMachineProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for VirtualMachineProvisioningState. */ + /** + * Static value Provisioning for VirtualMachineProvisioningState. + */ public static final VirtualMachineProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for VirtualMachineProvisioningState. */ + /** + * Static value Accepted for VirtualMachineProvisioningState. + */ public static final VirtualMachineProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of VirtualMachineProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public VirtualMachineProvisioningState() { /** * Creates or finds a VirtualMachineProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineProvisioningState. */ - @JsonCreator public static VirtualMachineProvisioningState fromString(String name) { return fromString(name, VirtualMachineProvisioningState.class); } /** * Gets known VirtualMachineProvisioningState values. - * + * * @return known VirtualMachineProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java index 3ecb70822fed9..1c6350331dc5d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the hint is a hard or soft requirement during scheduling. */ +/** + * The indicator of whether the hint is a hard or soft requirement during scheduling. + */ public final class VirtualMachineSchedulingExecution extends ExpandableStringEnum { - /** Static value Hard for VirtualMachineSchedulingExecution. */ + /** + * Static value Hard for VirtualMachineSchedulingExecution. + */ public static final VirtualMachineSchedulingExecution HARD = fromString("Hard"); - /** Static value Soft for VirtualMachineSchedulingExecution. */ + /** + * Static value Soft for VirtualMachineSchedulingExecution. + */ public static final VirtualMachineSchedulingExecution SOFT = fromString("Soft"); /** * Creates a new instance of VirtualMachineSchedulingExecution value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VirtualMachineSchedulingExecution() { /** * Creates or finds a VirtualMachineSchedulingExecution from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineSchedulingExecution. */ - @JsonCreator public static VirtualMachineSchedulingExecution fromString(String name) { return fromString(name, VirtualMachineSchedulingExecution.class); } /** * Gets known VirtualMachineSchedulingExecution values. - * + * * @return known VirtualMachineSchedulingExecution values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java index 3f92db712bb89..a3d158f0f09c5 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Field Deprecated, use virtualizationModel instead. The type of the virtio interface. */ +/** + * Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + */ public final class VirtualMachineVirtioInterfaceType extends ExpandableStringEnum { - /** Static value Modern for VirtualMachineVirtioInterfaceType. */ + /** + * Static value Modern for VirtualMachineVirtioInterfaceType. + */ public static final VirtualMachineVirtioInterfaceType MODERN = fromString("Modern"); - /** Static value Transitional for VirtualMachineVirtioInterfaceType. */ + /** + * Static value Transitional for VirtualMachineVirtioInterfaceType. + */ public static final VirtualMachineVirtioInterfaceType TRANSITIONAL = fromString("Transitional"); /** * Creates a new instance of VirtualMachineVirtioInterfaceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VirtualMachineVirtioInterfaceType() { /** * Creates or finds a VirtualMachineVirtioInterfaceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding VirtualMachineVirtioInterfaceType. */ - @JsonCreator public static VirtualMachineVirtioInterfaceType fromString(String name) { return fromString(name, VirtualMachineVirtioInterfaceType.class); } /** * Gets known VirtualMachineVirtioInterfaceType values. - * + * * @return known VirtualMachineVirtioInterfaceType values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java index 12c69a647e84f..213c3a461b0d6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VirtualMachines. */ +/** + * Resource collection API of VirtualMachines. + */ public interface VirtualMachines { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface VirtualMachines { /** * List virtual machines in the subscription. - * - *

Get a list of virtual machines in the provided subscription. - * + * + * Get a list of virtual machines in the provided subscription. + * * @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. @@ -36,38 +38,38 @@ public interface VirtualMachines { /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * List virtual machines in the resource group. - * - *

Get a list of virtual machines in the provided resource group. - * + * + * Get a list of virtual machines in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machines in the provided resource group as paginated response with {@link - * PagedIterable}. + * @return a list of virtual machines in the provided resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -81,9 +83,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,36 +97,38 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String virtualMachineName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String virtualMachineName); /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void delete(String resourceGroupName, String virtualMachineName, Context context); + OperationStatusResult delete(String resourceGroupName, String virtualMachineName, Context context); /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -136,9 +140,9 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Power off the virtual machine. - * - *

Power off the provided virtual machine. - * + * + * Power off the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param virtualMachinePowerOffParameters The request body. @@ -153,9 +157,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -167,9 +171,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Reimage the virtual machine. - * - *

Reimage the provided virtual machine. - * + * + * Reimage the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -182,9 +186,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -196,9 +200,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Restart the virtual machine. - * - *

Restart the provided virtual machine. - * + * + * Restart the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -211,9 +215,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -225,9 +229,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Start the virtual machine. - * - *

Start the provided virtual machine. - * + * + * Start the provided virtual machine. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineName The name of the virtual machine. * @param context The context to associate with this operation. @@ -240,9 +244,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -253,9 +257,9 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Retrieve the virtual machine. - * - *

Get properties of the provided virtual machine. - * + * + * Get properties of the provided virtual machine. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -267,32 +271,34 @@ OperationStatusResult powerOff(String resourceGroupName, String virtualMachineNa /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the virtual machine. - * - *

Delete the provided virtual machine. - * + * + * Delete the provided virtual machine. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new VirtualMachine resource. - * + * * @param name resource name. * @return the first stage of the new VirtualMachine definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java index b35e4c31cef74..024f500f52e35 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java @@ -11,56 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of Volume. */ +/** + * An immutable client-side representation of Volume. + */ public interface Volume { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will - * be created. - * - *

The extended location of the cluster associated with the resource. - * + * Gets the extendedLocation property: The extended location of the cluster associated with the resource. + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -68,91 +67,99 @@ public interface Volume { /** * Gets the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines * and Hybrid AKS clusters. - * + * * @return the attachedTo value. */ List attachedTo(); /** * Gets the detailedStatus property: The more detailed status of the volume. - * + * * @return the detailedStatus value. */ VolumeDetailedStatus detailedStatus(); /** * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. - * + * * @return the detailedStatusMessage value. */ String detailedStatusMessage(); /** * Gets the provisioningState property: The provisioning state of the volume. - * + * * @return the provisioningState value. */ VolumeProvisioningState provisioningState(); /** * Gets the serialNumber property: The unique identifier of the volume. - * + * * @return the serialNumber value. */ String serialNumber(); /** * Gets the sizeMiB property: The size of the allocation for this volume in Mebibytes. - * + * * @return the sizeMiB value. */ long sizeMiB(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner object. - * + * * @return the inner object. */ VolumeInner innerModel(); - /** The entirety of the Volume definition. */ + /** + * The entirety of the Volume definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithSizeMiB, DefinitionStages.WithCreate { } - /** The Volume definition stages. */ + /** + * The Volume definition stages. + */ interface DefinitionStages { - /** The first stage of the Volume definition. */ + /** + * The first stage of the Volume definition. + */ interface Blank extends WithLocation { } - /** The stage of the Volume definition allowing to specify location. */ + /** + * The stage of the Volume definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -160,45 +167,47 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Volume definition allowing to specify parent resource. */ + /** + * The stage of the Volume definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } - /** The stage of the Volume definition allowing to specify extendedLocation. */ + /** + * The stage of the Volume definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** - * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the - * resource will be created. - * - *

The extended location of the cluster associated with the resource.. - * - * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be - * created. - *

The extended location of the cluster associated with the resource. + * Specifies the extendedLocation property: The extended location of the cluster associated with the + * resource.. + * + * @param extendedLocation The extended location of the cluster associated with the resource. * @return the next definition stage. */ WithSizeMiB withExtendedLocation(ExtendedLocation extendedLocation); } - /** The stage of the Volume definition allowing to specify sizeMiB. */ + /** + * The stage of the Volume definition allowing to specify sizeMiB. + */ interface WithSizeMiB { /** * Specifies the sizeMiB property: The size of the allocation for this volume in Mebibytes.. - * + * * @param sizeMiB The size of the allocation for this volume in Mebibytes. * @return the next definition stage. */ @@ -212,25 +221,27 @@ interface WithSizeMiB { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ Volume create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Volume create(Context context); } - /** The stage of the Volume definition allowing to specify tags. */ + /** + * The stage of the Volume definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -240,36 +251,42 @@ interface WithTags { /** * Begins update for the Volume resource. - * + * * @return the stage of resource update. */ Volume.Update update(); - /** The template for Volume update. */ + /** + * The template for Volume update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ Volume apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Volume apply(Context context); } - /** The Volume update stages. */ + /** + * The Volume update stages. + */ interface UpdateStages { - /** The stage of the Volume update allowing to specify tags. */ + /** + * The stage of the Volume update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The Azure resource tags that will replace the existing ones.. - * + * * @param tags The Azure resource tags that will replace the existing ones. * @return the next definition stage. */ @@ -279,14 +296,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Volume refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java index 857afd94c80b7..f1c1133e4b640 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The more detailed status of the volume. */ +/** + * The more detailed status of the volume. + */ public final class VolumeDetailedStatus extends ExpandableStringEnum { - /** Static value Error for VolumeDetailedStatus. */ + /** + * Static value Error for VolumeDetailedStatus. + */ public static final VolumeDetailedStatus ERROR = fromString("Error"); - /** Static value Active for VolumeDetailedStatus. */ + /** + * Static value Active for VolumeDetailedStatus. + */ public static final VolumeDetailedStatus ACTIVE = fromString("Active"); - /** Static value Provisioning for VolumeDetailedStatus. */ + /** + * Static value Provisioning for VolumeDetailedStatus. + */ public static final VolumeDetailedStatus PROVISIONING = fromString("Provisioning"); /** * Creates a new instance of VolumeDetailedStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public VolumeDetailedStatus() { /** * Creates or finds a VolumeDetailedStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding VolumeDetailedStatus. */ - @JsonCreator public static VolumeDetailedStatus fromString(String name) { return fromString(name, VolumeDetailedStatus.class); } /** * Gets known VolumeDetailedStatus values. - * + * * @return known VolumeDetailedStatus values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java index ff042a9fba5ff..155bafe94753d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.networkcloud.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.networkcloud.fluent.models.VolumeInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** VolumeList represents a list of volumes. */ +/** + * VolumeList represents a list of volumes. + */ @Fluent -public final class VolumeList { +public final class VolumeList implements JsonSerializable { /* * The link used to get the next page of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * The list of volumes. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of VolumeList class. */ + /** + * Creates an instance of VolumeList class. + */ public VolumeList() { } /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the VolumeList object itself. */ @@ -50,7 +56,7 @@ public VolumeList withNextLink(String nextLink) { /** * Get the value property: The list of volumes. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: The list of volumes. - * + * * @param value the value value to set. * @return the VolumeList object itself. */ @@ -70,7 +76,7 @@ public VolumeList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeList 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 VolumeList. + */ + public static VolumeList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeList deserializedVolumeList = new VolumeList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedVolumeList.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VolumeInner.fromJson(reader1)); + deserializedVolumeList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeList; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java index 4e311be841ec4..a550960895e95 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.networkcloud.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; -/** VolumePatchParameters represents the body of the request to patch the volume resource. */ +/** + * VolumePatchParameters represents the body of the request to patch the volume resource. + */ @Fluent -public final class VolumePatchParameters { +public final class VolumePatchParameters implements JsonSerializable { /* * The Azure resource tags that will replace the existing ones. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of VolumePatchParameters class. */ + /** + * Creates an instance of VolumePatchParameters class. + */ public VolumePatchParameters() { } /** * Get the tags property: The Azure resource tags that will replace the existing ones. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: The Azure resource tags that will replace the existing ones. - * + * * @param tags the tags value to set. * @return the VolumePatchParameters object itself. */ @@ -45,9 +50,46 @@ public VolumePatchParameters withTags(Map tags) { /** * 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.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumePatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumePatchParameters 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 VolumePatchParameters. + */ + public static VolumePatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumePatchParameters deserializedVolumePatchParameters = new VolumePatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVolumePatchParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVolumePatchParameters; + }); + } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java index e462273d3593c..d1ffae684a3c7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the volume. */ +/** + * The provisioning state of the volume. + */ public final class VolumeProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for VolumeProvisioningState. */ + /** + * Static value Succeeded for VolumeProvisioningState. + */ public static final VolumeProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for VolumeProvisioningState. */ + /** + * Static value Failed for VolumeProvisioningState. + */ public static final VolumeProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for VolumeProvisioningState. */ + /** + * Static value Canceled for VolumeProvisioningState. + */ public static final VolumeProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for VolumeProvisioningState. */ + /** + * Static value Provisioning for VolumeProvisioningState. + */ public static final VolumeProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Accepted for VolumeProvisioningState. */ + /** + * Static value Accepted for VolumeProvisioningState. + */ public static final VolumeProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of VolumeProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public VolumeProvisioningState() { /** * Creates or finds a VolumeProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding VolumeProvisioningState. */ - @JsonCreator public static VolumeProvisioningState fromString(String name) { return fromString(name, VolumeProvisioningState.class); } /** * Gets known VolumeProvisioningState values. - * + * * @return known VolumeProvisioningState values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java index 550280df37013..fc00754e5b061 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Volumes. */ +/** + * Resource collection API of Volumes. + */ public interface Volumes { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. @@ -23,9 +25,9 @@ public interface Volumes { /** * List volumes in the subscription. - * - *

Get a list of volumes in the provided subscription. - * + * + * Get a list of volumes in the provided subscription. + * * @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. @@ -36,9 +38,9 @@ public interface Volumes { /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,9 +51,9 @@ public interface Volumes { /** * List volumes in the resource group. - * - *

Get a list of volumes in the provided resource group. - * + * + * Get a list of volumes in the provided resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,9 +65,9 @@ public interface Volumes { /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @param context The context to associate with this operation. @@ -78,9 +80,9 @@ public interface Volumes { /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,36 +94,38 @@ public interface Volumes { /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @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 current status of an async operation. */ - void deleteByResourceGroup(String resourceGroupName, String volumeName); + OperationStatusResult deleteByResourceGroup(String resourceGroupName, String volumeName); /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param volumeName The name of the volume. * @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 current status of an async operation. */ - void delete(String resourceGroupName, String volumeName, Context context); + OperationStatusResult delete(String resourceGroupName, String volumeName, Context context); /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -132,9 +136,9 @@ public interface Volumes { /** * Retrieve the volume. - * - *

Get properties of the provided volume. - * + * + * Get properties of the provided volume. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,32 +150,34 @@ public interface Volumes { /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteById(String id); + OperationStatusResult deleteById(String id); /** * Delete the volume. - * - *

Delete the provided volume. - * + * + * Delete the provided volume. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. */ - void deleteByIdWithResponse(String id, Context context); + OperationStatusResult deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Volume resource. - * + * * @param name resource name. * @return the first stage of the new Volume definition. */ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettings.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettings.java new file mode 100644 index 0000000000000..9246b131b4633 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the + * cluster. + */ +@Fluent +public final class VulnerabilityScanningSettings implements JsonSerializable { + /* + * The mode selection for container vulnerability scanning. + */ + private VulnerabilityScanningSettingsContainerScan containerScan; + + /** + * Creates an instance of VulnerabilityScanningSettings class. + */ + public VulnerabilityScanningSettings() { + } + + /** + * Get the containerScan property: The mode selection for container vulnerability scanning. + * + * @return the containerScan value. + */ + public VulnerabilityScanningSettingsContainerScan containerScan() { + return this.containerScan; + } + + /** + * Set the containerScan property: The mode selection for container vulnerability scanning. + * + * @param containerScan the containerScan value to set. + * @return the VulnerabilityScanningSettings object itself. + */ + public VulnerabilityScanningSettings withContainerScan(VulnerabilityScanningSettingsContainerScan containerScan) { + this.containerScan = containerScan; + 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("containerScan", this.containerScan == null ? null : this.containerScan.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VulnerabilityScanningSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VulnerabilityScanningSettings 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 VulnerabilityScanningSettings. + */ + public static VulnerabilityScanningSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VulnerabilityScanningSettings deserializedVulnerabilityScanningSettings + = new VulnerabilityScanningSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerScan".equals(fieldName)) { + deserializedVulnerabilityScanningSettings.containerScan + = VulnerabilityScanningSettingsContainerScan.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVulnerabilityScanningSettings; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsContainerScan.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsContainerScan.java new file mode 100644 index 0000000000000..afae3c89c5918 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsContainerScan.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode selection for container vulnerability scanning. + */ +public final class VulnerabilityScanningSettingsContainerScan + extends ExpandableStringEnum { + /** + * Static value Disabled for VulnerabilityScanningSettingsContainerScan. + */ + public static final VulnerabilityScanningSettingsContainerScan DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for VulnerabilityScanningSettingsContainerScan. + */ + public static final VulnerabilityScanningSettingsContainerScan ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of VulnerabilityScanningSettingsContainerScan value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VulnerabilityScanningSettingsContainerScan() { + } + + /** + * Creates or finds a VulnerabilityScanningSettingsContainerScan from its string representation. + * + * @param name a name to look for. + * @return the corresponding VulnerabilityScanningSettingsContainerScan. + */ + public static VulnerabilityScanningSettingsContainerScan fromString(String name) { + return fromString(name, VulnerabilityScanningSettingsContainerScan.class); + } + + /** + * Gets known VulnerabilityScanningSettingsContainerScan values. + * + * @return known VulnerabilityScanningSettingsContainerScan values. + */ + public static Collection values() { + return values(VulnerabilityScanningSettingsContainerScan.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsPatch.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsPatch.java new file mode 100644 index 0000000000000..d42319cf9b521 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VulnerabilityScanningSettingsPatch.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the + * cluster. + */ +@Fluent +public final class VulnerabilityScanningSettingsPatch implements JsonSerializable { + /* + * The mode selection for container vulnerability scanning. + */ + private VulnerabilityScanningSettingsContainerScan containerScan; + + /** + * Creates an instance of VulnerabilityScanningSettingsPatch class. + */ + public VulnerabilityScanningSettingsPatch() { + } + + /** + * Get the containerScan property: The mode selection for container vulnerability scanning. + * + * @return the containerScan value. + */ + public VulnerabilityScanningSettingsContainerScan containerScan() { + return this.containerScan; + } + + /** + * Set the containerScan property: The mode selection for container vulnerability scanning. + * + * @param containerScan the containerScan value to set. + * @return the VulnerabilityScanningSettingsPatch object itself. + */ + public VulnerabilityScanningSettingsPatch + withContainerScan(VulnerabilityScanningSettingsContainerScan containerScan) { + this.containerScan = containerScan; + 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("containerScan", this.containerScan == null ? null : this.containerScan.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VulnerabilityScanningSettingsPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VulnerabilityScanningSettingsPatch 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 VulnerabilityScanningSettingsPatch. + */ + public static VulnerabilityScanningSettingsPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VulnerabilityScanningSettingsPatch deserializedVulnerabilityScanningSettingsPatch + = new VulnerabilityScanningSettingsPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerScan".equals(fieldName)) { + deserializedVulnerabilityScanningSettingsPatch.containerScan + = VulnerabilityScanningSettingsContainerScan.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVulnerabilityScanningSettingsPatch; + }); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java index 807acb84eea68..a7543635a4ddf 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.networkcloud.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The indicator of whether the workload will be impacted during the upgrade. */ +/** + * The indicator of whether the workload will be impacted during the upgrade. + */ public final class WorkloadImpact extends ExpandableStringEnum { - /** Static value True for WorkloadImpact. */ + /** + * Static value True for WorkloadImpact. + */ public static final WorkloadImpact TRUE = fromString("True"); - /** Static value False for WorkloadImpact. */ + /** + * Static value False for WorkloadImpact. + */ public static final WorkloadImpact FALSE = fromString("False"); /** * Creates a new instance of WorkloadImpact value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public WorkloadImpact() { /** * Creates or finds a WorkloadImpact from its string representation. - * + * * @param name a name to look for. * @return the corresponding WorkloadImpact. */ - @JsonCreator public static WorkloadImpact fromString(String name) { return fromString(name, WorkloadImpact.class); } /** * Gets known WorkloadImpact values. - * + * * @return known WorkloadImpact values. */ public static Collection values() { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java index cb4ca688c84db..0ec6bca3ff1ea 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java @@ -3,7 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for NetworkCloud. The Network Cloud APIs provide management of the on-premises - * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + * Package containing the data models for NetworkCloud. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ package com.azure.resourcemanager.networkcloud.models; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java index c21b9b57fcf6f..52ff4bc1001ab 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java @@ -3,7 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for NetworkCloud. The Network Cloud APIs provide management of the on-premises - * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + * Package containing the classes for NetworkCloud. + * The Network Cloud APIs provide management of the Azure Operator Nexus compute resources such as on-premises clusters, + * hardware resources, and workload infrastructure resources. */ package com.azure.resourcemanager.networkcloud; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java index 0f6ce610ef5c9..93b0a86966554 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.networkcloud.fluent.models; exports com.azure.resourcemanager.networkcloud.models; - opens com.azure.resourcemanager.networkcloud.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.networkcloud.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.networkcloud.fluent.models to com.azure.core; + opens com.azure.resourcemanager.networkcloud.models to com.azure.core; } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/proxy-config.json b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/proxy-config.json new file mode 100644 index 0000000000000..e10460627a1af --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.networkcloud.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.networkcloud.implementation.BareMetalMachineKeySetsClientImpl$BareMetalMachineKeySetsService"],["com.azure.resourcemanager.networkcloud.implementation.BareMetalMachinesClientImpl$BareMetalMachinesService"],["com.azure.resourcemanager.networkcloud.implementation.BmcKeySetsClientImpl$BmcKeySetsService"],["com.azure.resourcemanager.networkcloud.implementation.CloudServicesNetworksClientImpl$CloudServicesNetworksService"],["com.azure.resourcemanager.networkcloud.implementation.ClusterManagersClientImpl$ClusterManagersService"],["com.azure.resourcemanager.networkcloud.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.networkcloud.implementation.ConsolesClientImpl$ConsolesService"],["com.azure.resourcemanager.networkcloud.implementation.KubernetesClusterFeaturesClientImpl$KubernetesClusterFeaturesService"],["com.azure.resourcemanager.networkcloud.implementation.KubernetesClustersClientImpl$KubernetesClustersService"],["com.azure.resourcemanager.networkcloud.implementation.L2NetworksClientImpl$L2NetworksService"],["com.azure.resourcemanager.networkcloud.implementation.L3NetworksClientImpl$L3NetworksService"],["com.azure.resourcemanager.networkcloud.implementation.MetricsConfigurationsClientImpl$MetricsConfigurationsService"],["com.azure.resourcemanager.networkcloud.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.networkcloud.implementation.RackSkusClientImpl$RackSkusService"],["com.azure.resourcemanager.networkcloud.implementation.RacksClientImpl$RacksService"],["com.azure.resourcemanager.networkcloud.implementation.StorageAppliancesClientImpl$StorageAppliancesService"],["com.azure.resourcemanager.networkcloud.implementation.TrunkedNetworksClientImpl$TrunkedNetworksService"],["com.azure.resourcemanager.networkcloud.implementation.VirtualMachinesClientImpl$VirtualMachinesService"],["com.azure.resourcemanager.networkcloud.implementation.VolumesClientImpl$VolumesService"]] \ No newline at end of file diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/reflect-config.json b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/reflect-config.json new file mode 100644 index 0000000000000..0637a088a01e8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkcloud/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsCreateOrUpdateSamples.java index 1d85c6c40823a..080113bfa02df 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsCreateOrUpdateSamples.java @@ -22,64 +22,52 @@ import java.util.HashMap; import java.util.Map; -/** Samples for AgentPools CreateOrUpdate. */ +/** + * Samples for AgentPools CreateOrUpdate. + */ public final class AgentPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Create.json */ /** * Sample code: Create or update Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + createOrUpdateKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .define("agentPoolName") .withRegion("location") .withExistingKubernetesCluster("resourceGroupName", "kubernetesClusterName") .withCount(3L) .withMode(AgentPoolMode.SYSTEM) - .withVmSkuName("NC_M16_v1") + .withVmSkuName("NC_P46_224_v1") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) .withAvailabilityZones(Arrays.asList("1", "2", "3")) .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withTaints(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteSamples.java index 0d9093b318831..e7cd98ae65aa9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for AgentPools Delete. */ +/** + * Samples for AgentPools Delete. + */ public final class AgentPoolsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Delete.json */ /** * Sample code: Delete Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + deleteKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .delete("resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsGetSamples.java index 2686e814c088e..11abc122e44f7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for AgentPools Get. */ +/** + * Samples for AgentPools Get. + */ public final class AgentPoolsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Get.json */ /** * Sample code: Get Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() - .getWithResponse( - "resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE); + public static void + getKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "agentPoolName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsListByKubernetesClusterSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsListByKubernetesClusterSamples.java index 77d485a54102d..afceae0c034ad 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsListByKubernetesClusterSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsListByKubernetesClusterSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for AgentPools ListByKubernetesCluster. */ +/** + * Samples for AgentPools ListByKubernetesCluster. + */ public final class AgentPoolsListByKubernetesClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_ListByKubernetesCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_ListByKubernetesCluster.json */ /** * Sample code: List agent pools of the Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listAgentPoolsOfTheKubernetesCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .agentPools() + public static void + listAgentPoolsOfTheKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.agentPools() .listByKubernetesCluster("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsUpdateSamples.java index 8e94757c0e929..61fcbf227fd3c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsUpdateSamples.java @@ -6,32 +6,39 @@ import com.azure.resourcemanager.networkcloud.models.AgentPool; import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.networkcloud.models.NodePoolAdministratorConfigurationPatch; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for AgentPools Update. */ +/** + * Samples for AgentPools Update. + */ public final class AgentPoolsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/AgentPools_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * AgentPools_Patch.json */ /** * Sample code: Patch Kubernetes cluster agent pool. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchKubernetesClusterAgentPool( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - AgentPool resource = - manager - .agentPools() - .getWithResponse( - "resourceGroupName", "kubernetesClusterName", "agentPoolName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchKubernetesClusterAgentPool(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + AgentPool resource = manager.agentPools() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "agentPoolName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAdministratorConfiguration(new NodePoolAdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withCount(3L) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withUpgradeSettings( + new AgentPoolUpgradeSettings().withDrainTimeout(1800L).withMaxSurge("1").withMaxUnavailable("0")) .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java index 22a538c78c444..ea3f4890ca8ab 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java @@ -13,43 +13,42 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachineKeySets CreateOrUpdate. */ +/** + * Samples for BareMetalMachineKeySets CreateOrUpdate. + */ public final class BareMetalMachineKeySetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Create.json */ /** * Sample code: Create or update bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateBareMetalMachineKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + manager.bareMetalMachineKeySets() .define("bareMetalMachineKeySetName") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) .withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel.STANDARD) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withOsGroupName("standardAccessGroup") .create(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java index 262db267e5075..47b2715544815 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachineKeySets Delete. */ +/** + * Samples for BareMetalMachineKeySets Delete. + */ public final class BareMetalMachineKeySetsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Delete.json */ /** * Sample code: Delete bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + public static void + deleteBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() .delete("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java index 881df99a00d8e..89bfef5aa3eaa 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachineKeySets Get. */ +/** + * Samples for BareMetalMachineKeySets Get. + */ public final class BareMetalMachineKeySetsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Get.json */ /** * Sample code: Get bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() - .getWithResponse( - "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + public static void + getBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByClusterSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByClusterSamples.java index 89a278476e339..d11114235122f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByClusterSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByClusterSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachineKeySets ListByCluster. */ +/** + * Samples for BareMetalMachineKeySets ListByCluster. + */ public final class BareMetalMachineKeySetsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_ListByCluster.json */ /** * Sample code: List bare metal machine key sets of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachineKeySetsOfTheCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachineKeySets() + public static void + listBareMetalMachineKeySetsOfTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachineKeySets() .listByCluster("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java index 38d6cbbf51ae2..b46359fe66499 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java @@ -12,40 +12,39 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachineKeySets Update. */ +/** + * Samples for BareMetalMachineKeySets Update. + */ public final class BareMetalMachineKeySetsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachineKeySets_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachineKeySets_Patch.json */ /** * Sample code: Patch bare metal machine key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchBareMetalMachineKeySetOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BareMetalMachineKeySet resource = - manager - .bareMetalMachineKeySets() - .getWithResponse( - "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchBareMetalMachineKeySetOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachineKeySet resource = manager.bareMetalMachineKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java index 62186e6016f84..3530b11f91f66 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java @@ -7,22 +7,23 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; -/** Samples for BareMetalMachines Cordon. */ +/** + * Samples for BareMetalMachines Cordon. + */ public final class BareMetalMachinesCordonSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Cordon.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Cordon.json */ /** * Sample code: Cordon bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void cordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .cordon( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .cordon("resourceGroupName", "bareMetalMachineName", new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.TRUE), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java index cd7d8078a4d27..2bf481f29c545 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java @@ -9,28 +9,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachines CreateOrUpdate. */ +/** + * Samples for BareMetalMachines CreateOrUpdate. + */ public final class BareMetalMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Create.json */ /** * Sample code: Create or update bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + public static void + createOrUpdateBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() .define("bareMetalMachineName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withBmcConnectionString("bmcconnectionstring") .withBmcCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java index 0f4429ee15991..58a9e91aa863d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines Delete. */ +/** + * Samples for BareMetalMachines Delete. + */ public final class BareMetalMachinesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Delete.json */ /** * Sample code: Delete bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .delete("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java index 7b88b8f450514..7edf3db3a1fe0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines GetByResourceGroup. */ +/** + * Samples for BareMetalMachines GetByResourceGroup. + */ public final class BareMetalMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Get.json */ /** * Sample code: Get bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + manager.bareMetalMachines() + .getByResourceGroupWithResponse("resourceGroupName", "bareMetalMachineName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java index 393438699787c..06f128cacbada 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines ListByResourceGroup. */ +/** + * Samples for BareMetalMachines ListByResourceGroup. + */ public final class BareMetalMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_ListByResourceGroup.json */ /** * Sample code: List bare metal machines for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachinesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listBareMetalMachinesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.bareMetalMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java index 04f6c342bd268..037f028882899 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines List. */ +/** + * Samples for BareMetalMachines List. + */ public final class BareMetalMachinesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_ListBySubscription.json */ /** * Sample code: List bare metal machines for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listBareMetalMachinesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listBareMetalMachinesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.bareMetalMachines().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java index 0cbe72037ee86..9fa16787605f4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java @@ -7,22 +7,23 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; -/** Samples for BareMetalMachines PowerOff. */ +/** + * Samples for BareMetalMachines PowerOff. + */ public final class BareMetalMachinesPowerOffSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_PowerOff.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_PowerOff.json */ /** * Sample code: Power off bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void powerOffBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .powerOff( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .powerOff("resourceGroupName", "bareMetalMachineName", new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.TRUE), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java index e447b2dc0bff7..6ffff6eba4858 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines Reimage. */ +/** + * Samples for BareMetalMachines Reimage. + */ public final class BareMetalMachinesReimageSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Reimage.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Reimage.json */ /** * Sample code: Reimage bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void reimageBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .reimage("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java index 8377cce7d2623..9d3e9f4354df3 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java @@ -7,22 +7,23 @@ import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; -/** Samples for BareMetalMachines Replace. */ +/** + * Samples for BareMetalMachines Replace. + */ public final class BareMetalMachinesReplaceSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Replace.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Replace.json */ /** * Sample code: Replace bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void replaceBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .replace( - "resourceGroupName", - "bareMetalMachineName", + manager.bareMetalMachines() + .replace("resourceGroupName", "bareMetalMachineName", new BareMetalMachineReplaceParameters() .withBmcCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java index 97152def6310d..629a73fca156d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines Restart. */ +/** + * Samples for BareMetalMachines Restart. + */ public final class BareMetalMachinesRestartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Restart.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Restart.json */ /** * Sample code: Restart bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void restartBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .restart("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java index 7c39a3f7b145b..c2f0d873ee1ff 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java @@ -7,25 +7,25 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunCommand. */ +/** + * Samples for BareMetalMachines RunCommand. + */ public final class BareMetalMachinesRunCommandSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunCommand.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunCommand.json */ /** * Sample code: Run command on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void runCommandOnBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runCommand( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunCommandParameters() - .withArguments(Arrays.asList("--argument1", "argument2")) + public static void + runCommandOnBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() + .runCommand("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunCommandParameters().withArguments(Arrays.asList("--argument1", "argument2")) .withLimitTimeSeconds(60L) .withScript("cHdkCg=="), com.azure.core.util.Context.NONE); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java index dc0c9516837d4..e9506b600c4e1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java @@ -8,30 +8,27 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunDataExtracts. */ +/** + * Samples for BareMetalMachines RunDataExtracts. + */ public final class BareMetalMachinesRunDataExtractsSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunDataExtracts.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunDataExtracts.json */ /** * Sample code: Run data extraction on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void runDataExtractionOnBareMetalMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runDataExtracts( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunDataExtractsParameters() - .withCommands( - Arrays - .asList( - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("SysInfo", "TTYLog")) - .withCommand("hardware-support-data-collection"))) + public static void + runDataExtractionOnBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines() + .runDataExtracts("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunDataExtractsParameters().withCommands(Arrays + .asList(new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("SysInfo", "TTYLog")) + .withCommand("hardware-support-data-collection"))) .withLimitTimeSeconds(60L), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java index e6ae0cd53e6ba..eb5e28da09735 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java @@ -8,33 +8,29 @@ import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; import java.util.Arrays; -/** Samples for BareMetalMachines RunReadCommands. */ +/** + * Samples for BareMetalMachines RunReadCommands. + */ public final class BareMetalMachinesRunReadCommandsSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_RunReadCommands.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_RunReadCommands.json */ /** * Sample code: Run and retrieve output from read only commands on bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() - .runReadCommands( - "resourceGroupName", - "bareMetalMachineName", - new BareMetalMachineRunReadCommandsParameters() - .withCommands( - Arrays - .asList( - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("pods", "-A")) - .withCommand("kubectl get"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("192.168.0.99", "-c", "3")) - .withCommand("ping"))) + manager.bareMetalMachines() + .runReadCommands("resourceGroupName", "bareMetalMachineName", + new BareMetalMachineRunReadCommandsParameters().withCommands(Arrays.asList( + new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("pods", "-A")) + .withCommand("kubectl get"), + new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("192.168.0.99", "-c", "3")) + .withCommand("ping"))) .withLimitTimeSeconds(60L), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java index 2aca2ec76dac5..de4f18be350eb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines Start. */ +/** + * Samples for BareMetalMachines Start. + */ public final class BareMetalMachinesStartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Start.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Start.json */ /** * Sample code: Start bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void startBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .start("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java index fa920647594ef..93532340ad0ac 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BareMetalMachines Uncordon. */ +/** + * Samples for BareMetalMachines Uncordon. + */ public final class BareMetalMachinesUncordonSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Uncordon.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Uncordon.json */ /** * Sample code: Uncordon bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void uncordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bareMetalMachines() + manager.bareMetalMachines() .uncordon("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java index 85499dddf77a6..bbd5bacee6d77 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java @@ -8,25 +8,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BareMetalMachines Update. */ +/** + * Samples for BareMetalMachines Update. + */ public final class BareMetalMachinesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BareMetalMachines_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BareMetalMachines_Patch.json */ /** * Sample code: Patch bare metal machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BareMetalMachine resource = - manager - .bareMetalMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + BareMetalMachine resource = manager.bareMetalMachines() + .getByResourceGroupWithResponse("resourceGroupName", "bareMetalMachineName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withMachineDetails("machinedetails") .apply(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java index ebb467b3b296d..ef2995b9c69b1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java @@ -13,42 +13,41 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BmcKeySets CreateOrUpdate. */ +/** + * Samples for BmcKeySets CreateOrUpdate. + */ public final class BmcKeySetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Create.json */ /** * Sample code: Create or update baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .define("bmcKeySetName") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) .withPrivilegeLevel(BmcKeySetPrivilegeLevel.ADMINISTRATOR) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java index 3807391886264..6b7bd787db810 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BmcKeySets Delete. */ +/** + * Samples for BmcKeySets Delete. + */ public final class BmcKeySetsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Delete.json */ /** * Sample code: Delete baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .delete("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java index e60dd0c054d11..376cf3c777522 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BmcKeySets Get. */ +/** + * Samples for BmcKeySets Get. + */ public final class BmcKeySetsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Get.json */ /** * Sample code: Get baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .bmcKeySets() + manager.bmcKeySets() .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByClusterSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByClusterSamples.java index d3986d164c176..b95a67f57fe95 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByClusterSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByClusterSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for BmcKeySets ListByCluster. */ +/** + * Samples for BmcKeySets ListByCluster. + */ public final class BmcKeySetsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_ListByCluster.json */ /** * Sample code: List baseboard management controller key sets of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listBaseboardManagementControllerKeySetsOfTheCluster( diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java index d869b4c489a5e..974179ffad865 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java @@ -12,38 +12,37 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BmcKeySets Update. */ +/** + * Samples for BmcKeySets Update. + */ public final class BmcKeySetsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/BmcKeySets_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * BmcKeySets_Patch.json */ /** * Sample code: Patch baseboard management controller key set of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchBaseboardManagementControllerKeySetOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - BmcKeySet resource = - manager - .bmcKeySets() - .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + BmcKeySet resource = manager.bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) - .withUserList( - Arrays - .asList( - new KeySetUser() - .withAzureUsername("userABC") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), - new KeySetUser() - .withAzureUsername("userXYZ") - .withDescription("Needs access for troubleshooting as a part of the support team") - .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withUserList(Arrays.asList( + new KeySetUser().withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"), + new KeySetUser().withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withUserPrincipalName("userABC@contoso.com"))) .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java index 0c9da197206ed..081673f4fa13c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java @@ -12,40 +12,33 @@ import java.util.HashMap; import java.util.Map; -/** Samples for CloudServicesNetworks CreateOrUpdate. */ +/** + * Samples for CloudServicesNetworks CreateOrUpdate. + */ public final class CloudServicesNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Create.json */ /** * Sample code: Create or update cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateCloudServicesNetwork( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() + public static void + createOrUpdateCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks() .define("cloudServicesNetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAdditionalEgressEndpoints( - Arrays - .asList( - new EgressEndpoint() - .withCategory("azure-resource-management") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("https://storageaccountex.blob.core.windows.net") - .withPort(443L))))) + .withAdditionalEgressEndpoints(Arrays.asList(new EgressEndpoint().withCategory("azure-resource-management") + .withEndpoints(Arrays.asList( + new EndpointDependency().withDomainName("storageaccountex.blob.core.windows.net").withPort(443L))))) .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java index 521d4b55c4bd9..55bd606182f70 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for CloudServicesNetworks Delete. */ +/** + * Samples for CloudServicesNetworks Delete. + */ public final class CloudServicesNetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Delete.json */ /** * Sample code: Delete cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() + manager.cloudServicesNetworks() .delete("resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java index ea0a417dcc819..3949527df029e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for CloudServicesNetworks GetByResourceGroup. */ +/** + * Samples for CloudServicesNetworks GetByResourceGroup. + */ public final class CloudServicesNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Get.json */ /** * Sample code: Get cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .cloudServicesNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + manager.cloudServicesNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "cloudServicesNetworkName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java index 7cf873b953596..b4037678e1091 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for CloudServicesNetworks ListByResourceGroup. */ +/** + * Samples for CloudServicesNetworks ListByResourceGroup. + */ public final class CloudServicesNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_ListByResourceGroup.json */ /** * Sample code: List cloud services networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listCloudServicesNetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listCloudServicesNetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.cloudServicesNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java index 83939b9384ce8..458f7bdc7a233 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for CloudServicesNetworks List. */ +/** + * Samples for CloudServicesNetworks List. + */ public final class CloudServicesNetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_ListBySubscription.json */ /** * Sample code: List cloud services networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listCloudServicesNetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listCloudServicesNetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.cloudServicesNetworks().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java index 3151e7ec647a2..a5f439735ea5b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java @@ -12,37 +12,30 @@ import java.util.HashMap; import java.util.Map; -/** Samples for CloudServicesNetworks Update. */ +/** + * Samples for CloudServicesNetworks Update. + */ public final class CloudServicesNetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/CloudServicesNetworks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * CloudServicesNetworks_Patch.json */ /** * Sample code: Patch cloud services network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - CloudServicesNetwork resource = - manager - .cloudServicesNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + CloudServicesNetwork resource = manager.cloudServicesNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "cloudServicesNetworkName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAdditionalEgressEndpoints( - Arrays - .asList( - new EgressEndpoint() - .withCategory("azure-resource-management") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("https://storageaccountex.blob.core.windows.net") - .withPort(443L))))) + .withAdditionalEgressEndpoints(Arrays.asList(new EgressEndpoint().withCategory("azure-resource-management") + .withEndpoints(Arrays.asList( + new EndpointDependency().withDomainName("storageaccountex.blob.core.windows.net").withPort(443L))))) .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java index 4c33f68f63368..13a994454fb82 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java @@ -5,29 +5,66 @@ package com.azure.resourcemanager.networkcloud.generated; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ClusterManagers CreateOrUpdate. */ +/** + * Samples for ClusterManagers CreateOrUpdate. + */ public final class ClusterManagersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Create.json */ /** * Sample code: Create or update cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateClusterManager( + public static void + createOrUpdateClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers() + .define("clusterManagerName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withFabricControllerId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAnalyticsWorkspaceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Create_Uami.json + */ + /** + * Sample code: Create or update cluster manager with user assigned identity. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateClusterManagerWithUserAssignedIdentity( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusterManagers() + manager.clusterManagers() .define("clusterManagerName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") .withFabricControllerId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + new UserAssignedIdentity()))) .withAnalyticsWorkspaceId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") .withManagedResourceGroupConfiguration( diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java index 08c69d5096bb6..adb104531d95c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for ClusterManagers Delete. */ +/** + * Samples for ClusterManagers Delete. + */ public final class ClusterManagersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Delete.json */ /** * Sample code: Delete cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java index 87d9203cb16f2..c663794792d2d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for ClusterManagers GetByResourceGroup. */ +/** + * Samples for ClusterManagers GetByResourceGroup. + */ public final class ClusterManagersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Get.json */ /** * Sample code: Get cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusterManagers() - .getByResourceGroupWithResponse( - "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + manager.clusterManagers() + .getByResourceGroupWithResponse("resourceGroupName", "clusterManagerName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java index 2ed4f3ceecfb6..bde159955e48f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for ClusterManagers ListByResourceGroup. */ +/** + * Samples for ClusterManagers ListByResourceGroup. + */ public final class ClusterManagersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_ListByResourceGroup.json */ /** * Sample code: List cluster managers for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClusterManagersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClusterManagersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusterManagers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java index 730909ec7d8b6..0f2b9253b63e7 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for ClusterManagers List. */ +/** + * Samples for ClusterManagers List. + */ public final class ClusterManagersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_ListBySubscription.json */ /** * Sample code: List cluster managers for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClusterManagersForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClusterManagersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusterManagers().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java index 5470292bf0908..6553de9ca0fbb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java @@ -5,27 +5,39 @@ package com.azure.resourcemanager.networkcloud.generated; import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ClusterManagers Update. */ +/** + * Samples for ClusterManagers Update. + */ public final class ClusterManagersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterManagers_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterManagers_Patch.json */ /** * Sample code: Patch cluster manager. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - ClusterManager resource = - manager - .clusterManagers() - .getByResourceGroupWithResponse( - "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + ClusterManager resource = manager.clusterManagers() + .getByResourceGroupWithResponse("resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .apply(); } // Use "Map.of" if available diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersContinueUpdateVersionSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersContinueUpdateVersionSamples.java new file mode 100644 index 0000000000000..d5aeb14a982e5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersContinueUpdateVersionSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionMachineGroupTargetingMode; +import com.azure.resourcemanager.networkcloud.models.ClusterContinueUpdateVersionParameters; + +/** + * Samples for Clusters ContinueUpdateVersion. + */ +public final class ClustersContinueUpdateVersionSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ContinueUpdateVersion.json + */ + /** + * Sample code: Continue update cluster version. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + continueUpdateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .continueUpdateVersion("resourceGroupName", "clusterName", + new ClusterContinueUpdateVersionParameters() + .withMachineGroupTargetingMode(ClusterContinueUpdateVersionMachineGroupTargetingMode.ALPHA_BY_RACK), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java index df11b2cbd3f0f..ac0f18196c87e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java @@ -5,152 +5,169 @@ package com.azure.resourcemanager.networkcloud.generated; import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategyType; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IdentitySelector; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentitySelectorType; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionEnforcementLevel; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettings; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsContainerScan; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Clusters CreateOrUpdate. */ +/** + * Samples for Clusters CreateOrUpdate. + */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Create.json */ /** * Sample code: Create or update cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() + manager.clusters() .define("clusterName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) .withAggregatorOrSingleRackDefinition( new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) .withNetworkRackId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") .withRackSerialNumber("AA1234") .withRackSkuId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName")))) + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) .withClusterType(ClusterType.SINGLE_RACK) .withClusterVersion("1.0.0") .withNetworkFabricId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withAnalyticsWorkspaceId( + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + new UserAssignedIdentity()))) + .withAnalyticsOutputSettings(new AnalyticsOutputSettings().withAnalyticsWorkspaceId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1"))) .withClusterLocation("Foo Street, 3rd Floor, row 9") .withClusterServicePrincipal( - new ServicePrincipalInformation() - .withApplicationId("12345678-1234-1234-1234-123456789012") + new ServicePrincipalInformation().withApplicationId("12345678-1234-1234-1234-123456789012") .withPassword("fakeTokenPlaceholder") .withPrincipalId("00000008-0004-0004-0004-000000000012") .withTenantId("80000000-4000-4000-4000-120000000000")) + .withCommandOutputSettings(new CommandOutputSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withContainerUrl("https://myaccount.blob.core.windows.net/mycontainer?restype=container")) .withComputeDeploymentThreshold( - new ValidationThreshold() - .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + new ValidationThreshold().withGrouping(ValidationThresholdGrouping.PER_CLUSTER) .withType(ValidationThresholdType.PERCENT_SUCCESS) .withValue(90L)) - .withComputeRackDefinitions( - Arrays - .asList( - new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) - .withNetworkRackId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") - .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") - .withRackSerialNumber("AA1234") - .withRackSkuId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName"))))) + .withComputeRackDefinitions(Arrays.asList(new RackDefinition() + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName"))))) .withManagedResourceGroupConfiguration( new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .withRuntimeProtectionConfiguration( + new RuntimeProtectionConfiguration().withEnforcementLevel(RuntimeProtectionEnforcementLevel.ON_DEMAND)) + .withSecretArchiveSettings(new SecretArchiveSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withVaultUri("https://keyvaultname.vault.azure.net/")) + .withUpdateStrategy(new ClusterUpdateStrategy().withMaxUnavailable(4L) + .withStrategyType(ClusterUpdateStrategyType.RACK) + .withThresholdType(ValidationThresholdType.COUNT_SUCCESS) + .withThresholdValue(4L) + .withWaitTimeMinutes(10L)) + .withVulnerabilityScanningSettings(new VulnerabilityScanningSettings() + .withContainerScan(VulnerabilityScanningSettingsContainerScan.ENABLED)) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java index 85ee29feb97bf..22304d363f126 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Clusters Delete. */ +/** + * Samples for Clusters Delete. + */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Delete.json */ /** * Sample code: Delete cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java index 9c825b19ba1a0..4b935ddf7989d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java @@ -7,38 +7,40 @@ import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; import java.util.Arrays; -/** Samples for Clusters Deploy. */ +/** + * Samples for Clusters Deploy. + */ public final class ClustersDeploySamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Deploy.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Deploy.json */ /** * Sample code: Deploy cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deployCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .deploy( - "resourceGroupName", "clusterName", new ClusterDeployParameters(), com.azure.core.util.Context.NONE); + manager.clusters() + .deploy("resourceGroupName", "clusterName", new ClusterDeployParameters(), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Deploy_SkipValidation.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Deploy_SkipValidation.json */ /** * Sample code: Deploy cluster skipping validation. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deployClusterSkippingValidation( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .deploy( - "resourceGroupName", - "clusterName", + public static void + deployClusterSkippingValidation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .deploy("resourceGroupName", "clusterName", new ClusterDeployParameters().withSkipValidationsForMachines(Arrays.asList("bmmName1")), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java index 61c24559c2b0a..75fe7a08e4082 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Clusters GetByResourceGroup. */ +/** + * Samples for Clusters GetByResourceGroup. + */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Get.json */ /** * Sample code: Get cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() + manager.clusters() .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java index ad1772a28588b..382f349dd0e52 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Clusters ListByResourceGroup. */ +/** + * Samples for Clusters ListByResourceGroup. + */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ListByResourceGroup.json */ /** * Sample code: List clusters for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listClustersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listClustersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.clusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java index 6ee6609d1d9b8..b0c0621c51af1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Clusters List. */ +/** + * Samples for Clusters List. + */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ListBySubscription.json */ /** * Sample code: List clusters for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersScanRuntimeSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersScanRuntimeSamples.java new file mode 100644 index 0000000000000..406731dbb10fe --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersScanRuntimeSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterScanRuntimeParametersScanActivity; + +/** + * Samples for Clusters ScanRuntime. + */ +public final class ClustersScanRuntimeSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_ScanRuntime.json + */ + /** + * Sample code: Execute a runtime protection scan on the cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + executeARuntimeProtectionScanOnTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters() + .scanRuntime("resourceGroupName", "clusterName", + new ClusterScanRuntimeParameters().withScanActivity(ClusterScanRuntimeParametersScanActivity.SCAN), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java index 904c2b4b3aff2..04b5714634b36 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java @@ -5,110 +5,266 @@ package com.azure.resourcemanager.networkcloud.generated; import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.AnalyticsOutputSettings; import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategy; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateStrategyType; +import com.azure.resourcemanager.networkcloud.models.CommandOutputSettings; +import com.azure.resourcemanager.networkcloud.models.IdentitySelector; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentitySelectorType; +import com.azure.resourcemanager.networkcloud.models.ManagedServiceIdentityType; import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionConfiguration; +import com.azure.resourcemanager.networkcloud.models.RuntimeProtectionEnforcementLevel; +import com.azure.resourcemanager.networkcloud.models.SecretArchiveSettings; import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.UserAssignedIdentity; import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsContainerScan; +import com.azure.resourcemanager.networkcloud.models.VulnerabilityScanningSettingsPatch; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Clusters Update. */ +/** + * Samples for Clusters Update. + */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Patch_Location.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_UpdateStrategy.json + */ + /** + * Sample code: Patch update strategy. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchUpdateStrategy(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withUpdateStrategy(new ClusterUpdateStrategy().withMaxUnavailable(4L) + .withStrategyType(ClusterUpdateStrategyType.RACK) + .withThresholdType(ValidationThresholdType.COUNT_SUCCESS) + .withThresholdValue(4L) + .withWaitTimeMinutes(10L)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_VulnerabilityScanning.json + */ + /** + * Sample code: Patch vulnerability scanning. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVulnerabilityScanning(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withVulnerabilityScanningSettings(new VulnerabilityScanningSettingsPatch() + .withContainerScan(VulnerabilityScanningSettingsContainerScan.ENABLED)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_Location.json */ /** * Sample code: Patch cluster location. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterLocation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Cluster resource = - manager - .clusters() - .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withClusterLocation("Foo Street, 3rd Floor, row 9") .apply(); } /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_AggregatorOrSingleRackDefinition.json */ /** * Sample code: Patch cluster AggregatorOrSingleRackDefinition. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchClusterAggregatorOrSingleRackDefinition( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Cluster resource = - manager - .clusters() - .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withAggregatorOrSingleRackDefinition( new RackDefinition() - .withBareMetalMachineConfigurationData( - Arrays - .asList( - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:FF") - .withBootMacAddress("00:BB:CC:DD:EE:FF") - .withMachineDetails("extraDetails") - .withMachineName("bmmName1") - .withRackSlot(1L) - .withSerialNumber("BM1219XXX"), - new BareMetalMachineConfigurationData() - .withBmcCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withBmcMacAddress("AA:BB:CC:DD:EE:00") - .withBootMacAddress("00:BB:CC:DD:EE:00") - .withMachineDetails("extraDetails") - .withMachineName("bmmName2") - .withRackSlot(2L) - .withSerialNumber("BM1219YYY"))) + .withBareMetalMachineConfigurationData(Arrays.asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) .withNetworkRackId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") .withRackSerialNumber("newSerialNumber") .withRackSkuId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") - .withStorageApplianceConfigurationData( - Arrays - .asList( - new StorageApplianceConfigurationData() - .withAdminCredentials( - new AdministrativeCredentials() - .withPassword("fakeTokenPlaceholder") - .withUsername("username")) - .withRackSlot(1L) - .withSerialNumber("BM1219XXX") - .withStorageApplianceName("vmName")))) + .withStorageApplianceConfigurationData(Arrays.asList(new StorageApplianceConfigurationData() + .withAdminCredentials(new AdministrativeCredentials().withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) .withComputeDeploymentThreshold( - new ValidationThreshold() - .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + new ValidationThreshold().withGrouping(ValidationThresholdGrouping.PER_CLUSTER) .withType(ValidationThresholdType.PERCENT_SUCCESS) .withValue(90L)) .apply(); } + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_CommandOutput.json + */ + /** + * Sample code: Patch cluster command output. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterCommandOutput(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .withCommandOutputSettings(new CommandOutputSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2")) + .withContainerUrl("https://myaccount.blob.core.windows.net/mycontainer?restype=container")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_RuntimeProtectionConfiguration.json + */ + /** + * Sample code: Patch runtime protection configuration. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + patchRuntimeProtectionConfiguration(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withRuntimeProtectionConfiguration( + new RuntimeProtectionConfiguration().withEnforcementLevel(RuntimeProtectionEnforcementLevel.ON_DEMAND)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_SecretArchive.json + */ + /** + * Sample code: Patch secret archive. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchSecretArchive(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withSecretArchiveSettings(new SecretArchiveSettings().withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1")) + .withVaultUri("https://keyvaultname.vault.azure.net/")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_Patch_AnalyticsOutput.json + */ + /** + * Sample code: Patch cluster analytics output. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterAnalyticsOutput(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", + null, + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2", + new UserAssignedIdentity()))) + .withAnalyticsOutputSettings(new AnalyticsOutputSettings().withAnalyticsWorkspaceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withAssociatedIdentity(new IdentitySelector() + .withIdentityType(ManagedServiceIdentitySelectorType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity2"))) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java index 0938646d0114d..e4081921576cb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java @@ -6,23 +6,23 @@ import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; -/** Samples for Clusters UpdateVersion. */ +/** + * Samples for Clusters UpdateVersion. + */ public final class ClustersUpdateVersionSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Clusters_UpdateVersion.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Clusters_UpdateVersion.json */ /** * Sample code: Update cluster version. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void updateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .clusters() - .updateVersion( - "resourceGroupName", - "clusterName", - new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), - com.azure.core.util.Context.NONE); + manager.clusters() + .updateVersion("resourceGroupName", "clusterName", + new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java index 17f53f2276cd7..f5a84ee4e9133 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java @@ -11,28 +11,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Consoles CreateOrUpdate. */ +/** + * Samples for Consoles CreateOrUpdate. + */ public final class ConsolesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Create.json */ /** * Sample code: Create or update virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateVirtualMachineConsole( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + public static void + createOrUpdateVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.consoles() .define("default") .withRegion("location") .withExistingVirtualMachine("resourceGroupName", "virtualMachineName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) .withEnabled(ConsoleEnabled.TRUE) .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java index 045aa6ff63f69..93045d2672233 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Consoles Delete. */ +/** + * Samples for Consoles Delete. + */ public final class ConsolesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Delete.json */ /** * Sample code: Delete virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + manager.consoles() .delete("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java index 132e5ecaf661c..f38610491b504 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Consoles Get. */ +/** + * Samples for Consoles Get. + */ public final class ConsolesGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Get.json */ /** * Sample code: Get virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + manager.consoles() .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByVirtualMachineSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByVirtualMachineSamples.java index cbd6a0a7fb890..4e6b8876e41f1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByVirtualMachineSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByVirtualMachineSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Consoles ListByVirtualMachine. */ +/** + * Samples for Consoles ListByVirtualMachine. + */ public final class ConsolesListByVirtualMachineSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_ListByVirtualMachine.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_ListByVirtualMachine.json */ /** * Sample code: List consoles of the virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listConsolesOfTheVirtualMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .consoles() + public static void + listConsolesOfTheVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.consoles() .listByVirtualMachine("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java index 87c860cf5085d..8dc831e8f5397 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java @@ -11,24 +11,25 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Consoles Update. */ +/** + * Samples for Consoles Update. + */ public final class ConsolesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Consoles_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Consoles_Patch.json */ /** * Sample code: Patch virtual machine console. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Console resource = - manager - .consoles() - .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Console resource = manager.consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withEnabled(ConsoleEnabled.TRUE) .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..085601a1c7384 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesCreateOrUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KubernetesClusterFeatures CreateOrUpdate. + */ +public final class KubernetesClusterFeaturesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Create.json + */ + /** + * Sample code: Create or update Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + createOrUpdateKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .define("featureName") + .withRegion("location") + .withExistingKubernetesCluster("resourceGroupName", "kubernetesClusterName") + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withOptions( + Arrays.asList(new StringKeyValuePair().withKey("fakeTokenPlaceholder").withValue("featureOptionValue"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesDeleteSamples.java new file mode 100644 index 0000000000000..ebcf697db7503 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesDeleteSamples.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.networkcloud.generated; + +/** + * Samples for KubernetesClusterFeatures Delete. + */ +public final class KubernetesClusterFeaturesDeleteSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Delete.json + */ + /** + * Sample code: Delete Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + deleteKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .delete("resourceGroupName", "kubernetesClusterName", "featureName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesGetSamples.java new file mode 100644 index 0000000000000..7b86c455b73e1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesGetSamples.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.networkcloud.generated; + +/** + * Samples for KubernetesClusterFeatures Get. + */ +public final class KubernetesClusterFeaturesGetSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Get.json + */ + /** + * Sample code: Get Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "featureName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesListByKubernetesClusterSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesListByKubernetesClusterSamples.java new file mode 100644 index 0000000000000..79f566cf3c636 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesListByKubernetesClusterSamples.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.networkcloud.generated; + +/** + * Samples for KubernetesClusterFeatures ListByKubernetesCluster. + */ +public final class KubernetesClusterFeaturesListByKubernetesClusterSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_ListByKubernetesCluster.json + */ + /** + * Sample code: List features for the Kubernetes cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + listFeaturesForTheKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusterFeatures() + .listByKubernetesCluster("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesUpdateSamples.java new file mode 100644 index 0000000000000..a99eba35d3a32 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterFeaturesUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.KubernetesClusterFeature; +import com.azure.resourcemanager.networkcloud.models.StringKeyValuePair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KubernetesClusterFeatures Update. + */ +public final class KubernetesClusterFeaturesUpdateSamples { + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusterFeatures_Patch.json + */ + /** + * Sample code: Patch Kubernetes cluster feature. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void + patchKubernetesClusterFeature(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + KubernetesClusterFeature resource = manager.kubernetesClusterFeatures() + .getWithResponse("resourceGroupName", "kubernetesClusterName", "featureName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withOptions( + Arrays.asList(new StringKeyValuePair().withKey("fakeTokenPlaceholder").withValue("featureOptionValue"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersCreateOrUpdateSamples.java index 6b171277e011b..a086847af8394 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersCreateOrUpdateSamples.java @@ -24,6 +24,7 @@ import com.azure.resourcemanager.networkcloud.models.KubernetesLabel; import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; import com.azure.resourcemanager.networkcloud.models.L2NetworkAttachmentConfiguration; +import com.azure.resourcemanager.networkcloud.models.L2ServiceLoadBalancerConfiguration; import com.azure.resourcemanager.networkcloud.models.L3NetworkAttachmentConfiguration; import com.azure.resourcemanager.networkcloud.models.L3NetworkConfigurationIpamEnabled; import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; @@ -35,155 +36,192 @@ import java.util.HashMap; import java.util.Map; -/** Samples for KubernetesClusters CreateOrUpdate. */ +/** + * Samples for KubernetesClusters CreateOrUpdate. + */ public final class KubernetesClustersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Create.json */ /** * Sample code: Create or update Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateKubernetesCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() + public static void + createOrUpdateKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() .define("kubernetesClusterName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withControlPlaneNodeConfiguration( - new ControlPlaneNodeConfiguration() - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) - .withAvailabilityZones(Arrays.asList("1", "2", "3")) - .withCount(3L) - .withVmSkuName("NC_G4_v1")) - .withInitialAgentPoolConfigurations( - Arrays - .asList( - new InitialAgentPoolConfiguration() - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") - .withSshPublicKeys( - Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) - .withAgentOptions( - new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) - .withAvailabilityZones(Arrays.asList("1", "2", "3")) - .withCount(3L) - .withLabels( - Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withMode(AgentPoolMode.SYSTEM) - .withName("SystemPool-1") - .withTaints( - Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) - .withVmSkuName("NC_M16_v1"))) - .withKubernetesVersion("1.24.12-1") - .withNetworkConfiguration( - new NetworkConfiguration() - .withAttachedNetworkConfiguration( - new AttachedNetworkConfiguration() - .withL2Networks( - Arrays - .asList( - new L2NetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks( - Arrays - .asList( - new L3NetworkAttachmentConfiguration() - .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withPluginType(KubernetesPluginType.SRIOV))) - .withTrunkedNetworks( - Arrays - .asList( - new TrunkedNetworkAttachmentConfiguration() - .withNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") - .withPluginType(KubernetesPluginType.MACVLAN)))) - .withBgpServiceLoadBalancerConfiguration( - new BgpServiceLoadBalancerConfiguration() - .withBgpAdvertisements( - Arrays - .asList( - new BgpAdvertisement() - .withAdvertiseToFabric(AdvertiseToFabric.TRUE) - .withCommunities(Arrays.asList("64512:100")) - .withIpAddressPools(Arrays.asList("pool1")) - .withPeers(Arrays.asList("peer1")))) - .withBgpPeers( - Arrays - .asList( - new ServiceLoadBalancerBgpPeer() - .withBfdEnabled(BfdEnabled.FALSE) - .withBgpMultiHop(BgpMultiHop.FALSE) - .withHoldTime("P300s") - .withKeepAliveTime("P300s") - .withMyAsn(64512L) - .withName("peer1") - .withPeerAddress("203.0.113.254") - .withPeerAsn(64497L) - .withPeerPort(179L))) - .withFabricPeeringEnabled(FabricPeeringEnabled.TRUE) - .withIpAddressPools( - Arrays - .asList( - new IpAddressPool() - .withAddresses(Arrays.asList("198.51.102.0/24")) - .withAutoAssign(BfdEnabled.TRUE) - .withName("pool1") - .withOnlyUseHostIps(BfdEnabled.TRUE)))) - .withCloudServicesNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") - .withCniNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withDnsServiceIp("198.51.101.2") - .withPodCidrs(Arrays.asList("198.51.100.0/24")) - .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withControlPlaneNodeConfiguration(new ControlPlaneNodeConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withVmSkuName("NC_G6_28_v1")) + .withInitialAgentPoolConfigurations(Arrays.asList(new InitialAgentPoolConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withMode(AgentPoolMode.SYSTEM) + .withName("SystemPool-1") + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) + .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withVmSkuName("NC_P46_224_v1"))) + .withKubernetesVersion("1.XX.Y") + .withNetworkConfiguration(new NetworkConfiguration() + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withBgpServiceLoadBalancerConfiguration(new BgpServiceLoadBalancerConfiguration() + .withBgpAdvertisements( + Arrays.asList(new BgpAdvertisement().withAdvertiseToFabric(AdvertiseToFabric.TRUE) + .withCommunities(Arrays.asList("64512:100")) + .withIpAddressPools(Arrays.asList("pool1")) + .withPeers(Arrays.asList("peer1")))) + .withBgpPeers(Arrays.asList(new ServiceLoadBalancerBgpPeer().withBfdEnabled(BfdEnabled.FALSE) + .withBgpMultiHop(BgpMultiHop.FALSE) + .withHoldTime("P300s") + .withKeepAliveTime("P300s") + .withMyAsn(64512L) + .withName("peer1") + .withPeerAddress("203.0.113.254") + .withPeerAsn(64497L) + .withPeerPort(179L))) + .withFabricPeeringEnabled(FabricPeeringEnabled.TRUE) + .withIpAddressPools( + Arrays.asList(new IpAddressPool().withAddresses(Arrays.asList("198.51.102.0/24")) + .withAutoAssign(BfdEnabled.TRUE) + .withName("pool1") + .withOnlyUseHostIps(BfdEnabled.TRUE)))) + .withCloudServicesNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withCniNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDnsServiceIp("198.51.101.2") + .withPodCidrs(Arrays.asList("198.51.100.0/24")) + .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withAadConfiguration( new AadConfiguration().withAdminGroupObjectIds(Arrays.asList("ffffffff-ffff-ffff-ffff-ffffffffffff"))) - .withAdministratorConfiguration( - new AdministratorConfiguration() - .withAdminUsername("azure") + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_L2LoadBalancer_Create.json + */ + /** + * Sample code: Create or update Kubernetes cluster with a layer 2 load balancer. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateKubernetesClusterWithALayer2LoadBalancer( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() + .define("kubernetesClusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withControlPlaneNodeConfiguration(new ControlPlaneNodeConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withVmSkuName("NC_G6_28_v1")) + .withInitialAgentPoolConfigurations(Arrays.asList(new InitialAgentPoolConfiguration() + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withAgentOptions(new AgentOptions().withHugepagesCount(96L).withHugepagesSize(HugepagesSize.ONEG)) + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withCount(3L) + .withLabels(Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true"))) + .withMode(AgentPoolMode.SYSTEM) + .withName("SystemPool-1") + .withTaints( + Arrays.asList(new KubernetesLabel().withKey("fakeTokenPlaceholder").withValue("true:NoSchedule"))) + .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("1")) + .withVmSkuName("NC_P46_224_v1"))) + .withKubernetesVersion("1.XX.Y") + .withNetworkConfiguration(new NetworkConfiguration() + .withAttachedNetworkConfiguration(new AttachedNetworkConfiguration() + .withL2Networks(Arrays.asList(new L2NetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName") + .withPluginType(KubernetesPluginType.DPDK))) + .withL3Networks(Arrays.asList(new L3NetworkAttachmentConfiguration() + .withIpamEnabled(L3NetworkConfigurationIpamEnabled.FALSE) + .withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withPluginType(KubernetesPluginType.SRIOV))) + .withTrunkedNetworks(Arrays.asList(new TrunkedNetworkAttachmentConfiguration().withNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName") + .withPluginType(KubernetesPluginType.MACVLAN)))) + .withCloudServicesNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withCniNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDnsServiceIp("198.51.101.2") + .withL2ServiceLoadBalancerConfiguration(new L2ServiceLoadBalancerConfiguration().withIpAddressPools( + Arrays.asList(new IpAddressPool().withAddresses(Arrays.asList("198.51.102.2-198.51.102.254")) + .withAutoAssign(BfdEnabled.TRUE) + .withName("pool1")))) + .withPodCidrs(Arrays.asList("198.51.100.0/24")) + .withServiceCidrs(Arrays.asList("198.51.101.0/24"))) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAadConfiguration( + new AadConfiguration().withAdminGroupObjectIds(Arrays.asList("ffffffff-ffff-ffff-ffff-ffffffffffff"))) + .withAdministratorConfiguration(new AdministratorConfiguration().withAdminUsername("azure") + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) .withManagedResourceGroupConfiguration( new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) .create(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteSamples.java index f47db7ee74506..5d8e4898f4bbf 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for KubernetesClusters Delete. */ +/** + * Samples for KubernetesClusters Delete. + */ public final class KubernetesClustersDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Delete.json */ /** * Sample code: Delete Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() + manager.kubernetesClusters() .delete("resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersGetByResourceGroupSamples.java index c41ec7b6eeb98..e1f6230c390fd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for KubernetesClusters GetByResourceGroup. */ +/** + * Samples for KubernetesClusters GetByResourceGroup. + */ public final class KubernetesClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Get.json */ /** * Sample code: Get Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() - .getByResourceGroupWithResponse( - "resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE); + manager.kubernetesClusters() + .getByResourceGroupWithResponse("resourceGroupName", "kubernetesClusterName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListByResourceGroupSamples.java index 0b09f1484f412..f7ae5aebbbfd4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for KubernetesClusters ListByResourceGroup. */ +/** + * Samples for KubernetesClusters ListByResourceGroup. + */ public final class KubernetesClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_ListByResourceGroup.json */ /** * Sample code: List Kubernetes clusters for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listKubernetesClustersForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listKubernetesClustersForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.kubernetesClusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListSamples.java index 215dc16d202c2..a1048f7935c1e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for KubernetesClusters List. */ +/** + * Samples for KubernetesClusters List. + */ public final class KubernetesClustersListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_ListBySubscription.json */ /** * Sample code: List Kubernetes clusters for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listKubernetesClustersForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listKubernetesClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.kubernetesClusters().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeSamples.java index 1a7d5729ab356..635e63a7e6139 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeSamples.java @@ -6,23 +6,24 @@ import com.azure.resourcemanager.networkcloud.models.KubernetesClusterRestartNodeParameters; -/** Samples for KubernetesClusters RestartNode. */ +/** + * Samples for KubernetesClusters RestartNode. + */ public final class KubernetesClustersRestartNodeSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_RestartNode.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_RestartNode.json */ /** * Sample code: Restart a Kubernetes cluster node. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void restartAKubernetesClusterNode( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .kubernetesClusters() - .restartNode( - "resourceGroupName", - "kubernetesClusterName", + public static void + restartAKubernetesClusterNode(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.kubernetesClusters() + .restartNode("resourceGroupName", "kubernetesClusterName", new KubernetesClusterRestartNodeParameters().withNodeName("nodeName"), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersUpdateSamples.java index 15a182f781112..edcf489bb613b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersUpdateSamples.java @@ -4,33 +4,42 @@ package com.azure.resourcemanager.networkcloud.generated; +import com.azure.resourcemanager.networkcloud.models.AdministratorConfigurationPatch; import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; import com.azure.resourcemanager.networkcloud.models.KubernetesCluster; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for KubernetesClusters Update. */ +/** + * Samples for KubernetesClusters Update. + */ public final class KubernetesClustersUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/KubernetesClusters_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * KubernetesClusters_Patch.json */ /** * Sample code: Patch Kubernetes cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchKubernetesCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - KubernetesCluster resource = - manager - .kubernetesClusters() - .getByResourceGroupWithResponse( - "resourceGroupName", "kubernetesClusterName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + KubernetesCluster resource = manager.kubernetesClusters() + .getByResourceGroupWithResponse("resourceGroupName", "kubernetesClusterName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withControlPlaneNodeConfiguration(new ControlPlaneNodePatchConfiguration().withCount(3L)) - .withKubernetesVersion("1.24.12") + .withAdministratorConfiguration(new AdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withControlPlaneNodeConfiguration(new ControlPlaneNodePatchConfiguration() + .withAdministratorConfiguration(new AdministratorConfigurationPatch() + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withCount(3L)) + .withKubernetesVersion("1.XX.Y") .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java index 9a1c37e150608..672eb41ecbdfb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java @@ -9,27 +9,28 @@ import java.util.HashMap; import java.util.Map; -/** Samples for L2Networks CreateOrUpdate. */ +/** + * Samples for L2Networks CreateOrUpdate. + */ public final class L2NetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Create.json */ /** * Sample code: Create or update L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l2Networks() + manager.l2Networks() .define("l2NetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withL2IsolationDomainId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java index 97df7f0a4bf5e..26fe9a106f83f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L2Networks Delete. */ +/** + * Samples for L2Networks Delete. + */ public final class L2NetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Delete.json */ /** * Sample code: Delete L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java index f3512e04089d0..9746b9eff3eba 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L2Networks GetByResourceGroup. */ +/** + * Samples for L2Networks GetByResourceGroup. + */ public final class L2NetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Get.json */ /** * Sample code: Get L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l2Networks() + manager.l2Networks() .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java index 017a1b561fe12..7869ff0011cd2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L2Networks ListByResourceGroup. */ +/** + * Samples for L2Networks ListByResourceGroup. + */ public final class L2NetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_ListByResourceGroup.json */ /** * Sample code: List L2 networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL2NetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL2NetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l2Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java index ae4b1816f0325..bc850f03fb9a0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L2Networks List. */ +/** + * Samples for L2Networks List. + */ public final class L2NetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_ListBySubscription.json */ /** * Sample code: List L2 networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL2NetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL2NetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l2Networks().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java index 8458439d5afe1..f4879301e6182 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for L2Networks Update. */ +/** + * Samples for L2Networks Update. + */ public final class L2NetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L2Networks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L2Networks_Patch.json */ /** * Sample code: Patch L2 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - L2Network resource = - manager - .l2Networks() - .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) - .getValue(); + L2Network resource = manager.l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java index 409a519193c96..537dd0584eca8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java @@ -9,27 +9,28 @@ import java.util.HashMap; import java.util.Map; -/** Samples for L3Networks CreateOrUpdate. */ +/** + * Samples for L3Networks CreateOrUpdate. + */ public final class L3NetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Create.json */ /** * Sample code: Create or update L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l3Networks() + manager.l3Networks() .define("l3NetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withL3IsolationDomainId( "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") .withVlan(12L) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java index 9535834a86087..ca2dd73beab55 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L3Networks Delete. */ +/** + * Samples for L3Networks Delete. + */ public final class L3NetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Delete.json */ /** * Sample code: Delete L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java index f7aeec13cd6cc..306995ad6b8ae 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L3Networks GetByResourceGroup. */ +/** + * Samples for L3Networks GetByResourceGroup. + */ public final class L3NetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Get.json */ /** * Sample code: Get L3network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getL3network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .l3Networks() + manager.l3Networks() .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java index 0b48f86ace69d..f6793d6f8661b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L3Networks ListByResourceGroup. */ +/** + * Samples for L3Networks ListByResourceGroup. + */ public final class L3NetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_ListByResourceGroup.json */ /** * Sample code: List L3 networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL3NetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL3NetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l3Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java index 5691d390123f2..05a780e8a0f1f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for L3Networks List. */ +/** + * Samples for L3Networks List. + */ public final class L3NetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_ListBySubscription.json */ /** * Sample code: List L3 networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listL3NetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listL3NetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.l3Networks().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java index 3005f618aec30..f1b49c94405ff 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for L3Networks Update. */ +/** + * Samples for L3Networks Update. + */ public final class L3NetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/L3Networks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * L3Networks_Patch.json */ /** * Sample code: Patch L3 network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - L3Network resource = - manager - .l3Networks() - .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) - .getValue(); + L3Network resource = manager.l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java index dc8bb78529763..3bf1c499af976 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java @@ -9,28 +9,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for MetricsConfigurations CreateOrUpdate. */ +/** + * Samples for MetricsConfigurations CreateOrUpdate. + */ public final class MetricsConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Create.json */ /** * Sample code: Create or update metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateMetricsConfigurationOfCluster( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + manager.metricsConfigurations() .define("default") .withRegion("location") .withExistingCluster("resourceGroupName", "clusterName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withCollectionInterval(15L) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withEnabledMetrics(Arrays.asList("metric1", "metric2")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java index 5e0a86046b2a8..888ee98b43165 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for MetricsConfigurations Delete. */ +/** + * Samples for MetricsConfigurations Delete. + */ public final class MetricsConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Delete.json */ /** * Sample code: Delete metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void deleteMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + deleteMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .delete("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java index 07550fd200530..d89173409d3e5 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for MetricsConfigurations Get. */ +/** + * Samples for MetricsConfigurations Get. + */ public final class MetricsConfigurationsGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Get.json */ /** * Sample code: Get metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void getMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + getMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterSamples.java index 0493fef8a5b77..55e8713e66d27 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for MetricsConfigurations ListByCluster. */ +/** + * Samples for MetricsConfigurations ListByCluster. + */ public final class MetricsConfigurationsListByClusterSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_ListByCluster.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_ListByCluster.json */ /** * Sample code: List metrics configurations of the cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listMetricsConfigurationsOfTheCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .metricsConfigurations() + public static void + listMetricsConfigurationsOfTheCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.metricsConfigurations() .listByCluster("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java index b7b06125b83b6..e6b558227e7c6 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java @@ -9,25 +9,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for MetricsConfigurations Update. */ +/** + * Samples for MetricsConfigurations Update. + */ public final class MetricsConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/ClusterMetricsConfigurations_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * ClusterMetricsConfigurations_Patch.json */ /** * Sample code: Patch metrics configuration of cluster. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void patchMetricsConfigurationOfCluster( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - ClusterMetricsConfiguration resource = - manager - .metricsConfigurations() - .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + patchMetricsConfigurationOfCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterMetricsConfiguration resource = manager.metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withCollectionInterval(15L) .withEnabledMetrics(Arrays.asList("metric1", "metric2")) diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java index 625bc0b795e3b..660d13ed0806b 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Operations_List.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Operations_List.json */ /** * Sample code: List resource provider operations. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listResourceProviderOperations( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listResourceProviderOperations(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java index b24fb8ce4046d..4f37da736d331 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for RackSkus Get. */ +/** + * Samples for RackSkus Get. + */ public final class RackSkusGetSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/RackSkus_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * RackSkus_Get.json */ /** * Sample code: Get rack SKU resource. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getRackSKUResource(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java index 247bb8050faed..e44483754dd88 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for RackSkus List. */ +/** + * Samples for RackSkus List. + */ public final class RackSkusListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/RackSkus_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * RackSkus_ListBySubscription.json */ /** * Sample code: List rack SKUs for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRackSKUsForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java index 37a649ecf8221..80561b90db357 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java @@ -8,31 +8,33 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Racks CreateOrUpdate. */ +/** + * Samples for Racks CreateOrUpdate. + */ public final class RacksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Create.json */ /** * Sample code: Create or update rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .racks() + manager.racks() .define("rackName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAvailabilityZone("1") .withRackLocation("Rack 28") .withRackSerialNumber("RACK_SERIAL_NUMBER") - .withRackSkuId("RACK-TYPE-1") + .withRackSkuId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java index 60adb7422d776..25b731b462012 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Racks Delete. */ +/** + * Samples for Racks Delete. + */ public final class RacksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Delete.json */ /** * Sample code: Delete rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java index d1dfd59875c3b..d1da4816a0557 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Racks GetByResourceGroup. */ +/** + * Samples for Racks GetByResourceGroup. + */ public final class RacksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/Racks_Get. + * json */ /** * Sample code: Get rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .racks() + manager.racks() .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java index c4da2db731eff..5c9d64d23e88f 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Racks ListByResourceGroup. */ +/** + * Samples for Racks ListByResourceGroup. + */ public final class RacksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_ListByResourceGroup.json */ /** * Sample code: List racks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRacksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java index 19eba23c15c88..0caee07921aec 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Racks List. */ +/** + * Samples for Racks List. + */ public final class RacksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_ListBySubscription.json */ /** * Sample code: List racks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listRacksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java index f845ca2d7a86d..e525022025de9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java @@ -8,24 +8,25 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Racks Update. */ +/** + * Samples for Racks Update. + */ public final class RacksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Racks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Racks_Patch.json */ /** * Sample code: Patch rack. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Rack resource = - manager - .racks() - .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Rack resource = manager.racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withRackLocation("Rack 2B") .withRackSerialNumber("RACK_SERIAL_NUMBER") diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java index b80eaaacc0568..4e58f4d7ae135 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java @@ -9,28 +9,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for StorageAppliances CreateOrUpdate. */ +/** + * Samples for StorageAppliances CreateOrUpdate. + */ public final class StorageAppliancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Create.json */ /** * Sample code: Create or update storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateStorageAppliance( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() + public static void + createOrUpdateStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances() .define("storageApplianceName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAdministratorCredentials( new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("adminUser")) .withRackId( diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java index 4dec1140ad121..09bf00058bfdc 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for StorageAppliances Delete. */ +/** + * Samples for StorageAppliances Delete. + */ public final class StorageAppliancesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Delete.json */ /** * Sample code: Delete storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() + manager.storageAppliances() .delete("resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java index a3f3c3b9b118a..2a13a245660ae 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for StorageAppliances DisableRemoteVendorManagement. */ +/** + * Samples for StorageAppliances DisableRemoteVendorManagement. + */ public final class StorageAppliancesDisableRemoteVendorManagementSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_DisableRemoteVendorManagement.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_DisableRemoteVendorManagement.json */ /** * Sample code: Turn off remote vendor management for storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void turnOffRemoteVendorManagementForStorageAppliance( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .disableRemoteVendorManagement( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + manager.storageAppliances() + .disableRemoteVendorManagement("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java index 84c9000093e34..f8372607d32c2 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java @@ -7,23 +7,24 @@ import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; import java.util.Arrays; -/** Samples for StorageAppliances EnableRemoteVendorManagement. */ +/** + * Samples for StorageAppliances EnableRemoteVendorManagement. + */ public final class StorageAppliancesEnableRemoteVendorManagementSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_EnableRemoteVendorManagement.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_EnableRemoteVendorManagement.json */ /** * Sample code: Turn on remote vendor management for storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void turnOnRemoteVendorManagementForStorageAppliance( com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .enableRemoteVendorManagement( - "resourceGroupName", - "storageApplianceName", + manager.storageAppliances() + .enableRemoteVendorManagement("resourceGroupName", "storageApplianceName", new StorageApplianceEnableRemoteVendorManagementParameters() .withSupportEndpoints(Arrays.asList("10.0.0.0/24")), com.azure.core.util.Context.NONE); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java index 46755b2ce7872..f2eebd86e9017 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for StorageAppliances GetByResourceGroup. */ +/** + * Samples for StorageAppliances GetByResourceGroup. + */ public final class StorageAppliancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Get.json */ /** * Sample code: Get storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .storageAppliances() - .getByResourceGroupWithResponse( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + manager.storageAppliances() + .getByResourceGroupWithResponse("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java index fd1d44ba8c106..c271ded34fb68 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for StorageAppliances ListByResourceGroup. */ +/** + * Samples for StorageAppliances ListByResourceGroup. + */ public final class StorageAppliancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_ListByResourceGroup.json */ /** * Sample code: List storage appliances for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listStorageAppliancesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listStorageAppliancesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.storageAppliances().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java index c89c90ad78e59..4cb830d769773 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for StorageAppliances List. */ +/** + * Samples for StorageAppliances List. + */ public final class StorageAppliancesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_ListBySubscription.json */ /** * Sample code: List storage appliances for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listStorageAppliancesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listStorageAppliancesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.storageAppliances().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java index c3cafdabfe59d..e8bc73b0d9dae 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java @@ -8,25 +8,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for StorageAppliances Update. */ +/** + * Samples for StorageAppliances Update. + */ public final class StorageAppliancesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/StorageAppliances_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * StorageAppliances_Patch.json */ /** * Sample code: Patch storage appliance. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - StorageAppliance resource = - manager - .storageAppliances() - .getByResourceGroupWithResponse( - "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + StorageAppliance resource = manager.storageAppliances() + .getByResourceGroupWithResponse("resourceGroupName", "storageApplianceName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withSerialNumber("BM1219XXX") .apply(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java index 719ac0082a134..8ad98143d7903 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java @@ -9,33 +9,32 @@ import java.util.HashMap; import java.util.Map; -/** Samples for TrunkedNetworks CreateOrUpdate. */ +/** + * Samples for TrunkedNetworks CreateOrUpdate. + */ public final class TrunkedNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Create.json */ /** * Sample code: Create or update trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateTrunkedNetwork( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .trunkedNetworks() + public static void + createOrUpdateTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks() .define("trunkedNetworkName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) - .withIsolationDomainIds( - Arrays - .asList( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withIsolationDomainIds(Arrays.asList( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) .withVlans(Arrays.asList(12L, 14L)) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withInterfaceName("eth0") diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java index af70af13e0299..b6bdd316cd25e 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for TrunkedNetworks Delete. */ +/** + * Samples for TrunkedNetworks Delete. + */ public final class TrunkedNetworksDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Delete.json */ /** * Sample code: Delete trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java index 2d85d220c112a..4c0419a2674b4 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for TrunkedNetworks GetByResourceGroup. */ +/** + * Samples for TrunkedNetworks GetByResourceGroup. + */ public final class TrunkedNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Get.json */ /** * Sample code: Get Trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .trunkedNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + manager.trunkedNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "trunkedNetworkName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java index 42d5a5b9d58a0..6e2628478484a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for TrunkedNetworks ListByResourceGroup. */ +/** + * Samples for TrunkedNetworks ListByResourceGroup. + */ public final class TrunkedNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_ListByResourceGroup.json */ /** * Sample code: List Trunked networks for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listTrunkedNetworksForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listTrunkedNetworksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.trunkedNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java index d33e5297a63c9..571df240b20e0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for TrunkedNetworks List. */ +/** + * Samples for TrunkedNetworks List. + */ public final class TrunkedNetworksListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_ListBySubscription.json */ /** * Sample code: List trunked networks for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listTrunkedNetworksForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listTrunkedNetworksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.trunkedNetworks().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java index 2e5e6fe295692..987bd7679c6dd 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java @@ -8,23 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for TrunkedNetworks Update. */ +/** + * Samples for TrunkedNetworks Update. + */ public final class TrunkedNetworksUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/TrunkedNetworks_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * TrunkedNetworks_Patch.json */ /** * Sample code: Patch trunked network. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - TrunkedNetwork resource = - manager - .trunkedNetworks() - .getByResourceGroupWithResponse( - "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) - .getValue(); + TrunkedNetwork resource = manager.trunkedNetworks() + .getByResourceGroupWithResponse("resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java index a0a607cefe8a3..eedb1f71a6cee 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -24,79 +24,64 @@ import java.util.HashMap; import java.util.Map; -/** Samples for VirtualMachines CreateOrUpdate. */ +/** + * Samples for VirtualMachines CreateOrUpdate. + */ public final class VirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Create.json */ /** * Sample code: Create or update virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void createOrUpdateVirtualMachine( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() + public static void + createOrUpdateVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines() .define("virtualMachineName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withAdminUsername("username") - .withCloudServicesNetworkAttachment( - new NetworkAttachment() - .withAttachedNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") - .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) + .withCloudServicesNetworkAttachment(new NetworkAttachment().withAttachedNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) .withCpuCores(2L) .withMemorySizeGB(8L) - .withStorageProfile( - new StorageProfile() - .withOsDisk( - new OsDisk() - .withCreateOption(OsDiskCreateOption.EPHEMERAL) - .withDeleteOption(OsDiskDeleteOption.DELETE) - .withDiskSizeGB(120L)) - .withVolumeAttachments( - Arrays - .asList( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) + .withStorageProfile(new StorageProfile() + .withOsDisk(new OsDisk().withCreateOption(OsDiskCreateOption.EPHEMERAL) + .withDeleteOption(OsDiskDeleteOption.DELETE) + .withDiskSizeGB(120L)) + .withVolumeAttachments(Arrays.asList( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) .withVmImage("myacr.azurecr.io/foobar:latest") .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .withBootMethod(VirtualMachineBootMethod.UEFI) - .withNetworkAttachments( - Arrays - .asList( - new NetworkAttachment() - .withAttachedNetworkId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") - .withDefaultGateway(DefaultGateway.TRUE) - .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) - .withIpv4Address("198.51.100.1") - .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") - .withNetworkAttachmentName("netAttachName01"))) + .withNetworkAttachments(Arrays.asList(new NetworkAttachment().withAttachedNetworkId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDefaultGateway(DefaultGateway.TRUE) + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) + .withIpv4Address("198.51.100.1") + .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") + .withNetworkAttachmentName("netAttachName01"))) .withNetworkData("bmV0d29ya0RhdGVTYW1wbGU=") - .withPlacementHints( - Arrays - .asList( - new VirtualMachinePlacementHint() - .withHintType(VirtualMachinePlacementHintType.AFFINITY) - .withResourceId( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") - .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) - .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) + .withPlacementHints(Arrays.asList(new VirtualMachinePlacementHint() + .withHintType(VirtualMachinePlacementHintType.AFFINITY) + .withResourceId( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) + .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))) .withUserData("dXNlckRhdGVTYW1wbGU=") .withVmDeviceModel(VirtualMachineDeviceModelType.T2) - .withVmImageRepositoryCredentials( - new ImageRepositoryCredentials() - .withPassword("fakeTokenPlaceholder") - .withRegistryUrl("myacr.azurecr.io") - .withUsername("myuser")) + .withVmImageRepositoryCredentials(new ImageRepositoryCredentials().withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) .create(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java index f4ed4e8f15b22..3e53c43a162de 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines Delete. */ +/** + * Samples for VirtualMachines Delete. + */ public final class VirtualMachinesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Delete.json */ /** * Sample code: Delete virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java index 610083c2587ba..25783c08311e9 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines GetByResourceGroup. */ +/** + * Samples for VirtualMachines GetByResourceGroup. + */ public final class VirtualMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Get.json */ /** * Sample code: Get virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + manager.virtualMachines() + .getByResourceGroupWithResponse("resourceGroupName", "virtualMachineName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java index 96d9a93e46e01..37228f642f773 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines ListByResourceGroup. */ +/** + * Samples for VirtualMachines ListByResourceGroup. + */ public final class VirtualMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_ListByResourceGroup.json */ /** * Sample code: List virtual machines for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listVirtualMachinesForResourceGroup( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listVirtualMachinesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.virtualMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java index 8047a06b27698..0320ab5736b4d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines List. */ +/** + * Samples for VirtualMachines List. + */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_ListBySubscription.json */ /** * Sample code: List virtual machines for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ - public static void listVirtualMachinesForSubscription( - com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + public static void + listVirtualMachinesForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { manager.virtualMachines().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java index dc64fbc2d7224..134caab234df8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java @@ -7,22 +7,23 @@ import com.azure.resourcemanager.networkcloud.models.SkipShutdown; import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; -/** Samples for VirtualMachines PowerOff. */ +/** + * Samples for VirtualMachines PowerOff. + */ public final class VirtualMachinesPowerOffSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_PowerOff.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_PowerOff.json */ /** * Sample code: Power off virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void powerOffVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .virtualMachines() - .powerOff( - "resourceGroupName", - "virtualMachineName", + manager.virtualMachines() + .powerOff("resourceGroupName", "virtualMachineName", new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE), com.azure.core.util.Context.NONE); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java index 79564d739d63f..484bbcc7e513d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines Reimage. */ +/** + * Samples for VirtualMachines Reimage. + */ public final class VirtualMachinesReimageSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Reimage.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Reimage.json */ /** * Sample code: Reimage virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void reimageVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java index e4274724e8244..4559f868be6d8 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines Restart. */ +/** + * Samples for VirtualMachines Restart. + */ public final class VirtualMachinesRestartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Restart.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Restart.json */ /** * Sample code: Restart virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void restartVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java index 0fecdcf434269..86e5d0df26efb 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for VirtualMachines Start. */ +/** + * Samples for VirtualMachines Start. + */ public final class VirtualMachinesStartSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Start.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Start.json */ /** * Sample code: Start virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void startVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java index 19a4a8a4ed68f..f6584c995a49a 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java @@ -9,31 +9,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for VirtualMachines Update. */ +/** + * Samples for VirtualMachines Update. + */ public final class VirtualMachinesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/VirtualMachines_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * VirtualMachines_Patch.json */ /** * Sample code: Patch virtual machine. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - VirtualMachine resource = - manager - .virtualMachines() - .getByResourceGroupWithResponse( - "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + VirtualMachine resource = manager.virtualMachines() + .getByResourceGroupWithResponse("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withVmImageRepositoryCredentials( - new ImageRepositoryCredentials() - .withPassword("fakeTokenPlaceholder") - .withRegistryUrl("myacr.azurecr.io") - .withUsername("myuser")) + .withVmImageRepositoryCredentials(new ImageRepositoryCredentials().withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) .apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java index 052f80369d754..cc5183d7d420c 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java @@ -8,27 +8,28 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Volumes CreateOrUpdate. */ +/** + * Samples for Volumes CreateOrUpdate. + */ public final class VolumesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Create.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Create.json */ /** * Sample code: Create or update volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void createOrUpdateVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .volumes() + manager.volumes() .define("volumeName") .withRegion("location") .withExistingResourceGroup("resourceGroupName") - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") - .withType("CustomLocation")) + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) .withSizeMiB(10000L) .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java index 4f877c229a1cd..b96d8936eecc0 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Volumes Delete. */ +/** + * Samples for Volumes Delete. + */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Delete.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Delete.json */ /** * Sample code: Delete volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void deleteVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java index 8fc8f14d9a82f..83eb9f1febd18 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Volumes GetByResourceGroup. */ +/** + * Samples for Volumes GetByResourceGroup. + */ public final class VolumesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Get.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Get.json */ /** * Sample code: Get volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void getVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - manager - .volumes() + manager.volumes() .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java index b284058d69870..30c1f6fb0eefa 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Volumes ListByResourceGroup. */ +/** + * Samples for Volumes ListByResourceGroup. + */ public final class VolumesListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_ListByResourceGroup.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_ListByResourceGroup.json */ /** * Sample code: List volumes for resource group. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listVolumesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java index bd1ba332a9344..5d731efca7fb1 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.networkcloud.generated; -/** Samples for Volumes List. */ +/** + * Samples for Volumes List. + */ public final class VolumesListSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_ListBySubscription.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_ListBySubscription.json */ /** * Sample code: List volume for subscription. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void listVolumeForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java index 65819f9771dc6..8f3b07eadff55 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java @@ -8,22 +8,24 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Volumes Update. */ +/** + * Samples for Volumes Update. + */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/stable/2023-07-01/examples/Volumes_Patch.json + * x-ms-original-file: + * specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2024-10-01-preview/examples/ + * Volumes_Patch.json */ /** * Sample code: Patch volume. - * + * * @param manager Entry point to NetworkCloudManager. */ public static void patchVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { - Volume resource = - manager - .volumes() - .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) - .getValue(); + Volume resource = manager.volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AadConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AadConfigurationTests.java deleted file mode 100644 index 5d111e56c4e42..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AadConfigurationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AadConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AadConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadConfiguration model = BinaryData.fromString("{\"adminGroupObjectIds\":[\"ibtnmxiebwwaloay\",\"cgwrtzjuz\"]}") - .toObject(AadConfiguration.class); - Assertions.assertEquals("ibtnmxiebwwaloay", model.adminGroupObjectIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadConfiguration model - = new AadConfiguration().withAdminGroupObjectIds(Arrays.asList("ibtnmxiebwwaloay", "cgwrtzjuz")); - model = BinaryData.fromObject(model).toObject(AadConfiguration.class); - Assertions.assertEquals("ibtnmxiebwwaloay", model.adminGroupObjectIds().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentOptionsTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentOptionsTests.java deleted file mode 100644 index 57c80f2fbe609..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentOptionsTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AgentOptions; -import com.azure.resourcemanager.networkcloud.models.HugepagesSize; -import org.junit.jupiter.api.Assertions; - -public final class AgentOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentOptions model = BinaryData.fromString("{\"hugepagesCount\":4925727369956565818,\"hugepagesSize\":\"2M\"}") - .toObject(AgentOptions.class); - Assertions.assertEquals(4925727369956565818L, model.hugepagesCount()); - Assertions.assertEquals(HugepagesSize.TWOM, model.hugepagesSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentOptions model - = new AgentOptions().withHugepagesCount(4925727369956565818L).withHugepagesSize(HugepagesSize.TWOM); - model = BinaryData.fromObject(model).toObject(AgentOptions.class); - Assertions.assertEquals(4925727369956565818L, model.hugepagesCount()); - Assertions.assertEquals(HugepagesSize.TWOM, model.hugepagesSize()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchParametersTests.java deleted file mode 100644 index 434dd32ac1b67..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchParametersTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AgentPoolPatchParameters; -import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AgentPoolPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentPoolPatchParameters model = BinaryData.fromString( - "{\"properties\":{\"count\":1064127963046156604,\"upgradeSettings\":{\"maxSurge\":\"fsv\"}},\"tags\":{\"gahxkumasjcaa\":\"vbopfppdbwnu\",\"ehqepvufhbzehe\":\"fdmmcpug\"}}") - .toObject(AgentPoolPatchParameters.class); - Assertions.assertEquals("vbopfppdbwnu", model.tags().get("gahxkumasjcaa")); - Assertions.assertEquals(1064127963046156604L, model.count()); - Assertions.assertEquals("fsv", model.upgradeSettings().maxSurge()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentPoolPatchParameters model = new AgentPoolPatchParameters() - .withTags(mapOf("gahxkumasjcaa", "vbopfppdbwnu", "ehqepvufhbzehe", "fdmmcpug")) - .withCount(1064127963046156604L) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("fsv")); - model = BinaryData.fromObject(model).toObject(AgentPoolPatchParameters.class); - Assertions.assertEquals("vbopfppdbwnu", model.tags().get("gahxkumasjcaa")); - Assertions.assertEquals(1064127963046156604L, model.count()); - Assertions.assertEquals("fsv", model.upgradeSettings().maxSurge()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchPropertiesTests.java deleted file mode 100644 index 150f94af98da5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolPatchPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.AgentPoolPatchProperties; -import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; -import org.junit.jupiter.api.Assertions; - -public final class AgentPoolPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentPoolPatchProperties model = BinaryData - .fromString("{\"count\":6504667056723146925,\"upgradeSettings\":{\"maxSurge\":\"lbqnbldxeacl\"}}") - .toObject(AgentPoolPatchProperties.class); - Assertions.assertEquals(6504667056723146925L, model.count()); - Assertions.assertEquals("lbqnbldxeacl", model.upgradeSettings().maxSurge()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentPoolPatchProperties model = new AgentPoolPatchProperties().withCount(6504667056723146925L) - .withUpgradeSettings(new AgentPoolUpgradeSettings().withMaxSurge("lbqnbldxeacl")); - model = BinaryData.fromObject(model).toObject(AgentPoolPatchProperties.class); - Assertions.assertEquals(6504667056723146925L, model.count()); - Assertions.assertEquals("lbqnbldxeacl", model.upgradeSettings().maxSurge()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolUpgradeSettingsTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolUpgradeSettingsTests.java deleted file mode 100644 index 986eacdad416a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolUpgradeSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AgentPoolUpgradeSettings; -import org.junit.jupiter.api.Assertions; - -public final class AgentPoolUpgradeSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentPoolUpgradeSettings model - = BinaryData.fromString("{\"maxSurge\":\"gvpgy\"}").toObject(AgentPoolUpgradeSettings.class); - Assertions.assertEquals("gvpgy", model.maxSurge()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentPoolUpgradeSettings model = new AgentPoolUpgradeSettings().withMaxSurge("gvpgy"); - model = BinaryData.fromObject(model).toObject(AgentPoolUpgradeSettings.class); - Assertions.assertEquals("gvpgy", model.maxSurge()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteMockTests.java deleted file mode 100644 index 0f25848857cc8..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AgentPoolsDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 AgentPoolsDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.agentPools().delete("fixoskk", "dfivsujybsr", "zzmrgtxdhmfpp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AttachedNetworkConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AttachedNetworkConfigurationTests.java deleted file mode 100644 index e3411ec5165a6..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AttachedNetworkConfigurationTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AttachedNetworkConfiguration; -import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; -import com.azure.resourcemanager.networkcloud.models.L2NetworkAttachmentConfiguration; -import com.azure.resourcemanager.networkcloud.models.L3NetworkAttachmentConfiguration; -import com.azure.resourcemanager.networkcloud.models.L3NetworkConfigurationIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkAttachmentConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AttachedNetworkConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedNetworkConfiguration model = BinaryData.fromString( - "{\"l2Networks\":[{\"networkId\":\"i\",\"pluginType\":\"SRIOV\"},{\"networkId\":\"lpjzuaejxdu\",\"pluginType\":\"IPVLAN\"},{\"networkId\":\"kzbbtd\",\"pluginType\":\"IPVLAN\"},{\"networkId\":\"veekgpwozuhkfp\",\"pluginType\":\"DPDK\"}],\"l3Networks\":[{\"ipamEnabled\":\"True\",\"networkId\":\"xl\",\"pluginType\":\"IPVLAN\"}],\"trunkedNetworks\":[{\"networkId\":\"touwaboekqv\",\"pluginType\":\"MACVLAN\"},{\"networkId\":\"nsmvbxwyj\",\"pluginType\":\"MACVLAN\"},{\"networkId\":\"hhcaal\",\"pluginType\":\"SRIOV\"},{\"networkId\":\"xisxyawjoyaqcsl\",\"pluginType\":\"MACVLAN\"}]}") - .toObject(AttachedNetworkConfiguration.class); - Assertions.assertEquals("i", model.l2Networks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.SRIOV, model.l2Networks().get(0).pluginType()); - Assertions.assertEquals(L3NetworkConfigurationIpamEnabled.TRUE, model.l3Networks().get(0).ipamEnabled()); - Assertions.assertEquals("xl", model.l3Networks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.IPVLAN, model.l3Networks().get(0).pluginType()); - Assertions.assertEquals("touwaboekqv", model.trunkedNetworks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.MACVLAN, model.trunkedNetworks().get(0).pluginType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedNetworkConfiguration model = new AttachedNetworkConfiguration().withL2Networks(Arrays.asList( - new L2NetworkAttachmentConfiguration().withNetworkId("i").withPluginType(KubernetesPluginType.SRIOV), - new L2NetworkAttachmentConfiguration().withNetworkId("lpjzuaejxdu") - .withPluginType(KubernetesPluginType.IPVLAN), - new L2NetworkAttachmentConfiguration().withNetworkId("kzbbtd").withPluginType(KubernetesPluginType.IPVLAN), - new L2NetworkAttachmentConfiguration().withNetworkId("veekgpwozuhkfp") - .withPluginType(KubernetesPluginType.DPDK))) - .withL3Networks(Arrays - .asList(new L3NetworkAttachmentConfiguration().withIpamEnabled(L3NetworkConfigurationIpamEnabled.TRUE) - .withNetworkId("xl") - .withPluginType(KubernetesPluginType.IPVLAN))) - .withTrunkedNetworks(Arrays.asList( - new TrunkedNetworkAttachmentConfiguration().withNetworkId("touwaboekqv") - .withPluginType(KubernetesPluginType.MACVLAN), - new TrunkedNetworkAttachmentConfiguration().withNetworkId("nsmvbxwyj") - .withPluginType(KubernetesPluginType.MACVLAN), - new TrunkedNetworkAttachmentConfiguration().withNetworkId("hhcaal") - .withPluginType(KubernetesPluginType.SRIOV), - new TrunkedNetworkAttachmentConfiguration().withNetworkId("xisxyawjoyaqcsl") - .withPluginType(KubernetesPluginType.MACVLAN))); - model = BinaryData.fromObject(model).toObject(AttachedNetworkConfiguration.class); - Assertions.assertEquals("i", model.l2Networks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.SRIOV, model.l2Networks().get(0).pluginType()); - Assertions.assertEquals(L3NetworkConfigurationIpamEnabled.TRUE, model.l3Networks().get(0).ipamEnabled()); - Assertions.assertEquals("xl", model.l3Networks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.IPVLAN, model.l3Networks().get(0).pluginType()); - Assertions.assertEquals("touwaboekqv", model.trunkedNetworks().get(0).networkId()); - Assertions.assertEquals(KubernetesPluginType.MACVLAN, model.trunkedNetworks().get(0).pluginType()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AvailableUpgradeTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AvailableUpgradeTests.java deleted file mode 100644 index 9b6aaf3e34d68..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/AvailableUpgradeTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AvailableUpgrade; - -public final class AvailableUpgradeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableUpgrade model - = BinaryData.fromString("{\"availabilityLifecycle\":\"GenerallyAvailable\",\"version\":\"iuhprwmdyvxqta\"}") - .toObject(AvailableUpgrade.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableUpgrade model = new AvailableUpgrade(); - model = BinaryData.fromObject(model).toObject(AvailableUpgrade.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCommandSpecificationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCommandSpecificationTests.java deleted file mode 100644 index 2950809a2d29b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCommandSpecificationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachineCommandSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachineCommandSpecification model - = BinaryData.fromString("{\"arguments\":[\"z\"],\"command\":\"umwmxqhnd\"}") - .toObject(BareMetalMachineCommandSpecification.class); - Assertions.assertEquals("z", model.arguments().get(0)); - Assertions.assertEquals("umwmxqhnd", model.command()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachineCommandSpecification model - = new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("z")).withCommand("umwmxqhnd"); - model = BinaryData.fromObject(model).toObject(BareMetalMachineCommandSpecification.class); - Assertions.assertEquals("z", model.arguments().get(0)); - Assertions.assertEquals("umwmxqhnd", model.command()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCordonParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCordonParametersTests.java deleted file mode 100644 index 27ba79d969ee1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineCordonParametersTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachineCordonParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachineCordonParameters model - = BinaryData.fromString("{\"evacuate\":\"False\"}").toObject(BareMetalMachineCordonParameters.class); - Assertions.assertEquals(BareMetalMachineEvacuate.FALSE, model.evacuate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachineCordonParameters model - = new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.FALSE); - model = BinaryData.fromObject(model).toObject(BareMetalMachineCordonParameters.class); - Assertions.assertEquals(BareMetalMachineEvacuate.FALSE, model.evacuate()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteMockTests.java deleted file mode 100644 index 47f1c0452ac1a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 BareMetalMachineKeySetsDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.bareMetalMachineKeySets() - .delete("wjezbfqployuekdc", "vuftrsvjmnsvu", "njktv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchParametersTests.java deleted file mode 100644 index ba5a1bec7c883..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchParametersTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachinePatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachinePatchParameters model = BinaryData.fromString( - "{\"properties\":{\"machineDetails\":\"ieholewjwi\"},\"tags\":{\"wexjkmfxapjwogq\":\"wefqsfapaqtferr\",\"awbzasqb\":\"nobpudcdabtqwpw\",\"kyexaoguyaipi\":\"clj\",\"um\":\"sdaultxij\"}}") - .toObject(BareMetalMachinePatchParameters.class); - Assertions.assertEquals("wefqsfapaqtferr", model.tags().get("wexjkmfxapjwogq")); - Assertions.assertEquals("ieholewjwi", model.machineDetails()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachinePatchParameters model = new BareMetalMachinePatchParameters() - .withTags(mapOf("wexjkmfxapjwogq", "wefqsfapaqtferr", "awbzasqb", "nobpudcdabtqwpw", "kyexaoguyaipi", "clj", - "um", "sdaultxij")) - .withMachineDetails("ieholewjwi"); - model = BinaryData.fromObject(model).toObject(BareMetalMachinePatchParameters.class); - Assertions.assertEquals("wefqsfapaqtferr", model.tags().get("wexjkmfxapjwogq")); - Assertions.assertEquals("ieholewjwi", model.machineDetails()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchPropertiesTests.java deleted file mode 100644 index 4b2a56cab33d3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePatchPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachinePatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachinePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachinePatchProperties model - = BinaryData.fromString("{\"machineDetails\":\"waz\"}").toObject(BareMetalMachinePatchProperties.class); - Assertions.assertEquals("waz", model.machineDetails()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachinePatchProperties model = new BareMetalMachinePatchProperties().withMachineDetails("waz"); - model = BinaryData.fromObject(model).toObject(BareMetalMachinePatchProperties.class); - Assertions.assertEquals("waz", model.machineDetails()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePowerOffParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePowerOffParametersTests.java deleted file mode 100644 index bc14aaa3aa7a7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinePowerOffParametersTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachinePowerOffParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachinePowerOffParameters model - = BinaryData.fromString("{\"skipShutdown\":\"True\"}").toObject(BareMetalMachinePowerOffParameters.class); - Assertions.assertEquals(BareMetalMachineSkipShutdown.TRUE, model.skipShutdown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachinePowerOffParameters model - = new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.TRUE); - model = BinaryData.fromObject(model).toObject(BareMetalMachinePowerOffParameters.class); - Assertions.assertEquals(BareMetalMachineSkipShutdown.TRUE, model.skipShutdown()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunCommandParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunCommandParametersTests.java deleted file mode 100644 index e768133edfe35..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunCommandParametersTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachineRunCommandParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachineRunCommandParameters model = BinaryData.fromString( - "{\"arguments\":[\"nghgshej\",\"tbxqmuluxlxq\",\"vnersbycucrw\",\"amikzebrqbsm\"],\"limitTimeSeconds\":4275672432001300092,\"script\":\"iqg\"}") - .toObject(BareMetalMachineRunCommandParameters.class); - Assertions.assertEquals("nghgshej", model.arguments().get(0)); - Assertions.assertEquals(4275672432001300092L, model.limitTimeSeconds()); - Assertions.assertEquals("iqg", model.script()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachineRunCommandParameters model = new BareMetalMachineRunCommandParameters() - .withArguments(Arrays.asList("nghgshej", "tbxqmuluxlxq", "vnersbycucrw", "amikzebrqbsm")) - .withLimitTimeSeconds(4275672432001300092L) - .withScript("iqg"); - model = BinaryData.fromObject(model).toObject(BareMetalMachineRunCommandParameters.class); - Assertions.assertEquals("nghgshej", model.arguments().get(0)); - Assertions.assertEquals(4275672432001300092L, model.limitTimeSeconds()); - Assertions.assertEquals("iqg", model.script()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunDataExtractsParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunDataExtractsParametersTests.java deleted file mode 100644 index 228b7abd07eef..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunDataExtractsParametersTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachineRunDataExtractsParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachineRunDataExtractsParameters model = BinaryData.fromString( - "{\"commands\":[{\"arguments\":[\"kzruswh\",\"hczznvf\"],\"command\":\"ycjsx\"}],\"limitTimeSeconds\":653571144085928241}") - .toObject(BareMetalMachineRunDataExtractsParameters.class); - Assertions.assertEquals("kzruswh", model.commands().get(0).arguments().get(0)); - Assertions.assertEquals("ycjsx", model.commands().get(0).command()); - Assertions.assertEquals(653571144085928241L, model.limitTimeSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachineRunDataExtractsParameters model = new BareMetalMachineRunDataExtractsParameters().withCommands( - Arrays.asList(new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("kzruswh", "hczznvf")) - .withCommand("ycjsx"))) - .withLimitTimeSeconds(653571144085928241L); - model = BinaryData.fromObject(model).toObject(BareMetalMachineRunDataExtractsParameters.class); - Assertions.assertEquals("kzruswh", model.commands().get(0).arguments().get(0)); - Assertions.assertEquals("ycjsx", model.commands().get(0).command()); - Assertions.assertEquals(653571144085928241L, model.limitTimeSeconds()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunReadCommandsParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunReadCommandsParametersTests.java deleted file mode 100644 index 73acf826291af..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineRunReadCommandsParametersTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BareMetalMachineRunReadCommandsParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BareMetalMachineRunReadCommandsParameters model = BinaryData.fromString( - "{\"commands\":[{\"arguments\":[\"mldsehaohdj\",\"hflzokxco\"],\"command\":\"pelnjetag\"},{\"arguments\":[\"xo\"],\"command\":\"tft\"},{\"arguments\":[\"npbs\",\"vefloccsrmozihmi\",\"g\",\"wtxxpkyjcx\"],\"command\":\"jxgrytfmp\"},{\"arguments\":[\"ilrmcaykggnox\"],\"command\":\"ztrksxwpndf\"}],\"limitTimeSeconds\":4011710098447438719}") - .toObject(BareMetalMachineRunReadCommandsParameters.class); - Assertions.assertEquals("mldsehaohdj", model.commands().get(0).arguments().get(0)); - Assertions.assertEquals("pelnjetag", model.commands().get(0).command()); - Assertions.assertEquals(4011710098447438719L, model.limitTimeSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BareMetalMachineRunReadCommandsParameters model - = new BareMetalMachineRunReadCommandsParameters().withCommands(Arrays.asList( - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("mldsehaohdj", "hflzokxco")) - .withCommand("pelnjetag"), - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("xo")).withCommand("tft"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("npbs", "vefloccsrmozihmi", "g", "wtxxpkyjcx")) - .withCommand("jxgrytfmp"), - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("ilrmcaykggnox")) - .withCommand("ztrksxwpndf"))) - .withLimitTimeSeconds(4011710098447438719L); - model = BinaryData.fromObject(model).toObject(BareMetalMachineRunReadCommandsParameters.class); - Assertions.assertEquals("mldsehaohdj", model.commands().get(0).arguments().get(0)); - Assertions.assertEquals("pelnjetag", model.commands().get(0).command()); - Assertions.assertEquals(4011710098447438719L, model.limitTimeSeconds()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonMockTests.java deleted file mode 100644 index a326189e80eac..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesCordonMockTests { - @Test - public void testCordon() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"hpwpgddeimawzovg\",\"resourceId\":\"um\",\"name\":\"kjcjcaztbwsnsqow\",\"status\":\"wcoml\",\"percentComplete\":86.88219,\"startTime\":\"2021-01-28T06:56:23Z\",\"endTime\":\"2020-12-24T11:01:09Z\",\"operations\":[{\"id\":\"wka\",\"resourceId\":\"ejyfdvlvhbwrnfx\",\"name\":\"ddpqt\",\"status\":\"ehnmnaoyankco\",\"percentComplete\":66.584496,\"startTime\":\"2021-11-11T14:26:20Z\",\"endTime\":\"2020-12-21T02:54:41Z\",\"operations\":[{\"id\":\"tmhdroznnhdr\",\"resourceId\":\"tgjcsgguxheml\",\"name\":\"waeeczgfb\",\"status\":\"kklelssxblycs\",\"percentComplete\":97.138306,\"startTime\":\"2021-09-07T10:55:25Z\",\"endTime\":\"2021-05-07T05:55:26Z\",\"operations\":[{\"status\":\"mdesqp\"},{\"status\":\"pvmjcdoewbid\"},{\"status\":\"vteo\"},{\"status\":\"xvgpiude\"}]}]},{\"id\":\"xzecpaxwkufykhvu\",\"resourceId\":\"epmrut\",\"name\":\"abaobnslujdjltym\",\"status\":\"mvguihywart\",\"percentComplete\":92.43603,\"startTime\":\"2021-12-07T20:59:05Z\",\"endTime\":\"2021-09-30T07:37:28Z\",\"operations\":[{\"id\":\"xdssjpemmucfxhi\",\"resourceId\":\"flrmymyi\",\"name\":\"qlhris\",\"status\":\"sl\",\"percentComplete\":62.140095,\"startTime\":\"2021-11-23T09:33:48Z\",\"endTime\":\"2021-02-14T14:33:49Z\",\"operations\":[{\"status\":\"gxuugqkctotio\"},{\"status\":\"l\"},{\"status\":\"teqdptj\"},{\"status\":\"wdtgukranblw\"}]},{\"id\":\"lkccuzgygqwa\",\"resourceId\":\"iul\",\"name\":\"niiprglvaw\",\"status\":\"wzdufypivlsbb\",\"percentComplete\":23.44007,\"startTime\":\"2021-03-15T11:33:56Z\",\"endTime\":\"2021-10-19T14:27:25Z\",\"operations\":[{\"status\":\"foxx\"},{\"status\":\"ubvphavpmhbrbqgv\"},{\"status\":\"ovpbbttefjoknssq\"},{\"status\":\"zqedikdfrdbi\"}]},{\"id\":\"jgeihfqlggwfi\",\"resourceId\":\"cxmjpbyephmg\",\"name\":\"ljvrcmyfqipgxhnp\",\"status\":\"myqwcab\",\"percentComplete\":7.8104677,\"startTime\":\"2021-05-17T14:24:30Z\",\"endTime\":\"2021-07-31T09:28:56Z\",\"operations\":[{\"status\":\"swlpaugmrmfj\"},{\"status\":\"rxwtoaukhfkvc\"}]},{\"id\":\"zmoaeds\",\"resourceId\":\"wuived\",\"name\":\"gyeewxeiq\",\"status\":\"psmgo\",\"percentComplete\":0.2232194,\"startTime\":\"2021-11-14T16:38:14Z\",\"endTime\":\"2021-08-09T00:37:15Z\",\"operations\":[{\"status\":\"rgmsplzga\"}]}]},{\"id\":\"hhvnewgnxkymp\",\"resourceId\":\"nxrjkixtwbtaoy\",\"name\":\"yghs\",\"status\":\"xcy\",\"percentComplete\":62.703003,\"startTime\":\"2021-02-25T18:08:40Z\",\"endTime\":\"2021-06-25T22:51:05Z\",\"operations\":[{\"id\":\"xycphdrwjjkh\",\"resourceId\":\"omacluzvxnqmhr\",\"name\":\"pd\",\"status\":\"wmkoisq\",\"percentComplete\":36.727757,\"startTime\":\"2021-10-05T03:23:13Z\",\"endTime\":\"2021-06-29T15:08:13Z\",\"operations\":[{\"status\":\"mcs\"},{\"status\":\"p\"},{\"status\":\"bkdq\"}]},{\"id\":\"zsylollgt\",\"resourceId\":\"zzydmxzjijpvua\",\"name\":\"kihcirlde\",\"status\":\"xrdcoxnbkkja\",\"percentComplete\":30.950945,\"startTime\":\"2021-06-29T10:28:45Z\",\"endTime\":\"2021-11-23T12:35:58Z\",\"operations\":[{\"status\":\"bpizxqltgr\"}]},{\"id\":\"ypxrx\",\"resourceId\":\"fihwu\",\"name\":\"ctafsrbxrblm\",\"status\":\"iowxi\",\"percentComplete\":3.0665696,\"startTime\":\"2021-11-04T17:34:13Z\",\"endTime\":\"2021-03-30T11:15:20Z\",\"operations\":[{\"status\":\"nepzwakls\"},{\"status\":\"sbq\"}]},{\"id\":\"gwwrxaomzis\",\"resourceId\":\"rrczezkhhltnj\",\"name\":\"hqo\",\"status\":\"wjqo\",\"percentComplete\":68.41727,\"startTime\":\"2021-07-31T20:48:08Z\",\"endTime\":\"2021-08-01T05:40:59Z\",\"operations\":[{\"status\":\"msplbyr\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.bareMetalMachines() - .cordon("jkxibda", "hrkmdyomkxfbvfbh", - new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.TRUE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hpwpgddeimawzovg", response.id()); - Assertions.assertEquals("kjcjcaztbwsnsqow", response.name()); - Assertions.assertEquals("wcoml", response.status()); - Assertions.assertEquals(86.88219F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T06:56:23Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T11:01:09Z"), response.endTime()); - Assertions.assertEquals("wka", response.operations().get(0).id()); - Assertions.assertEquals("ddpqt", response.operations().get(0).name()); - Assertions.assertEquals("ehnmnaoyankco", response.operations().get(0).status()); - Assertions.assertEquals(66.584496F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-11T14:26:20Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T02:54:41Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("tmhdroznnhdr", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("waeeczgfb", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("kklelssxblycs", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(97.138306F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T10:55:25Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T05:55:26Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("mdesqp", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteMockTests.java deleted file mode 100644 index 0ee61d213e048..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 BareMetalMachinesDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.bareMetalMachines().delete("wjksghudgzhxo", "jggsvo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffMockTests.java deleted file mode 100644 index 2cc91dd3cd248..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesPowerOffMockTests { - @Test - public void testPowerOff() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"wdpyq\",\"resourceId\":\"bxubmdna\",\"name\":\"bqwremjela\",\"status\":\"acigel\",\"percentComplete\":74.37067,\"startTime\":\"2021-11-26T05:52:39Z\",\"endTime\":\"2021-04-23T10:22:37Z\",\"operations\":[{\"id\":\"kjopwbeon\",\"resourceId\":\"kwzdqybxcea\",\"name\":\"cptsoqfyiase\",\"status\":\"chkrttzr\",\"percentComplete\":90.373055,\"startTime\":\"2021-04-10T05:16:30Z\",\"endTime\":\"2021-05-21T21:38:58Z\",\"operations\":[{\"id\":\"mvanbwzo\",\"resourceId\":\"nrxxbsojklin\",\"name\":\"dptysprqs\",\"status\":\"nzxojpslsvjgpli\",\"percentComplete\":81.04206,\"startTime\":\"2021-07-10T14:05:30Z\",\"endTime\":\"2021-12-08T21:04:16Z\",\"operations\":[{\"status\":\"vapcoh\"},{\"status\":\"oucqpqojx\"},{\"status\":\"x\"}]}]},{\"id\":\"cgdz\",\"resourceId\":\"nr\",\"name\":\"cawetzqddt\",\"status\":\"wflj\",\"percentComplete\":58.680862,\"startTime\":\"2021-04-10T13:20:50Z\",\"endTime\":\"2021-07-09T20:30:45Z\",\"operations\":[{\"id\":\"zwcjjncqtj\",\"resourceId\":\"izvg\",\"name\":\"atzuuv\",\"status\":\"xngre\",\"percentComplete\":31.940014,\"startTime\":\"2021-07-20T12:45:18Z\",\"endTime\":\"2021-01-16T19:45:25Z\",\"operations\":[{\"status\":\"lswva\"},{\"status\":\"qfutlxjo\"},{\"status\":\"zasunwqrjzfrgq\"}]},{\"id\":\"hcmbuocnjrohmbp\",\"resourceId\":\"yx\",\"name\":\"eblydyv\",\"status\":\"fkmroc\",\"percentComplete\":4.2229533,\"startTime\":\"2021-07-09T08:52:55Z\",\"endTime\":\"2021-08-13T16:19:10Z\",\"operations\":[{\"status\":\"dlfp\"},{\"status\":\"apucygvo\"},{\"status\":\"vyuns\"},{\"status\":\"xlghieegj\"}]}]},{\"id\":\"paseksgb\",\"resourceId\":\"antuygdhgaqipirp\",\"name\":\"rqofulopmjnlexwh\",\"status\":\"bjpi\",\"percentComplete\":3.5229385,\"startTime\":\"2021-04-03T07:18:13Z\",\"endTime\":\"2021-05-30T08:42:44Z\",\"operations\":[{\"id\":\"ctatoyintqpbrlcy\",\"resourceId\":\"uczkgofxyfsruc\",\"name\":\"rrp\",\"status\":\"jttbstv\",\"percentComplete\":84.53266,\"startTime\":\"2021-06-06T13:44:54Z\",\"endTime\":\"2021-08-03T20:23:39Z\",\"operations\":[{\"status\":\"fkoxmlghktuidvr\"},{\"status\":\"azlp\"}]},{\"id\":\"exymzvla\",\"resourceId\":\"pbh\",\"name\":\"vqs\",\"status\":\"ny\",\"percentComplete\":91.92979,\"startTime\":\"2021-04-23T19:57:01Z\",\"endTime\":\"2021-10-14T08:13:15Z\",\"operations\":[{\"status\":\"rpmey\"},{\"status\":\"vpkpatlb\"}]},{\"id\":\"zgs\",\"resourceId\":\"rfhfvo\",\"name\":\"knbnxwcdommpvfq\",\"status\":\"wzfgbrttuiaclkie\",\"percentComplete\":69.9188,\"startTime\":\"2021-04-18T23:10:57Z\",\"endTime\":\"2021-04-17T02:43:37Z\",\"operations\":[{\"status\":\"iqfyuttdi\"},{\"status\":\"gbpvnwswmtxkyct\"},{\"status\":\"wgzwxjlmecvog\"}]}]},{\"id\":\"vne\",\"resourceId\":\"aifghtmoqqt\",\"name\":\"fhzbkr\",\"status\":\"jjjavfqnvhnq\",\"percentComplete\":69.29112,\"startTime\":\"2021-01-06T07:59:03Z\",\"endTime\":\"2020-12-26T00:21:50Z\",\"operations\":[{\"id\":\"esypvidbztjh\",\"resourceId\":\"fbov\",\"name\":\"nkbw\",\"status\":\"tnjuhpsprkzyaupi\",\"percentComplete\":73.421104,\"startTime\":\"2021-01-29T16:38:57Z\",\"endTime\":\"2021-09-15T16:45:58Z\",\"operations\":[{\"status\":\"qroohtu\"}]},{\"id\":\"aonurjtumg\",\"resourceId\":\"hpv\",\"name\":\"mslclblyjxlt\",\"status\":\"sjuscvsfxigctmg\",\"percentComplete\":74.84599,\"startTime\":\"2021-08-09T09:46:25Z\",\"endTime\":\"2021-04-21T17:26:50Z\",\"operations\":[{\"status\":\"cydrtceukdqkk\"}]},{\"id\":\"ztgeqmgqzgwld\",\"resourceId\":\"chillcecf\",\"name\":\"uwaoaguhicqlli\",\"status\":\"stacsjvhrweftkwq\",\"percentComplete\":60.642326,\"startTime\":\"2021-05-08T02:12:14Z\",\"endTime\":\"2021-04-07T07:21:40Z\",\"operations\":[{\"status\":\"aepwamcxtcz\"}]},{\"id\":\"euknijduyyes\",\"resourceId\":\"djfbocyv\",\"name\":\"ulrtywikdmh\",\"status\":\"akuflgbhgauacdix\",\"percentComplete\":14.551282,\"startTime\":\"2021-07-21T10:11:29Z\",\"endTime\":\"2021-10-28T11:16:26Z\",\"operations\":[{\"status\":\"qg\"},{\"status\":\"kfnozoeoqbvj\"},{\"status\":\"vefgwbmqjchntas\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.bareMetalMachines() - .powerOff("thwmgnmbsc", "bxigdhxiidlo", - new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.FALSE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wdpyq", response.id()); - Assertions.assertEquals("bqwremjela", response.name()); - Assertions.assertEquals("acigel", response.status()); - Assertions.assertEquals(74.37067F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T05:52:39Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T10:22:37Z"), response.endTime()); - Assertions.assertEquals("kjopwbeon", response.operations().get(0).id()); - Assertions.assertEquals("cptsoqfyiase", response.operations().get(0).name()); - Assertions.assertEquals("chkrttzr", response.operations().get(0).status()); - Assertions.assertEquals(90.373055F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T05:16:30Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T21:38:58Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("mvanbwzo", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("dptysprqs", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("nzxojpslsvjgpli", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(81.04206F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T14:05:30Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T21:04:16Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("vapcoh", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageMockTests.java deleted file mode 100644 index 560d776b34929..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesReimageMockTests { - @Test - public void testReimage() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"btsuahxs\",\"resourceId\":\"jcmmzrrscub\",\"name\":\"sd\",\"status\":\"npxqwodi\",\"percentComplete\":77.01541,\"startTime\":\"2021-03-03T11:14:29Z\",\"endTime\":\"2021-05-14T08:20:39Z\",\"operations\":[{\"id\":\"abwibvjogjo\",\"resourceId\":\"cyefoyzbamwine\",\"name\":\"vfkakpold\",\"status\":\"vevboclzh\",\"percentComplete\":71.18491,\"startTime\":\"2021-07-15T19:06:59Z\",\"endTime\":\"2021-07-02T09:21:32Z\",\"operations\":[{\"id\":\"txpnrupza\",\"resourceId\":\"rdixt\",\"name\":\"kidswys\",\"status\":\"br\",\"percentComplete\":69.84359,\"startTime\":\"2021-10-21T15:00:18Z\",\"endTime\":\"2021-10-06T17:50:49Z\",\"operations\":[{\"status\":\"utvlxhr\"},{\"status\":\"qhvmblcouqe\"},{\"status\":\"bhbcdszir\"}]}]},{\"id\":\"doypm\",\"resourceId\":\"t\",\"name\":\"rmkfqlwxldykals\",\"status\":\"g\",\"percentComplete\":96.73931,\"startTime\":\"2021-03-31T21:29:13Z\",\"endTime\":\"2021-12-05T06:04:35Z\",\"operations\":[{\"id\":\"jksibjg\",\"resourceId\":\"jxxahmrnad\",\"name\":\"qegxyivpin\",\"status\":\"mhwbjijkgqx\",\"percentComplete\":15.176058,\"startTime\":\"2021-04-20T14:35:11Z\",\"endTime\":\"2021-10-16T14:02:14Z\",\"operations\":[{\"status\":\"aujvaa\"}]}]},{\"id\":\"iycwkdta\",\"resourceId\":\"xw\",\"name\":\"ka\",\"status\":\"mrrqmbzmqkratb\",\"percentComplete\":66.8104,\"startTime\":\"2021-06-21T18:23:35Z\",\"endTime\":\"2021-08-05T15:01:16Z\",\"operations\":[{\"id\":\"rkfpks\",\"resourceId\":\"dgo\",\"name\":\"wijymr\",\"status\":\"bguzozky\",\"percentComplete\":40.12607,\"startTime\":\"2020-12-24T09:45:57Z\",\"endTime\":\"2021-06-15T03:53:03Z\",\"operations\":[{\"status\":\"qo\"},{\"status\":\"mffjkutycyarn\"}]},{\"id\":\"hguabzoghktdp\",\"resourceId\":\"z\",\"name\":\"oeocnhzqrott\",\"status\":\"zcfyjzptwrl\",\"percentComplete\":34.49209,\"startTime\":\"2021-03-15T17:03:59Z\",\"endTime\":\"2021-02-15T18:23:08Z\",\"operations\":[{\"status\":\"zpyglqdhmrj\"},{\"status\":\"ralcxpjbyypsj\"},{\"status\":\"qcjenkyhf\"}]},{\"id\":\"sqxfxjelgcmpz\",\"resourceId\":\"hhhqxuwyv\",\"name\":\"co\",\"status\":\"v\",\"percentComplete\":31.564491,\"startTime\":\"2021-08-20T22:21:36Z\",\"endTime\":\"2021-03-26T16:46:43Z\",\"operations\":[{\"status\":\"szlbscm\"},{\"status\":\"lzijiufehgmvflnw\"}]}]},{\"id\":\"xrerlniylylyf\",\"resourceId\":\"zutgqztwhghmupg\",\"name\":\"jtcdxabbujftaben\",\"status\":\"bklqpxz\",\"percentComplete\":65.13686,\"startTime\":\"2021-07-29T07:07:53Z\",\"endTime\":\"2021-04-20T13:02:49Z\",\"operations\":[{\"id\":\"lzafwxu\",\"resourceId\":\"nhgookrtalvnbw\",\"name\":\"bemeluclvd\",\"status\":\"jukyrdn\",\"percentComplete\":88.03156,\"startTime\":\"2021-10-09T14:31:55Z\",\"endTime\":\"2021-04-05T17:13:39Z\",\"operations\":[{\"status\":\"qfaqnvzoqg\"},{\"status\":\"ipemchgavscz\"}]},{\"id\":\"dtx\",\"resourceId\":\"lghwzhome\",\"name\":\"j\",\"status\":\"tl\",\"percentComplete\":35.869938,\"startTime\":\"2021-05-19T10:52:28Z\",\"endTime\":\"2021-07-26T14:32:02Z\",\"operations\":[{\"status\":\"ia\"},{\"status\":\"cz\"},{\"status\":\"vodrrslblxydkxr\"}]},{\"id\":\"bxiwkgfbqljn\",\"resourceId\":\"hychocokuleh\",\"name\":\"qlrqffaweyurk\",\"status\":\"hy\",\"percentComplete\":15.436524,\"startTime\":\"2021-08-23T02:12:11Z\",\"endTime\":\"2021-05-18T20:50:57Z\",\"operations\":[{\"status\":\"dbrxmrgc\"},{\"status\":\"bapxkiyfjjkb\"},{\"status\":\"jbuscg\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.bareMetalMachines().reimage("xbulpzealbmqkyo", "wyvf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("btsuahxs", response.id()); - Assertions.assertEquals("sd", response.name()); - Assertions.assertEquals("npxqwodi", response.status()); - Assertions.assertEquals(77.01541F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T11:14:29Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T08:20:39Z"), response.endTime()); - Assertions.assertEquals("abwibvjogjo", response.operations().get(0).id()); - Assertions.assertEquals("vfkakpold", response.operations().get(0).name()); - Assertions.assertEquals("vevboclzh", response.operations().get(0).status()); - Assertions.assertEquals(71.18491F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T19:06:59Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T09:21:32Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("txpnrupza", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("kidswys", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("br", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(69.84359F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T15:00:18Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T17:50:49Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("utvlxhr", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartMockTests.java deleted file mode 100644 index 51175cbb675ff..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"wnapfdq\",\"resourceId\":\"wf\",\"name\":\"tnuwjtkschgc\",\"status\":\"qyhleseyq\",\"percentComplete\":38.67095,\"startTime\":\"2021-05-01T01:24:46Z\",\"endTime\":\"2021-03-23T12:51:27Z\",\"operations\":[{\"id\":\"v\",\"resourceId\":\"wiswskukjtasbvw\",\"name\":\"pkxkdtxfk\",\"status\":\"dlqvtwknvg\",\"percentComplete\":63.786263,\"startTime\":\"2021-03-22T07:20:24Z\",\"endTime\":\"2021-04-18T11:14:59Z\",\"operations\":[{\"id\":\"mqaqkueatgroes\",\"resourceId\":\"ygzc\",\"name\":\"fqxkfaoyteh\",\"status\":\"puvjmvqmtd\",\"percentComplete\":86.75552,\"startTime\":\"2021-11-05T05:11:54Z\",\"endTime\":\"2021-02-10T18:43:05Z\",\"operations\":[{\"status\":\"n\"}]},{\"id\":\"jdjusk\",\"resourceId\":\"req\",\"name\":\"kceysfaqegplw\",\"status\":\"ysh\",\"percentComplete\":3.9907634,\"startTime\":\"2021-10-08T22:13:16Z\",\"endTime\":\"2021-10-26T06:09:59Z\",\"operations\":[{\"status\":\"qusybwptd\"},{\"status\":\"carvvlfntymtpoi\"},{\"status\":\"enazerohzrsqals\"}]},{\"id\":\"nwqapfgsdpcvess\",\"resourceId\":\"hhkuuip\",\"name\":\"q\",\"status\":\"ctekval\",\"percentComplete\":54.789043,\"startTime\":\"2021-01-01T12:19:53Z\",\"endTime\":\"2021-08-04T07:59:56Z\",\"operations\":[{\"status\":\"vweht\"},{\"status\":\"emxhzzy\"},{\"status\":\"ev\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.bareMetalMachines().restart("ltafhbzffo", "wmbjlzqsczpg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wnapfdq", response.id()); - Assertions.assertEquals("tnuwjtkschgc", response.name()); - Assertions.assertEquals("qyhleseyq", response.status()); - Assertions.assertEquals(38.67095F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-01T01:24:46Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T12:51:27Z"), response.endTime()); - Assertions.assertEquals("v", response.operations().get(0).id()); - Assertions.assertEquals("pkxkdtxfk", response.operations().get(0).name()); - Assertions.assertEquals("dlqvtwknvg", response.operations().get(0).status()); - Assertions.assertEquals(63.786263F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T07:20:24Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T11:14:59Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("mqaqkueatgroes", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("fqxkfaoyteh", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("puvjmvqmtd", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(86.75552F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T05:11:54Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T18:43:05Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("n", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandMockTests.java deleted file mode 100644 index db48590a6e844..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BareMetalMachinesRunCommandMockTests { - @Test - public void testRunCommand() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"lkcsmknhwtbbae\",\"resourceId\":\"rvvmqfloygb\",\"name\":\"wumgx\",\"status\":\"gdhpabgdexjddv\",\"percentComplete\":50.13225,\"startTime\":\"2021-10-15T10:21:04Z\",\"endTime\":\"2021-07-09T18:18:40Z\",\"operations\":[{\"id\":\"llcolsrsxapte\",\"resourceId\":\"excgjokjljnhvl\",\"name\":\"bekpeeksnbksdqhj\",\"status\":\"yklxe\",\"percentComplete\":13.086528,\"startTime\":\"2021-03-06T14:39:47Z\",\"endTime\":\"2021-11-12T17:23:36Z\",\"operations\":[{\"id\":\"oqmavnwqjwgo\",\"resourceId\":\"lejjjkxy\",\"name\":\"fdb\",\"status\":\"jbzten\",\"percentComplete\":48.449642,\"startTime\":\"2020-12-21T13:24:31Z\",\"endTime\":\"2021-10-20T20:55:34Z\",\"operations\":[{\"status\":\"kns\"},{\"status\":\"fwushcdpkupn\"}]}]},{\"id\":\"jfbp\",\"resourceId\":\"wxeoiojfizfavkj\",\"name\":\"fbcyaykmm\",\"status\":\"zs\",\"percentComplete\":94.81268,\"startTime\":\"2021-03-03T22:45:37Z\",\"endTime\":\"2021-03-01T10:08:57Z\",\"operations\":[{\"id\":\"wsrsxkrplbja\",\"resourceId\":\"jwwviy\",\"name\":\"ps\",\"status\":\"hbrnnhjx\",\"percentComplete\":13.075119,\"startTime\":\"2021-10-23T15:48:33Z\",\"endTime\":\"2021-04-28T17:16:52Z\",\"operations\":[{\"status\":\"wetp\"},{\"status\":\"zycyqiqyhg\"}]}]},{\"id\":\"zlex\",\"resourceId\":\"fledynojpziu\",\"name\":\"bzkkd\",\"status\":\"nhqs\",\"percentComplete\":32.192505,\"startTime\":\"2021-04-17T05:36:17Z\",\"endTime\":\"2021-11-12T21:16:46Z\",\"operations\":[{\"id\":\"bafvafhlbylcc\",\"resourceId\":\"vxrh\",\"name\":\"d\",\"status\":\"wrso\",\"percentComplete\":21.28094,\"startTime\":\"2021-08-15T11:31:01Z\",\"endTime\":\"2021-07-12T15:31:33Z\",\"operations\":[{\"status\":\"rrhvhfnracwnpq\"},{\"status\":\"g\"}]},{\"id\":\"jwouhda\",\"resourceId\":\"igrb\",\"name\":\"xsjybvitvqk\",\"status\":\"y\",\"percentComplete\":7.9839587,\"startTime\":\"2021-10-28T18:11:26Z\",\"endTime\":\"2021-07-21T21:37:11Z\",\"operations\":[{\"status\":\"uwdchozf\"}]},{\"id\":\"exlvxnoakiz\",\"resourceId\":\"aikn\",\"name\":\"lnuwiguy\",\"status\":\"lykwphvxz\",\"percentComplete\":66.61096,\"startTime\":\"2021-02-09T15:30:09Z\",\"endTime\":\"2021-08-08T23:29:51Z\",\"operations\":[{\"status\":\"lkexaonwivkcqh\"}]}]},{\"id\":\"knlccrmmkyup\",\"resourceId\":\"ubyqj\",\"name\":\"akfqfrkemyildud\",\"status\":\"jascowvfdjkpd\",\"percentComplete\":30.62821,\"startTime\":\"2021-02-03T18:42:47Z\",\"endTime\":\"2021-11-26T10:04:18Z\",\"operations\":[{\"id\":\"zvyfijdkzuqnwsi\",\"resourceId\":\"uqoly\",\"name\":\"luqw\",\"status\":\"ulsutrjbhxy\",\"percentComplete\":46.34994,\"startTime\":\"2021-07-20T12:13:18Z\",\"endTime\":\"2021-11-07T03:15:42Z\",\"operations\":[{\"status\":\"qugdrftbcvexreuq\"}]},{\"id\":\"tljvfwhreagkhyx\",\"resourceId\":\"qtvbczsu\",\"name\":\"dgglmepjpfs\",\"status\":\"ykgsangpszng\",\"percentComplete\":4.358429,\"startTime\":\"2021-06-06T23:22:02Z\",\"endTime\":\"2021-02-13T15:02:43Z\",\"operations\":[{\"status\":\"cj\"},{\"status\":\"jcngoadyed\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.bareMetalMachines() - .runCommand("vzrrryveimi", "sk", - new BareMetalMachineRunCommandParameters() - .withArguments(Arrays.asList("atvfuzkaftj", "vru", "wigsyeipqdsm")) - .withLimitTimeSeconds(3521751266515762395L) - .withScript("rqgdgkkil"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lkcsmknhwtbbae", response.id()); - Assertions.assertEquals("wumgx", response.name()); - Assertions.assertEquals("gdhpabgdexjddv", response.status()); - Assertions.assertEquals(50.13225F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T10:21:04Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-09T18:18:40Z"), response.endTime()); - Assertions.assertEquals("llcolsrsxapte", response.operations().get(0).id()); - Assertions.assertEquals("bekpeeksnbksdqhj", response.operations().get(0).name()); - Assertions.assertEquals("yklxe", response.operations().get(0).status()); - Assertions.assertEquals(13.086528F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T14:39:47Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-12T17:23:36Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("oqmavnwqjwgo", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("fdb", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("jbzten", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(48.449642F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T13:24:31Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-20T20:55:34Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("kns", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsMockTests.java deleted file mode 100644 index 0f3d439715151..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BareMetalMachinesRunDataExtractsMockTests { - @Test - public void testRunDataExtracts() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"tipwcxbyubhiqd\",\"resourceId\":\"urnpnuhzafccnuh\",\"name\":\"gbylbuig\",\"status\":\"xvatvcr\",\"percentComplete\":21.649128,\"startTime\":\"2021-03-26T19:13:55Z\",\"endTime\":\"2021-07-31T13:29:51Z\",\"operations\":[{\"id\":\"csyhzlwxaeaov\",\"resourceId\":\"exdnd\",\"name\":\"dwead\",\"status\":\"rzmwn\",\"percentComplete\":15.468043,\"startTime\":\"2021-06-07T19:00:04Z\",\"endTime\":\"2021-07-05T10:58:17Z\",\"operations\":[{\"id\":\"magoaqylkjz\",\"resourceId\":\"iua\",\"name\":\"cgm\",\"status\":\"itpfinzcpdl\",\"percentComplete\":31.125391,\"startTime\":\"2021-06-08T11:12:37Z\",\"endTime\":\"2021-10-17T10:54:47Z\",\"operations\":[{\"status\":\"drvcqguef\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.bareMetalMachines() - .runDataExtracts("jfoknubnoitpkp", "trgdgxvc", - new BareMetalMachineRunDataExtractsParameters().withCommands(Arrays.asList( - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("sw", "gyxpqit", "eialwvskb")) - .withCommand("hzacaqtyltco"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("jpds", "zakuejk", "vbiztjofqcv")) - .withCommand("vjufycsjmlbe"), - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("jiriuxeg")) - .withCommand("hortu"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("lpjfelqerpptcbgq", "zmnhiilialwc", "gckbb", "ccgzpraoxnyu")) - .withCommand("fa"))) - .withLimitTimeSeconds(9173171906821807545L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tipwcxbyubhiqd", response.id()); - Assertions.assertEquals("gbylbuig", response.name()); - Assertions.assertEquals("xvatvcr", response.status()); - Assertions.assertEquals(21.649128F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T19:13:55Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T13:29:51Z"), response.endTime()); - Assertions.assertEquals("csyhzlwxaeaov", response.operations().get(0).id()); - Assertions.assertEquals("dwead", response.operations().get(0).name()); - Assertions.assertEquals("rzmwn", response.operations().get(0).status()); - Assertions.assertEquals(15.468043F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T19:00:04Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T10:58:17Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("magoaqylkjz", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("cgm", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("itpfinzcpdl", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(31.125391F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T11:12:37Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T10:54:47Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("drvcqguef", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsMockTests.java deleted file mode 100644 index 6c5b18b1b3922..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; -import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BareMetalMachinesRunReadCommandsMockTests { - @Test - public void testRunReadCommands() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"c\",\"resourceId\":\"iciijqpkzfbojx\",\"name\":\"cs\",\"status\":\"yqwixvcpwnkwywzw\",\"percentComplete\":51.106243,\"startTime\":\"2021-01-17T11:27:13Z\",\"endTime\":\"2021-08-19T21:16:08Z\",\"operations\":[{\"id\":\"iqtamtyvsknxrw\",\"resourceId\":\"wnv\",\"name\":\"cfhzagxnvhycv\",\"status\":\"imwrzregzgyufu\",\"percentComplete\":40.361755,\"startTime\":\"2021-12-09T04:49:49Z\",\"endTime\":\"2021-05-15T13:13:10Z\",\"operations\":[{\"id\":\"z\",\"resourceId\":\"hmeott\",\"name\":\"jyosxwwh\",\"status\":\"h\",\"percentComplete\":7.83897,\"startTime\":\"2021-07-16T09:37:33Z\",\"endTime\":\"2021-03-13T03:13:47Z\",\"operations\":[{\"status\":\"i\"},{\"status\":\"jpnwynudql\"},{\"status\":\"zsauzp\"}]},{\"id\":\"eehuxiqhzlray\",\"resourceId\":\"zxlskihmxr\",\"name\":\"sajrednwyysht\",\"status\":\"w\",\"percentComplete\":79.93362,\"startTime\":\"2021-08-02T10:16:43Z\",\"endTime\":\"2021-05-31T07:56:10Z\",\"operations\":[{\"status\":\"zyifrkgwltx\"},{\"status\":\"qipxgzdyimsf\"}]},{\"id\":\"rpravkjogeslab\",\"resourceId\":\"mjkwynq\",\"name\":\"ekqsykvwjtqpkev\",\"status\":\"yltjcrspxklu\",\"percentComplete\":17.77879,\"startTime\":\"2021-10-15T09:44:01Z\",\"endTime\":\"2021-07-11T17:20:02Z\",\"operations\":[{\"status\":\"n\"},{\"status\":\"oytzpose\"}]},{\"id\":\"gpxvkqmaupxvpi\",\"resourceId\":\"f\",\"name\":\"fyzyzeyuub\",\"status\":\"idszl\",\"percentComplete\":16.524166,\"startTime\":\"2021-11-28T20:47:36Z\",\"endTime\":\"2021-05-05T02:15:37Z\",\"operations\":[{\"status\":\"gvfltgvdihoynkr\"},{\"status\":\"wetwkdr\"},{\"status\":\"yrucpcunnuzdq\"},{\"status\":\"moenodnaien\"}]}]},{\"id\":\"knd\",\"resourceId\":\"lqkaadlknwf\",\"name\":\"nniyopetxi\",\"status\":\"cnrly\",\"percentComplete\":22.466213,\"startTime\":\"2021-09-12T03:23:28Z\",\"endTime\":\"2021-01-20T08:40:36Z\",\"operations\":[{\"id\":\"kwqpat\",\"resourceId\":\"qsdtcjbctvivuzq\",\"name\":\"tuowogtgitsqh\",\"status\":\"vbrzcdb\",\"percentComplete\":84.15396,\"startTime\":\"2021-09-20T19:14:03Z\",\"endTime\":\"2021-05-28T10:26:09Z\",\"operations\":[{\"status\":\"mxeatkdbmwnrdjy\"},{\"status\":\"bqbnaomhjrmkuh\"},{\"status\":\"axljal\"}]},{\"id\":\"cjmobcanc\",\"resourceId\":\"xxqcwgaxf\",\"name\":\"aknokzwjjzrl\",\"status\":\"ixldzyyfy\",\"percentComplete\":24.225784,\"startTime\":\"2021-05-16T13:00:48Z\",\"endTime\":\"2021-03-18T19:43:55Z\",\"operations\":[{\"status\":\"puj\"}]},{\"id\":\"qlkjuv\",\"resourceId\":\"bmslzoyov\",\"name\":\"dbpqvybefgvm\",\"status\":\"nokcv\",\"percentComplete\":79.84004,\"startTime\":\"2021-01-01T17:46:17Z\",\"endTime\":\"2020-12-21T13:08:22Z\",\"operations\":[{\"status\":\"cua\"},{\"status\":\"t\"},{\"status\":\"hunlpirykycnd\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.bareMetalMachines() - .runReadCommands("p", "eqdurelyujlfyoum", - new BareMetalMachineRunReadCommandsParameters() - .withCommands(Arrays.asList( - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("eclcdigptajbrzm")) - .withCommand("xucycijoclxi"), - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("jc", "z", "zjd")) - .withCommand("r"), - new BareMetalMachineCommandSpecification() - .withArguments(Arrays.asList("txjeaoqaqbzgy", "fwwvuatbwbqam", "e", "liys")) - .withCommand("pkcvmwf"), - new BareMetalMachineCommandSpecification().withArguments(Arrays.asList("xe")) - .withCommand("myw"))) - .withLimitTimeSeconds(8838975018818130961L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("c", response.id()); - Assertions.assertEquals("cs", response.name()); - Assertions.assertEquals("yqwixvcpwnkwywzw", response.status()); - Assertions.assertEquals(51.106243F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T11:27:13Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T21:16:08Z"), response.endTime()); - Assertions.assertEquals("iqtamtyvsknxrw", response.operations().get(0).id()); - Assertions.assertEquals("cfhzagxnvhycv", response.operations().get(0).name()); - Assertions.assertEquals("imwrzregzgyufu", response.operations().get(0).status()); - Assertions.assertEquals(40.361755F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T04:49:49Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T13:13:10Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("z", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("jyosxwwh", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("h", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(7.83897F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T09:37:33Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T03:13:47Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("i", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartMockTests.java deleted file mode 100644 index f9584a775ff33..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"lnf\",\"resourceId\":\"y\",\"name\":\"vqdbpbhfck\",\"status\":\"vezcrcssbzhdd\",\"percentComplete\":47.65451,\"startTime\":\"2021-01-18T21:27:07Z\",\"endTime\":\"2021-11-16T04:37:45Z\",\"operations\":[{\"id\":\"alehpav\",\"resourceId\":\"ugiqjtiogqg\",\"name\":\"inic\",\"status\":\"teajohiyg\",\"percentComplete\":5.8400393,\"startTime\":\"2021-02-10T23:40:39Z\",\"endTime\":\"2021-03-08T08:00:31Z\",\"operations\":[{\"id\":\"ykm\",\"resourceId\":\"p\",\"name\":\"xqcsehch\",\"status\":\"hufmpq\",\"percentComplete\":1.5317738,\"startTime\":\"2021-06-18T05:18:44Z\",\"endTime\":\"2021-10-17T04:58:08Z\",\"operations\":[{\"status\":\"ulodsaeuzanhsfnh\"}]},{\"id\":\"wphpzfngqj\",\"resourceId\":\"idftujwjjufwbe\",\"name\":\"k\",\"status\":\"orhtss\",\"percentComplete\":74.679276,\"startTime\":\"2021-06-15T07:22:19Z\",\"endTime\":\"2021-08-02T13:56:45Z\",\"operations\":[{\"status\":\"zcvjytiqswbqerz\"},{\"status\":\"xiytxtdgukvl\"}]},{\"id\":\"tgdstyouambe\",\"resourceId\":\"esw\",\"name\":\"weg\",\"status\":\"mut\",\"percentComplete\":19.082249,\"startTime\":\"2021-10-05T19:49:24Z\",\"endTime\":\"2021-05-23T20:36:12Z\",\"operations\":[{\"status\":\"gijiitnspxlzd\"},{\"status\":\"sygrijwa\"},{\"status\":\"ufanray\"},{\"status\":\"fueqfrojs\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.bareMetalMachines().start("vjreuykbbmnw", "gltbxoeeo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lnf", response.id()); - Assertions.assertEquals("vqdbpbhfck", response.name()); - Assertions.assertEquals("vezcrcssbzhdd", response.status()); - Assertions.assertEquals(47.65451F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T21:27:07Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-16T04:37:45Z"), response.endTime()); - Assertions.assertEquals("alehpav", response.operations().get(0).id()); - Assertions.assertEquals("inic", response.operations().get(0).name()); - Assertions.assertEquals("teajohiyg", response.operations().get(0).status()); - Assertions.assertEquals(5.8400393F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T23:40:39Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T08:00:31Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("ykm", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("xqcsehch", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("hufmpq", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(1.5317738F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T05:18:44Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T04:58:08Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("ulodsaeuzanhsfnh", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonMockTests.java deleted file mode 100644 index e023f06fe8b63..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 BareMetalMachinesUncordonMockTests { - @Test - public void testUncordon() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"afygzmxieqvds\",\"resourceId\":\"klixqcahyhxaly\",\"name\":\"awoijp\",\"status\":\"dtblxpk\",\"percentComplete\":5.4994345,\"startTime\":\"2021-03-11T11:00:19Z\",\"endTime\":\"2021-02-25T09:30:02Z\",\"operations\":[{\"id\":\"kincnremeh\",\"resourceId\":\"izhceumoqodkadp\",\"name\":\"ibngqladyw\",\"status\":\"xwhydtluvv\",\"percentComplete\":83.74028,\"startTime\":\"2021-06-14T02:58:28Z\",\"endTime\":\"2021-10-16T20:00:10Z\",\"operations\":[{\"id\":\"mlowuowhl\",\"resourceId\":\"nwyrmouv\",\"name\":\"gmokzkltrfowt\",\"status\":\"vrfmvlihcvjd\",\"percentComplete\":63.08274,\"startTime\":\"2021-07-16T20:14:45Z\",\"endTime\":\"2021-07-22T00:47:16Z\",\"operations\":[{\"status\":\"tuk\"},{\"status\":\"hdxlw\"}]},{\"id\":\"bfqz\",\"resourceId\":\"fnjyix\",\"name\":\"fratqxmbjroumzz\",\"status\":\"valqjrhuzgfxo\",\"percentComplete\":55.975597,\"startTime\":\"2021-03-25T12:43:55Z\",\"endTime\":\"2021-08-03T10:15:28Z\",\"operations\":[{\"status\":\"wpvtiotzbpdbol\"},{\"status\":\"gryfqiuasig\"}]},{\"id\":\"socnequygdjboq\",\"resourceId\":\"mtqjkqevadrmm\",\"name\":\"uawvcmjzk\",\"status\":\"iidisczskoswoqiq\",\"percentComplete\":24.43844,\"startTime\":\"2021-11-05T09:28:24Z\",\"endTime\":\"2021-03-12T04:19:04Z\",\"operations\":[{\"status\":\"rrcoi\"},{\"status\":\"sbamnppcc\"},{\"status\":\"kuztdsbezaxyfu\"},{\"status\":\"zxuizhyhnepkpe\"}]},{\"id\":\"rx\",\"resourceId\":\"ubxdukecpxdazvdh\",\"name\":\"mmkoszudb\",\"status\":\"nsntrpcaqki\",\"percentComplete\":10.727042,\"startTime\":\"2021-01-28T07:10:21Z\",\"endTime\":\"2021-07-02T06:02:13Z\",\"operations\":[{\"status\":\"lbnld\"}]}]},{\"id\":\"h\",\"resourceId\":\"zyqu\",\"name\":\"sqxutr\",\"status\":\"brruyuuatv\",\"percentComplete\":54.63494,\"startTime\":\"2021-08-31T05:43:57Z\",\"endTime\":\"2021-01-22T06:54:58Z\",\"operations\":[{\"id\":\"x\",\"resourceId\":\"nwtpcpahprz\",\"name\":\"xhmtfhocnxzc\",\"status\":\"jhngxnoq\",\"percentComplete\":81.584305,\"startTime\":\"2021-08-24T09:16:57Z\",\"endTime\":\"2021-08-17T14:16:34Z\",\"operations\":[{\"status\":\"vhdl\"},{\"status\":\"ydidwhepfwwtjf\"},{\"status\":\"o\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.bareMetalMachines().uncordon("h", "dkygywezski", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("afygzmxieqvds", response.id()); - Assertions.assertEquals("awoijp", response.name()); - Assertions.assertEquals("dtblxpk", response.status()); - Assertions.assertEquals(5.4994345F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T11:00:19Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T09:30:02Z"), response.endTime()); - Assertions.assertEquals("kincnremeh", response.operations().get(0).id()); - Assertions.assertEquals("ibngqladyw", response.operations().get(0).name()); - Assertions.assertEquals("xwhydtluvv", response.operations().get(0).status()); - Assertions.assertEquals(83.74028F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-14T02:58:28Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T20:00:10Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("mlowuowhl", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("gmokzkltrfowt", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("vrfmvlihcvjd", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(63.08274F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T20:14:45Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T00:47:16Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("tuk", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BgpAdvertisementTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BgpAdvertisementTests.java deleted file mode 100644 index 3b6b624cc7812..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BgpAdvertisementTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.AdvertiseToFabric; -import com.azure.resourcemanager.networkcloud.models.BgpAdvertisement; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BgpAdvertisementTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BgpAdvertisement model = BinaryData.fromString( - "{\"advertiseToFabric\":\"True\",\"communities\":[\"abnetshh\"],\"ipAddressPools\":[\"h\",\"d\",\"lvwiwubmwmbesl\"],\"peers\":[\"wwtppj\"]}") - .toObject(BgpAdvertisement.class); - Assertions.assertEquals(AdvertiseToFabric.TRUE, model.advertiseToFabric()); - Assertions.assertEquals("abnetshh", model.communities().get(0)); - Assertions.assertEquals("h", model.ipAddressPools().get(0)); - Assertions.assertEquals("wwtppj", model.peers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BgpAdvertisement model = new BgpAdvertisement().withAdvertiseToFabric(AdvertiseToFabric.TRUE) - .withCommunities(Arrays.asList("abnetshh")) - .withIpAddressPools(Arrays.asList("h", "d", "lvwiwubmwmbesl")) - .withPeers(Arrays.asList("wwtppj")); - model = BinaryData.fromObject(model).toObject(BgpAdvertisement.class); - Assertions.assertEquals(AdvertiseToFabric.TRUE, model.advertiseToFabric()); - Assertions.assertEquals("abnetshh", model.communities().get(0)); - Assertions.assertEquals("h", model.ipAddressPools().get(0)); - Assertions.assertEquals("wwtppj", model.peers().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteMockTests.java deleted file mode 100644 index b9af83e84b0e8..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 BmcKeySetsDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.bmcKeySets().delete("ekiooanduewfhv", "x", "hxzubfjzabbw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkInnerTests.java deleted file mode 100644 index 2d187e756db6a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkInnerTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudServicesNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudServicesNetworkInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"yc\",\"type\":\"sne\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"z\",\"endpoints\":[{\"domainName\":\"iachbo\",\"port\":7002170087466409923},{\"domainName\":\"nrosfqpte\",\"port\":6506464827830686255},{\"domainName\":\"vypyqrimzinpv\",\"port\":2981381234458568547},{\"domainName\":\"kirsoodqxhc\",\"port\":5435378937103352415}]},{\"category\":\"hjtckwhd\",\"endpoints\":[{\"domainName\":\"ifiyipjxsqwpgrj\",\"port\":7893656903308108535},{\"domainName\":\"rcjxvsnbyxqabn\",\"port\":3303160173676492784},{\"domainName\":\"cyshurzafbljjgp\",\"port\":1259856428819267216},{\"domainName\":\"c\",\"port\":3089454434341708656}]}],\"associatedResourceIds\":[\"vbqid\"],\"clusterId\":\"ajzyul\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"jkrlkhbzhfepg\",\"enableDefaultEgressEndpoints\":\"True\",\"enabledEgressEndpoints\":[{\"category\":\"zloc\",\"endpoints\":[{\"domainName\":\"c\",\"port\":7962236738241202360},{\"domainName\":\"rhhbcs\",\"port\":2260430368341825992}]},{\"category\":\"majtjaod\",\"endpoints\":[{\"domainName\":\"bnbdxkqpxokajion\",\"port\":1589043930460259001},{\"domainName\":\"xg\",\"port\":4171550668589423335},{\"domainName\":\"cp\",\"port\":8018866075965400544},{\"domainName\":\"aajrm\",\"port\":5608732709320879366}]},{\"category\":\"zrlovmclwhijcoej\",\"endpoints\":[{\"domainName\":\"bzaqsqsycbkbfk\",\"port\":6954441473774697621},{\"domainName\":\"kexxppof\",\"port\":8067111908299407616},{\"domainName\":\"c\",\"port\":1700907273913635795},{\"domainName\":\"ddtocjjxhvp\",\"port\":7583874860615513488}]}],\"hybridAksClustersAssociatedIds\":[\"dzxibqeojnxqbzvd\"],\"interfaceName\":\"t\",\"provisioningState\":\"Accepted\",\"virtualMachinesAssociatedIds\":[\"cbtwnpzaoqvuh\",\"hcffcyddglmjthjq\",\"wpyeicxmqciwqvh\"]},\"location\":\"ixuigdtopbobj\",\"tags\":{\"w\":\"m\"},\"id\":\"a\",\"name\":\"a\",\"type\":\"hrzayvvtpgvdf\"}") - .toObject(CloudServicesNetworkInner.class); - Assertions.assertEquals("ixuigdtopbobj", model.location()); - Assertions.assertEquals("m", model.tags().get("w")); - Assertions.assertEquals("yc", model.extendedLocation().name()); - Assertions.assertEquals("sne", model.extendedLocation().type()); - Assertions.assertEquals("z", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("iachbo", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(7002170087466409923L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudServicesNetworkInner model - = new CloudServicesNetworkInner().withLocation("ixuigdtopbobj") - .withTags(mapOf("w", "m")) - .withExtendedLocation(new ExtendedLocation().withName("yc").withType("sne")) - .withAdditionalEgressEndpoints(Arrays.asList( - new EgressEndpoint().withCategory("z") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("iachbo").withPort(7002170087466409923L), - new EndpointDependency().withDomainName("nrosfqpte").withPort(6506464827830686255L), - new EndpointDependency().withDomainName("vypyqrimzinpv").withPort(2981381234458568547L), - new EndpointDependency().withDomainName("kirsoodqxhc").withPort(5435378937103352415L))), - new EgressEndpoint().withCategory("hjtckwhd") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("ifiyipjxsqwpgrj").withPort(7893656903308108535L), - new EndpointDependency().withDomainName("rcjxvsnbyxqabn").withPort(3303160173676492784L), - new EndpointDependency().withDomainName("cyshurzafbljjgp").withPort(1259856428819267216L), - new EndpointDependency().withDomainName("c").withPort(3089454434341708656L))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE); - model = BinaryData.fromObject(model).toObject(CloudServicesNetworkInner.class); - Assertions.assertEquals("ixuigdtopbobj", model.location()); - Assertions.assertEquals("m", model.tags().get("w")); - Assertions.assertEquals("yc", model.extendedLocation().name()); - Assertions.assertEquals("sne", model.extendedLocation().type()); - Assertions.assertEquals("z", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("iachbo", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(7002170087466409923L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkListTests.java deleted file mode 100644 index 58f375f7cc961..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkListTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkList; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudServicesNetworkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudServicesNetworkList model = BinaryData.fromString( - "{\"nextLink\":\"yypnddhsgcbacphe\",\"value\":[{\"extendedLocation\":{\"name\":\"tynqgoul\",\"type\":\"ndlik\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"gfgibm\",\"endpoints\":[{\"domainName\":\"gakeqsr\"}]}],\"associatedResourceIds\":[\"zqqedq\",\"tbciqfouflmm\",\"kzsmodm\",\"lougpbkw\"],\"clusterId\":\"utduqktapspwgcu\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"mkdo\",\"enableDefaultEgressEndpoints\":\"True\",\"enabledEgressEndpoints\":[{\"category\":\"bmdg\",\"endpoints\":[{\"domainName\":\"jfddgmbmbe\"}]},{\"category\":\"ppbhtqqrolfp\",\"endpoints\":[{\"domainName\":\"s\"},{\"domainName\":\"lgbquxig\"},{\"domainName\":\"yjgzjaoyfhrtxiln\"}]},{\"category\":\"rkujy\",\"endpoints\":[{\"domainName\":\"l\"},{\"domainName\":\"juvf\"},{\"domainName\":\"awrlyx\"}]}],\"hybridAksClustersAssociatedIds\":[\"cpr\",\"nwbxgjvtbvpyssz\"],\"interfaceName\":\"rujqg\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"uqfprwzw\",\"nguitnwuizgazxu\"]},\"location\":\"zuckyfi\",\"tags\":{\"zwdzuh\":\"idf\",\"wxmnteiwao\":\"ymwisdkft\"},\"id\":\"vkmijcmmxdcuf\",\"name\":\"fsrpymzidnse\",\"type\":\"cxtbzsg\"}]}") - .toObject(CloudServicesNetworkList.class); - Assertions.assertEquals("yypnddhsgcbacphe", model.nextLink()); - Assertions.assertEquals("zuckyfi", model.value().get(0).location()); - Assertions.assertEquals("idf", model.value().get(0).tags().get("zwdzuh")); - Assertions.assertEquals("tynqgoul", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("ndlik", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("gfgibm", model.value().get(0).additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("gakeqsr", - model.value().get(0).additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.value().get(0).enableDefaultEgressEndpoints()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudServicesNetworkList model = new CloudServicesNetworkList().withNextLink("yypnddhsgcbacphe") - .withValue(Arrays.asList(new CloudServicesNetworkInner().withLocation("zuckyfi") - .withTags(mapOf("zwdzuh", "idf", "wxmnteiwao", "ymwisdkft")) - .withExtendedLocation(new ExtendedLocation().withName("tynqgoul").withType("ndlik")) - .withAdditionalEgressEndpoints(Arrays.asList(new EgressEndpoint().withCategory("gfgibm") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("gakeqsr"))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE))); - model = BinaryData.fromObject(model).toObject(CloudServicesNetworkList.class); - Assertions.assertEquals("yypnddhsgcbacphe", model.nextLink()); - Assertions.assertEquals("zuckyfi", model.value().get(0).location()); - Assertions.assertEquals("idf", model.value().get(0).tags().get("zwdzuh")); - Assertions.assertEquals("tynqgoul", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("ndlik", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("gfgibm", model.value().get(0).additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("gakeqsr", - model.value().get(0).additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.value().get(0).enableDefaultEgressEndpoints()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchParametersTests.java deleted file mode 100644 index e855577b964c0..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchParametersTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudServicesNetworkPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudServicesNetworkPatchParameters model = BinaryData.fromString( - "{\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"thjtwk\",\"endpoints\":[{\"domainName\":\"osrxuzvoa\",\"port\":9197432395507081242},{\"domainName\":\"q\",\"port\":4018804098340453728}]},{\"category\":\"gbzahgxqdlyr\",\"endpoints\":[{\"domainName\":\"tlaprltzkatb\",\"port\":8174172127943547857},{\"domainName\":\"nnbsoqeqa\",\"port\":8492998195204098966},{\"domainName\":\"lagun\",\"port\":9211068840981575117},{\"domainName\":\"ebwlnbmhyreeudzq\",\"port\":1466138960999741534}]},{\"category\":\"dqmjxly\",\"endpoints\":[{\"domainName\":\"glgou\",\"port\":7389766894389519511}]},{\"category\":\"jjyuojqtobax\",\"endpoints\":[{\"domainName\":\"eytu\",\"port\":4612686172840970711}]}],\"enableDefaultEgressEndpoints\":\"True\"},\"tags\":{\"nkqbhsyrq\":\"u\",\"l\":\"njqhdenxa\"}}") - .toObject(CloudServicesNetworkPatchParameters.class); - Assertions.assertEquals("u", model.tags().get("nkqbhsyrq")); - Assertions.assertEquals("thjtwk", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("osrxuzvoa", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(9197432395507081242L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudServicesNetworkPatchParameters model - = new CloudServicesNetworkPatchParameters().withTags(mapOf("nkqbhsyrq", "u", "l", "njqhdenxa")) - .withAdditionalEgressEndpoints(Arrays.asList( - new EgressEndpoint().withCategory("thjtwk") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("osrxuzvoa").withPort(9197432395507081242L), - new EndpointDependency().withDomainName("q").withPort(4018804098340453728L))), - new EgressEndpoint().withCategory("gbzahgxqdlyr") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("tlaprltzkatb").withPort(8174172127943547857L), - new EndpointDependency().withDomainName("nnbsoqeqa").withPort(8492998195204098966L), - new EndpointDependency().withDomainName("lagun").withPort(9211068840981575117L), - new EndpointDependency().withDomainName("ebwlnbmhyreeudzq") - .withPort(1466138960999741534L))), - new EgressEndpoint().withCategory("dqmjxly") - .withEndpoints(Arrays - .asList(new EndpointDependency().withDomainName("glgou").withPort(7389766894389519511L))), - new EgressEndpoint().withCategory("jjyuojqtobax") - .withEndpoints(Arrays - .asList(new EndpointDependency().withDomainName("eytu").withPort(4612686172840970711L))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE); - model = BinaryData.fromObject(model).toObject(CloudServicesNetworkPatchParameters.class); - Assertions.assertEquals("u", model.tags().get("nkqbhsyrq")); - Assertions.assertEquals("thjtwk", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("osrxuzvoa", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(9197432395507081242L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchPropertiesTests.java deleted file mode 100644 index e195d7baecbcb..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPatchPropertiesTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkPatchProperties; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CloudServicesNetworkPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudServicesNetworkPatchProperties model = BinaryData.fromString( - "{\"additionalEgressEndpoints\":[{\"category\":\"kdk\",\"endpoints\":[{\"domainName\":\"mjnnawtq\",\"port\":608163940967620042},{\"domainName\":\"uckpggqoweyir\",\"port\":4448034441017849158},{\"domainName\":\"sn\",\"port\":1508031090383882102}]},{\"category\":\"qqmpizruwnpqx\",\"endpoints\":[{\"domainName\":\"iwfcngjsa\",\"port\":9178387738992301365}]},{\"category\":\"xtmkzjvkviir\",\"endpoints\":[{\"domainName\":\"fgrwsdpgratzvz\",\"port\":8361909165604899283},{\"domainName\":\"y\",\"port\":1669449067749788452}]},{\"category\":\"ctbrxkjzwrgxffm\",\"endpoints\":[{\"domainName\":\"kwfbkgo\",\"port\":1191343314384683416},{\"domainName\":\"pdbydpizqacln\",\"port\":7563298603289221495},{\"domainName\":\"iygnugjknfsmfctt\",\"port\":7023136561012386480},{\"domainName\":\"yilflqoiquvrehmr\",\"port\":9113082198378119154}]}],\"enableDefaultEgressEndpoints\":\"True\"}") - .toObject(CloudServicesNetworkPatchProperties.class); - Assertions.assertEquals("kdk", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("mjnnawtq", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(608163940967620042L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudServicesNetworkPatchProperties model - = new CloudServicesNetworkPatchProperties() - .withAdditionalEgressEndpoints( - Arrays - .asList( - new EgressEndpoint().withCategory("kdk") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("mjnnawtq").withPort(608163940967620042L), - new EndpointDependency().withDomainName("uckpggqoweyir") - .withPort(4448034441017849158L), - new EndpointDependency().withDomainName("sn").withPort(1508031090383882102L))), - new EgressEndpoint() - .withCategory("qqmpizruwnpqx") - .withEndpoints( - Arrays.asList(new EndpointDependency().withDomainName("iwfcngjsa") - .withPort(9178387738992301365L))), - new EgressEndpoint() - .withCategory("xtmkzjvkviir") - .withEndpoints( - Arrays.asList( - new EndpointDependency() - .withDomainName("fgrwsdpgratzvz") - .withPort(8361909165604899283L), - new EndpointDependency().withDomainName("y").withPort(1669449067749788452L))), - new EgressEndpoint().withCategory("ctbrxkjzwrgxffm") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("kwfbkgo").withPort(1191343314384683416L), - new EndpointDependency().withDomainName("pdbydpizqacln") - .withPort(7563298603289221495L), - new EndpointDependency().withDomainName("iygnugjknfsmfctt") - .withPort(7023136561012386480L), - new EndpointDependency().withDomainName("yilflqoiquvrehmr") - .withPort(9113082198378119154L))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE); - model = BinaryData.fromObject(model).toObject(CloudServicesNetworkPatchProperties.class); - Assertions.assertEquals("kdk", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("mjnnawtq", model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(608163940967620042L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPropertiesTests.java deleted file mode 100644 index cfb777d120f8f..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworkPropertiesTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkProperties; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CloudServicesNetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudServicesNetworkProperties model = BinaryData.fromString( - "{\"additionalEgressEndpoints\":[{\"category\":\"tkftutqxlngx\",\"endpoints\":[{\"domainName\":\"fgugnxkrxdqmid\",\"port\":6800420676916675082},{\"domainName\":\"rvqdra\",\"port\":6644182027847311754}]},{\"category\":\"big\",\"endpoints\":[{\"domainName\":\"oqfbowskanyk\",\"port\":6188020528255703511}]},{\"category\":\"u\",\"endpoints\":[{\"domainName\":\"wgqyw\",\"port\":5201815773094628590}]},{\"category\":\"vynhzgpphrcg\",\"endpoints\":[{\"domainName\":\"cocpecfvmmcoofsx\",\"port\":8420514960019212197}]}],\"associatedResourceIds\":[\"m\"],\"clusterId\":\"qabcypm\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"lzu\",\"enableDefaultEgressEndpoints\":\"True\",\"enabledEgressEndpoints\":[{\"category\":\"nfnbacfionlebxe\",\"endpoints\":[{\"domainName\":\"gtzxdpn\",\"port\":3640331879972668788}]},{\"category\":\"wxrjfeallnwsub\",\"endpoints\":[{\"domainName\":\"njampm\",\"port\":5865872842235747459},{\"domainName\":\"scxaq\",\"port\":5239803510507724565},{\"domainName\":\"hcbonqvpkvlr\",\"port\":4718352678376019294}]}],\"hybridAksClustersAssociatedIds\":[\"eipheoflokeyy\",\"enjbdlwtgrhp\"],\"interfaceName\":\"pj\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"azjpqyegualhbxxh\",\"jj\",\"zvdudgwdslfhotwm\"]}") - .toObject(CloudServicesNetworkProperties.class); - Assertions.assertEquals("tkftutqxlngx", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("fgugnxkrxdqmid", - model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(6800420676916675082L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudServicesNetworkProperties model - = new CloudServicesNetworkProperties() - .withAdditionalEgressEndpoints( - Arrays.asList( - new EgressEndpoint().withCategory("tkftutqxlngx") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("fgugnxkrxdqmid") - .withPort(6800420676916675082L), - new EndpointDependency().withDomainName("rvqdra").withPort(6644182027847311754L))), - new EgressEndpoint().withCategory("big") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("oqfbowskanyk") - .withPort(6188020528255703511L))), - new EgressEndpoint().withCategory("u") - .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("wgqyw").withPort(5201815773094628590L))), - new EgressEndpoint().withCategory("vynhzgpphrcg") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("cocpecfvmmcoofsx") - .withPort(8420514960019212197L))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE); - model = BinaryData.fromObject(model).toObject(CloudServicesNetworkProperties.class); - Assertions.assertEquals("tkftutqxlngx", model.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("fgugnxkrxdqmid", - model.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(6800420676916675082L, - model.additionalEgressEndpoints().get(0).endpoints().get(0).port()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - model.enableDefaultEgressEndpoints()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateMockTests.java deleted file mode 100644 index 2278ae1d4940d..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CloudServicesNetworksCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"mfjhpycvjqdvdwkq\",\"type\":\"ldrlefgnaavua\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"taoutnpdct\",\"endpoints\":[{\"domainName\":\"spfefyihduyeuyld\"},{\"domainName\":\"hmtybkcgsuthhll\"},{\"domainName\":\"mwynefxexlfciatx\"}]},{\"category\":\"jrr\",\"endpoints\":[{\"domainName\":\"mdskjhhxdlajfoxc\"},{\"domainName\":\"scv\"},{\"domainName\":\"lxlhuavkrm\"}]},{\"category\":\"kmyjmkxett\",\"endpoints\":[{\"domainName\":\"lojfkqidnqto\"},{\"domainName\":\"xjhqxcsqhtkb\"},{\"domainName\":\"nqlrng\"}]}],\"associatedResourceIds\":[\"biipsnawwlqkznx\",\"hllxricctkw\",\"uqqoaj\",\"eiyglesrwvaexhdc\"],\"clusterId\":\"ceqnkbrupobehd\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"acvumepj\",\"enableDefaultEgressEndpoints\":\"True\",\"enabledEgressEndpoints\":[{\"category\":\"zpphepif\",\"endpoints\":[{\"domainName\":\"leqirccjclykcgxv\"},{\"domainName\":\"pjlvczuoda\"}]},{\"category\":\"punettepdjxq\",\"endpoints\":[{\"domainName\":\"koynuiylpckae\"},{\"domainName\":\"sedveskwxegqphrg\"},{\"domainName\":\"nzhctmjtsgh\"}]},{\"category\":\"bcbcpz\",\"endpoints\":[{\"domainName\":\"pzeqacdldtz\"},{\"domainName\":\"pypefcpczshnuq\"}]}],\"hybridAksClustersAssociatedIds\":[\"izupfkhu\"],\"interfaceName\":\"uszxh\",\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"egw\",\"iukvzwydwt\",\"haokgkskjiv\"]},\"location\":\"shajqf\",\"tags\":{\"hwu\":\"eexpgeumi\",\"dbzsx\":\"trdexyionofnin\",\"bzbcyksiv\":\"wqqrsmpcbbprtuga\",\"rftsjcwjjxs\":\"fogdrtbfcm\"},\"id\":\"mb\",\"name\":\"wvif\",\"type\":\"xkecifhocj\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CloudServicesNetwork response = manager.cloudServicesNetworks() - .define("kskmqozzkivyhjrl") - .withRegion("tnkjjwgcwnphb") - .withExistingResourceGroup("fajs") - .withExtendedLocation(new ExtendedLocation().withName("izjixlq").withType("hefkwabsolronqq")) - .withTags(mapOf("togmhmjpjscdfpd", "y", "vgwmseharxifvqnr", "wtyg", "nvwjhrsidqpxl", "tmbpjp")) - .withAdditionalEgressEndpoints(Arrays.asList( - new EgressEndpoint().withCategory("lqxsjxtelex") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("uqbo"), - new EndpointDependency().withDomainName("oolzqocarkuzl"))), - new EgressEndpoint().withCategory("cnn") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("snxawqyt"))), - new EgressEndpoint().withCategory("lhdyzmyckzex") - .withEndpoints(Arrays.asList(new EndpointDependency().withDomainName("akckywym"))))) - .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) - .create(); - - Assertions.assertEquals("shajqf", response.location()); - Assertions.assertEquals("eexpgeumi", response.tags().get("hwu")); - Assertions.assertEquals("mfjhpycvjqdvdwkq", response.extendedLocation().name()); - Assertions.assertEquals("ldrlefgnaavua", response.extendedLocation().type()); - Assertions.assertEquals("taoutnpdct", response.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("spfefyihduyeuyld", - response.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - response.enableDefaultEgressEndpoints()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteMockTests.java deleted file mode 100644 index c71ff726ed3f3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 CloudServicesNetworksDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.cloudServicesNetworks().delete("vucnulgmnh", "evdyz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 021dc30cd95fd..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -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 CloudServicesNetworksGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"fynn\",\"type\":\"muii\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"fohyk\",\"endpoints\":[{\"domainName\":\"xbbcbrw\"},{\"domainName\":\"iutgnjizbeewoiy\"},{\"domainName\":\"rvzb\"},{\"domainName\":\"uyrsrziuctix\"}]}],\"associatedResourceIds\":[\"suif\"],\"clusterId\":\"vka\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"kisw\",\"enableDefaultEgressEndpoints\":\"False\",\"enabledEgressEndpoints\":[{\"category\":\"hsyparybjuf\",\"endpoints\":[{\"domainName\":\"bjczjnciuiyqvlda\"},{\"domainName\":\"wvppi\"},{\"domainName\":\"qqzlgcndhz\"}]}],\"hybridAksClustersAssociatedIds\":[\"fcfsrhkhgsnx\"],\"interfaceName\":\"wkpphefsb\",\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"xomeikjclwzacn\",\"wpfsuqtaaz\",\"qbxyxoyfpuqqi\"]},\"location\":\"zxlhdjzqdcadwv\",\"tags\":{\"ybmrzoepnxwd\":\"zjiihjr\",\"xaurs\":\"wnjkgvfn\"},\"id\":\"ftibtyibuyvpirfq\",\"name\":\"pnqn\",\"type\":\"owsbedenrexkxbh\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CloudServicesNetwork response = manager.cloudServicesNetworks() - .getByResourceGroupWithResponse("bdmvrscmqerndbr", "yeofltfnnxrkad", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zxlhdjzqdcadwv", response.location()); - Assertions.assertEquals("zjiihjr", response.tags().get("ybmrzoepnxwd")); - Assertions.assertEquals("fynn", response.extendedLocation().name()); - Assertions.assertEquals("muii", response.extendedLocation().type()); - Assertions.assertEquals("fohyk", response.additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("xbbcbrw", response.additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE, - response.enableDefaultEgressEndpoints()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupMockTests.java deleted file mode 100644 index 2e23e53f0c3b6..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -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 CloudServicesNetworksListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"wdfmmpzhzzwvywr\",\"type\":\"yngydgrpxncaki\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"djrkclamggl\",\"endpoints\":[{\"domainName\":\"mfejdoqeykglty\"}]},{\"category\":\"xhqf\",\"endpoints\":[{\"domainName\":\"ka\"},{\"domainName\":\"ejsxt\"}]},{\"category\":\"gflwfgziiucijj\",\"endpoints\":[{\"domainName\":\"atlijjjr\"},{\"domainName\":\"va\"},{\"domainName\":\"caszk\"},{\"domainName\":\"xk\"}]}],\"associatedResourceIds\":[\"xetyvku\",\"mignohikkg\",\"ogjwpindedvabbxb\",\"medeil\"],\"clusterId\":\"ywfcfxzi\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"hvwyp\",\"enableDefaultEgressEndpoints\":\"True\",\"enabledEgressEndpoints\":[{\"category\":\"slczwciidjsllf\",\"endpoints\":[{\"domainName\":\"vdmvxadqa\"},{\"domainName\":\"frgnawbabgfbktyj\"}]},{\"category\":\"fczlfsyqkfrbzgow\",\"endpoints\":[{\"domainName\":\"qmje\"},{\"domainName\":\"jcx\"},{\"domainName\":\"yqgxhlus\"}]},{\"category\":\"vxisimjcea\",\"endpoints\":[{\"domainName\":\"jqvlsumywz\"},{\"domainName\":\"shxgonoy\"}]}],\"hybridAksClustersAssociatedIds\":[\"ipubyznclkfk\",\"ebgvo\"],\"interfaceName\":\"m\",\"provisioningState\":\"Accepted\",\"virtualMachinesAssociatedIds\":[\"jly\",\"gqa\"]},\"location\":\"igflqqbtnyjp\",\"tags\":{\"s\":\"dbfvabmv\"},\"id\":\"baevwjcnkottl\",\"name\":\"uhvajmailfemjjza\",\"type\":\"zwjiqullq\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.cloudServicesNetworks().listByResourceGroup("tuicds", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("igflqqbtnyjp", response.iterator().next().location()); - Assertions.assertEquals("dbfvabmv", response.iterator().next().tags().get("s")); - Assertions.assertEquals("wdfmmpzhzzwvywr", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("yngydgrpxncaki", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("djrkclamggl", - response.iterator().next().additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("mfejdoqeykglty", - response.iterator().next().additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.TRUE, - response.iterator().next().enableDefaultEgressEndpoints()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListMockTests.java deleted file mode 100644 index fe1c1b50203e1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; -import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; -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 CloudServicesNetworksListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"kk\",\"type\":\"ji\"},\"properties\":{\"additionalEgressEndpoints\":[{\"category\":\"sik\",\"endpoints\":[{\"domainName\":\"bcufqbvntn\"}]}],\"associatedResourceIds\":[\"qsorh\"],\"clusterId\":\"kxgnlykmxcpwzvmd\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"dt\",\"enableDefaultEgressEndpoints\":\"False\",\"enabledEgressEndpoints\":[{\"category\":\"lboncqbazqicqc\",\"endpoints\":[{\"domainName\":\"gtvxbyj\"},{\"domainName\":\"nepubdpkxyqvgx\"},{\"domainName\":\"aodetv\"},{\"domainName\":\"hkxdxuwsaifmc\"}]},{\"category\":\"nosbz\",\"endpoints\":[{\"domainName\":\"hg\"},{\"domainName\":\"vkbcknjolgjyyxp\"},{\"domainName\":\"els\"}]}],\"hybridAksClustersAssociatedIds\":[\"qzevxoqeint\"],\"interfaceName\":\"aljglzobl\",\"provisioningState\":\"Accepted\",\"virtualMachinesAssociatedIds\":[\"r\",\"ulhmzyq\",\"hdvafjrqpjiyrqjc\",\"gaxwmzwdfkbnrzo\"]},\"location\":\"dltb\",\"tags\":{\"xxsaetgz\":\"qjf\",\"uwjoedxnguca\":\"gvpyigdaqqilzdc\",\"gilfjqqacdmkxw\":\"fpaurw\"},\"id\":\"dcvjwc\",\"name\":\"z\",\"type\":\"akeciqchx\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.cloudServicesNetworks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dltb", response.iterator().next().location()); - Assertions.assertEquals("qjf", response.iterator().next().tags().get("xxsaetgz")); - Assertions.assertEquals("kk", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("ji", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("sik", response.iterator().next().additionalEgressEndpoints().get(0).category()); - Assertions.assertEquals("bcufqbvntn", - response.iterator().next().additionalEgressEndpoints().get(0).endpoints().get(0).domainName()); - Assertions.assertEquals(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE, - response.iterator().next().enableDefaultEgressEndpoints()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableUpgradeVersionTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableUpgradeVersionTests.java deleted file mode 100644 index fb7f3f0cf9adb..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableUpgradeVersionTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; - -public final class ClusterAvailableUpgradeVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterAvailableUpgradeVersion model = BinaryData.fromString( - "{\"controlImpact\":\"True\",\"expectedDuration\":\"adm\",\"impactDescription\":\"rcrgvx\",\"supportExpiryDate\":\"gomz\",\"targetClusterVersion\":\"misgwbnb\",\"workloadImpact\":\"False\"}") - .toObject(ClusterAvailableUpgradeVersion.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterAvailableUpgradeVersion model = new ClusterAvailableUpgradeVersion(); - model = BinaryData.fromObject(model).toObject(ClusterAvailableUpgradeVersion.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableVersionTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableVersionTests.java deleted file mode 100644 index 6603e6e5f4a23..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterAvailableVersionTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterAvailableVersion; - -public final class ClusterAvailableVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterAvailableVersion model = BinaryData - .fromString("{\"supportExpiryDate\":\"kphywpnvjto\",\"targetClusterVersion\":\"ermclfplphoxuscr\"}") - .toObject(ClusterAvailableVersion.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterAvailableVersion model = new ClusterAvailableVersion(); - model = BinaryData.fromObject(model).toObject(ClusterAvailableVersion.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterCapacityTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterCapacityTests.java deleted file mode 100644 index 6856271bcb92c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterCapacityTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; -import org.junit.jupiter.api.Assertions; - -public final class ClusterCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterCapacity model = BinaryData.fromString( - "{\"availableApplianceStorageGB\":4044935358945575768,\"availableCoreCount\":2385195845357196318,\"availableHostStorageGB\":301155517903615814,\"availableMemoryGB\":7620134053919879993,\"totalApplianceStorageGB\":2439882291490736803,\"totalCoreCount\":1682807835593925008,\"totalHostStorageGB\":142732787655569529,\"totalMemoryGB\":3428999521390307360}") - .toObject(ClusterCapacity.class); - Assertions.assertEquals(4044935358945575768L, model.availableApplianceStorageGB()); - Assertions.assertEquals(2385195845357196318L, model.availableCoreCount()); - Assertions.assertEquals(301155517903615814L, model.availableHostStorageGB()); - Assertions.assertEquals(7620134053919879993L, model.availableMemoryGB()); - Assertions.assertEquals(2439882291490736803L, model.totalApplianceStorageGB()); - Assertions.assertEquals(1682807835593925008L, model.totalCoreCount()); - Assertions.assertEquals(142732787655569529L, model.totalHostStorageGB()); - Assertions.assertEquals(3428999521390307360L, model.totalMemoryGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterCapacity model = new ClusterCapacity().withAvailableApplianceStorageGB(4044935358945575768L) - .withAvailableCoreCount(2385195845357196318L) - .withAvailableHostStorageGB(301155517903615814L) - .withAvailableMemoryGB(7620134053919879993L) - .withTotalApplianceStorageGB(2439882291490736803L) - .withTotalCoreCount(1682807835593925008L) - .withTotalHostStorageGB(142732787655569529L) - .withTotalMemoryGB(3428999521390307360L); - model = BinaryData.fromObject(model).toObject(ClusterCapacity.class); - Assertions.assertEquals(4044935358945575768L, model.availableApplianceStorageGB()); - Assertions.assertEquals(2385195845357196318L, model.availableCoreCount()); - Assertions.assertEquals(301155517903615814L, model.availableHostStorageGB()); - Assertions.assertEquals(7620134053919879993L, model.availableMemoryGB()); - Assertions.assertEquals(2439882291490736803L, model.totalApplianceStorageGB()); - Assertions.assertEquals(1682807835593925008L, model.totalCoreCount()); - Assertions.assertEquals(142732787655569529L, model.totalHostStorageGB()); - Assertions.assertEquals(3428999521390307360L, model.totalMemoryGB()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterDeployParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterDeployParametersTests.java deleted file mode 100644 index 37b958d214aa6..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterDeployParametersTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterDeployParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterDeployParameters model - = BinaryData.fromString("{\"skipValidationsForMachines\":[\"wpusxjbaqehg\",\"dohzjq\"]}") - .toObject(ClusterDeployParameters.class); - Assertions.assertEquals("wpusxjbaqehg", model.skipValidationsForMachines().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterDeployParameters model - = new ClusterDeployParameters().withSkipValidationsForMachines(Arrays.asList("wpusxjbaqehg", "dohzjq")); - model = BinaryData.fromObject(model).toObject(ClusterDeployParameters.class); - Assertions.assertEquals("wpusxjbaqehg", model.skipValidationsForMachines().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerInnerTests.java deleted file mode 100644 index ef3edbaf5221f..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerInnerTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; -import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterManagerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterManagerInner model = BinaryData.fromString( - "{\"properties\":{\"analyticsWorkspaceId\":\"bxzpuzycisp\",\"availabilityZones\":[\"ahmgkbrp\",\"y\",\"hibnuqqkpika\",\"rgvtqag\"],\"clusterVersions\":[{\"supportExpiryDate\":\"nhijggmebfsi\",\"targetClusterVersion\":\"butr\"},{\"supportExpiryDate\":\"pnazzm\",\"targetClusterVersion\":\"runmp\"}],\"detailedStatus\":\"UpdateFailed\",\"detailedStatusMessage\":\"bh\",\"fabricControllerId\":\"bnlankxmyskpb\",\"managedResourceGroupConfiguration\":{\"location\":\"btkcxywnytnrsyn\",\"name\":\"idybyxczf\"},\"managerExtendedLocation\":{\"name\":\"haaxdbabphl\",\"type\":\"rqlfktsthsucocmn\"},\"provisioningState\":\"Canceled\",\"vmSize\":\"t\"},\"location\":\"twwrqp\",\"tags\":{\"xibxujwbhqwalm\":\"ckzywbiexzfeyue\",\"ux\":\"zyoxaepdkzjan\",\"zt\":\"hdwbavxbniwdjs\"},\"id\":\"dbpgnxytxhp\",\"name\":\"xbzpfzab\",\"type\":\"lcuhxwtctyqiklb\"}") - .toObject(ClusterManagerInner.class); - Assertions.assertEquals("twwrqp", model.location()); - Assertions.assertEquals("ckzywbiexzfeyue", model.tags().get("xibxujwbhqwalm")); - Assertions.assertEquals("bxzpuzycisp", model.analyticsWorkspaceId()); - Assertions.assertEquals("ahmgkbrp", model.availabilityZones().get(0)); - Assertions.assertEquals("bnlankxmyskpb", model.fabricControllerId()); - Assertions.assertEquals("btkcxywnytnrsyn", model.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("idybyxczf", model.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("t", model.vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterManagerInner model = new ClusterManagerInner().withLocation("twwrqp") - .withTags(mapOf("xibxujwbhqwalm", "ckzywbiexzfeyue", "ux", "zyoxaepdkzjan", "zt", "hdwbavxbniwdjs")) - .withAnalyticsWorkspaceId("bxzpuzycisp") - .withAvailabilityZones(Arrays.asList("ahmgkbrp", "y", "hibnuqqkpika", "rgvtqag")) - .withFabricControllerId("bnlankxmyskpb") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("btkcxywnytnrsyn").withName("idybyxczf")) - .withVmSize("t"); - model = BinaryData.fromObject(model).toObject(ClusterManagerInner.class); - Assertions.assertEquals("twwrqp", model.location()); - Assertions.assertEquals("ckzywbiexzfeyue", model.tags().get("xibxujwbhqwalm")); - Assertions.assertEquals("bxzpuzycisp", model.analyticsWorkspaceId()); - Assertions.assertEquals("ahmgkbrp", model.availabilityZones().get(0)); - Assertions.assertEquals("bnlankxmyskpb", model.fabricControllerId()); - Assertions.assertEquals("btkcxywnytnrsyn", model.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("idybyxczf", model.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("t", model.vmSize()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerListTests.java deleted file mode 100644 index 2811838823f25..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerListTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; -import com.azure.resourcemanager.networkcloud.models.ClusterManagerList; -import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterManagerListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterManagerList model = BinaryData.fromString( - "{\"nextLink\":\"ugw\",\"value\":[{\"properties\":{\"analyticsWorkspaceId\":\"lhslazjdyggdtj\",\"availabilityZones\":[\"b\",\"uofqwe\",\"kh\"],\"clusterVersions\":[{\"supportExpiryDate\":\"vfyexfw\",\"targetClusterVersion\":\"bcibvyvdcsitynn\"}],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ectehf\",\"fabricControllerId\":\"qsc\",\"managedResourceGroupConfiguration\":{\"location\":\"pvhez\",\"name\":\"gqhcjrefovg\"},\"managerExtendedLocation\":{\"name\":\"qsl\",\"type\":\"yyvxyqjpkcattpn\"},\"provisioningState\":\"Failed\",\"vmSize\":\"cczsq\"},\"location\":\"hvmdajvnysounq\",\"tags\":{\"pfhyhl\":\"noae\"},\"id\":\"rpmopjmc\",\"name\":\"atuokthfuiu\",\"type\":\"odsfcpkvxodpuozm\"},{\"properties\":{\"analyticsWorkspaceId\":\"ydagfuaxbe\",\"availabilityZones\":[\"uokktwhrdxwz\"],\"clusterVersions\":[{\"supportExpiryDate\":\"mbsureximo\",\"targetClusterVersion\":\"ocfs\"}],\"detailedStatus\":\"Updating\",\"detailedStatusMessage\":\"mddystkiiux\",\"fabricControllerId\":\"qyud\",\"managedResourceGroupConfiguration\":{\"location\":\"rq\",\"name\":\"poczvyifqrvkdvjs\"},\"managerExtendedLocation\":{\"name\":\"rm\",\"type\":\"vdfwatkpn\"},\"provisioningState\":\"Succeeded\",\"vmSize\":\"xxbczwtr\"},\"location\":\"iqzbq\",\"tags\":{\"okacspk\":\"ovm\",\"jmflbvvnch\":\"lhzdobp\",\"ajiwkuo\":\"kcciwwzjuqkhr\",\"sauuimj\":\"oskg\"},\"id\":\"vxieduugidyj\",\"name\":\"rfbyaosvexcso\",\"type\":\"pclhocohslk\"},{\"properties\":{\"analyticsWorkspaceId\":\"leggzfbu\",\"availabilityZones\":[\"vfaxkffeiith\",\"vmezy\",\"shxmzsbbzoggigrx\",\"burvjxxjnspy\"],\"clusterVersions\":[{\"supportExpiryDate\":\"oenkouknvudwti\",\"targetClusterVersion\":\"bldngkpoc\"}],\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"yxoegukgjnp\",\"fabricControllerId\":\"ucgygevqz\",\"managedResourceGroupConfiguration\":{\"location\":\"pmr\",\"name\":\"izcdrqjsd\"},\"managerExtendedLocation\":{\"name\":\"dnfyhxdeoejzicwi\",\"type\":\"sjttgzfbish\"},\"provisioningState\":\"Failed\",\"vmSize\":\"ajdeyeamdphaga\"},\"location\":\"buxwgip\",\"tags\":{\"nkixzbinj\":\"nowkgshw\",\"tmryw\":\"pu\"},\"id\":\"uzoqft\",\"name\":\"yqzrnkcqvyxlw\",\"type\":\"zlsico\"},{\"properties\":{\"analyticsWorkspaceId\":\"qqn\",\"availabilityZones\":[\"ryavwhheunmmqh\",\"yxzk\"],\"clusterVersions\":[{\"supportExpiryDate\":\"uko\",\"targetClusterVersion\":\"yaxuconuqszfkb\"},{\"supportExpiryDate\":\"pewr\",\"targetClusterVersion\":\"mwvvjektcxsenhw\"},{\"supportExpiryDate\":\"s\",\"targetClusterVersion\":\"rzpwvlqdqgbiq\"}],\"detailedStatus\":\"UpdateFailed\",\"detailedStatusMessage\":\"kaet\",\"fabricControllerId\":\"kt\",\"managedResourceGroupConfiguration\":{\"location\":\"ivfsnk\",\"name\":\"uctqhjfbe\"},\"managerExtendedLocation\":{\"name\":\"jcxerfuwu\",\"type\":\"ttxfvjr\"},\"provisioningState\":\"Accepted\",\"vmSize\":\"hxepcyvahfnlj\"},\"location\":\"qxj\",\"tags\":{\"gidokgjljyoxgvcl\":\"j\",\"jhtxfvgxbfsmxne\":\"bgsncghkjeszzhb\"},\"id\":\"mpvecxgodebfqk\",\"name\":\"rbmpukgri\",\"type\":\"flz\"}]}") - .toObject(ClusterManagerList.class); - Assertions.assertEquals("ugw", model.nextLink()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).location()); - Assertions.assertEquals("noae", model.value().get(0).tags().get("pfhyhl")); - Assertions.assertEquals("lhslazjdyggdtj", model.value().get(0).analyticsWorkspaceId()); - Assertions.assertEquals("b", model.value().get(0).availabilityZones().get(0)); - Assertions.assertEquals("qsc", model.value().get(0).fabricControllerId()); - Assertions.assertEquals("pvhez", model.value().get(0).managedResourceGroupConfiguration().location()); - Assertions.assertEquals("gqhcjrefovg", model.value().get(0).managedResourceGroupConfiguration().name()); - Assertions.assertEquals("cczsq", model.value().get(0).vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterManagerList model = new ClusterManagerList().withNextLink("ugw") - .withValue(Arrays.asList( - new ClusterManagerInner().withLocation("hvmdajvnysounq") - .withTags(mapOf("pfhyhl", "noae")) - .withAnalyticsWorkspaceId("lhslazjdyggdtj") - .withAvailabilityZones(Arrays.asList("b", "uofqwe", "kh")) - .withFabricControllerId("qsc") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("pvhez").withName("gqhcjrefovg")) - .withVmSize("cczsq"), - new ClusterManagerInner().withLocation("iqzbq") - .withTags( - mapOf("okacspk", "ovm", "jmflbvvnch", "lhzdobp", "ajiwkuo", "kcciwwzjuqkhr", "sauuimj", "oskg")) - .withAnalyticsWorkspaceId("ydagfuaxbe") - .withAvailabilityZones(Arrays.asList("uokktwhrdxwz")) - .withFabricControllerId("qyud") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("rq").withName("poczvyifqrvkdvjs")) - .withVmSize("xxbczwtr"), - new ClusterManagerInner().withLocation("buxwgip") - .withTags(mapOf("nkixzbinj", "nowkgshw", "tmryw", "pu")) - .withAnalyticsWorkspaceId("leggzfbu") - .withAvailabilityZones(Arrays.asList("vfaxkffeiith", "vmezy", "shxmzsbbzoggigrx", "burvjxxjnspy")) - .withFabricControllerId("ucgygevqz") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("pmr").withName("izcdrqjsd")) - .withVmSize("ajdeyeamdphaga"), - new ClusterManagerInner().withLocation("qxj") - .withTags(mapOf("gidokgjljyoxgvcl", "j", "jhtxfvgxbfsmxne", "bgsncghkjeszzhb")) - .withAnalyticsWorkspaceId("qqn") - .withAvailabilityZones(Arrays.asList("ryavwhheunmmqh", "yxzk")) - .withFabricControllerId("kt") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("ivfsnk").withName("uctqhjfbe")) - .withVmSize("hxepcyvahfnlj"))); - model = BinaryData.fromObject(model).toObject(ClusterManagerList.class); - Assertions.assertEquals("ugw", model.nextLink()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).location()); - Assertions.assertEquals("noae", model.value().get(0).tags().get("pfhyhl")); - Assertions.assertEquals("lhslazjdyggdtj", model.value().get(0).analyticsWorkspaceId()); - Assertions.assertEquals("b", model.value().get(0).availabilityZones().get(0)); - Assertions.assertEquals("qsc", model.value().get(0).fabricControllerId()); - Assertions.assertEquals("pvhez", model.value().get(0).managedResourceGroupConfiguration().location()); - Assertions.assertEquals("gqhcjrefovg", model.value().get(0).managedResourceGroupConfiguration().name()); - Assertions.assertEquals("cczsq", model.value().get(0).vmSize()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPatchParametersTests.java deleted file mode 100644 index cf72081be4a27..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPatchParametersTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterManagerPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterManagerPatchParameters model = BinaryData - .fromString("{\"tags\":{\"uunfprnjletlxsm\":\"tczytqjtwh\",\"nlqwzdvpiwhx\":\"pddouifamowaziyn\"}}") - .toObject(ClusterManagerPatchParameters.class); - Assertions.assertEquals("tczytqjtwh", model.tags().get("uunfprnjletlxsm")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterManagerPatchParameters model = new ClusterManagerPatchParameters() - .withTags(mapOf("uunfprnjletlxsm", "tczytqjtwh", "nlqwzdvpiwhx", "pddouifamowaziyn")); - model = BinaryData.fromObject(model).toObject(ClusterManagerPatchParameters.class); - Assertions.assertEquals("tczytqjtwh", model.tags().get("uunfprnjletlxsm")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPropertiesTests.java deleted file mode 100644 index e3efe10b23407..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagerPropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerProperties; -import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterManagerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterManagerProperties model = BinaryData.fromString( - "{\"analyticsWorkspaceId\":\"vplwzbhv\",\"availabilityZones\":[\"gu\"],\"clusterVersions\":[{\"supportExpiryDate\":\"kfssxqukkf\",\"targetClusterVersion\":\"gmgsxnkjzkde\"},{\"supportExpiryDate\":\"pvlopwiyighxpkd\",\"targetClusterVersion\":\"baiuebbaumny\"},{\"supportExpiryDate\":\"ped\",\"targetClusterVersion\":\"jn\"}],\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"hsmtxpsiebtfhvp\",\"fabricControllerId\":\"sapskr\",\"managedResourceGroupConfiguration\":{\"location\":\"hjjdhtldwkyzxuut\",\"name\":\"cwscwsvlx\"},\"managerExtendedLocation\":{\"name\":\"ogtwrupqsxvnmi\",\"type\":\"ykvceoveil\"},\"provisioningState\":\"Failed\",\"vmSize\":\"tyfjfcnjbkcnxdhb\"}") - .toObject(ClusterManagerProperties.class); - Assertions.assertEquals("vplwzbhv", model.analyticsWorkspaceId()); - Assertions.assertEquals("gu", model.availabilityZones().get(0)); - Assertions.assertEquals("sapskr", model.fabricControllerId()); - Assertions.assertEquals("hjjdhtldwkyzxuut", model.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("cwscwsvlx", model.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterManagerProperties model = new ClusterManagerProperties().withAnalyticsWorkspaceId("vplwzbhv") - .withAvailabilityZones(Arrays.asList("gu")) - .withFabricControllerId("sapskr") - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("hjjdhtldwkyzxuut").withName("cwscwsvlx")) - .withVmSize("tyfjfcnjbkcnxdhb"); - model = BinaryData.fromObject(model).toObject(ClusterManagerProperties.class); - Assertions.assertEquals("vplwzbhv", model.analyticsWorkspaceId()); - Assertions.assertEquals("gu", model.availabilityZones().get(0)); - Assertions.assertEquals("sapskr", model.fabricControllerId()); - Assertions.assertEquals("hjjdhtldwkyzxuut", model.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("cwscwsvlx", model.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.vmSize()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateMockTests.java deleted file mode 100644 index 08d3863098077..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateMockTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterManager; -import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterManagersCreateOrUpdateMockTests { - @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\":{\"analyticsWorkspaceId\":\"ravaq\",\"availabilityZones\":[\"kbeba\",\"zlqbtxxwpfhn\",\"zudrtpzk\"],\"clusterVersions\":[{\"supportExpiryDate\":\"oywhczzqrhmngqbe\",\"targetClusterVersion\":\"gis\"},{\"supportExpiryDate\":\"wnykdidjchlrmpw\",\"targetClusterVersion\":\"ofldseacdhz\"},{\"supportExpiryDate\":\"kbrfgdrwji\",\"targetClusterVersion\":\"whfjsrwqrxe\"},{\"supportExpiryDate\":\"gcwvrrmdqntycna\",\"targetClusterVersion\":\"hvmaxgnuyeamcmhu\"}],\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"cehokw\",\"fabricControllerId\":\"pqtwloesqrggvrb\",\"managedResourceGroupConfiguration\":{\"location\":\"ukoila\",\"name\":\"duwjleipjlhwy\"},\"managerExtendedLocation\":{\"name\":\"zr\",\"type\":\"z\"},\"provisioningState\":\"Succeeded\",\"vmSize\":\"kkwhbgxvellvulnx\"},\"location\":\"nitmujdtvmclyymf\",\"tags\":{\"xfzuvrzmzqmzj\":\"jpddn\",\"pv\":\"rb\",\"pglaoh\":\"mdyfoebojtj\"},\"id\":\"qk\",\"name\":\"jtnqjil\",\"type\":\"ywkdcwmqsy\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterManager response = manager.clusterManagers() - .define("wwa") - .withRegion("dlh") - .withExistingResourceGroup("wmwwmjswen") - .withFabricControllerId("sjt") - .withTags(mapOf("nytjlk", "bdbfgrlp", "h", "smmpathubt")) - .withAnalyticsWorkspaceId("cleqioulndhzyo") - .withAvailabilityZones(Arrays.asList("ht", "llhsvidmyt")) - .withManagedResourceGroupConfiguration( - new ManagedResourceGroupConfiguration().withLocation("bninjgazlsvbzfc").withName("o")) - .withVmSize("lriyehqbe") - .create(); - - Assertions.assertEquals("nitmujdtvmclyymf", response.location()); - Assertions.assertEquals("jpddn", response.tags().get("xfzuvrzmzqmzj")); - Assertions.assertEquals("ravaq", response.analyticsWorkspaceId()); - Assertions.assertEquals("kbeba", response.availabilityZones().get(0)); - Assertions.assertEquals("pqtwloesqrggvrb", response.fabricControllerId()); - Assertions.assertEquals("ukoila", response.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("duwjleipjlhwy", response.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("kkwhbgxvellvulnx", response.vmSize()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteMockTests.java deleted file mode 100644 index 0c6616f8f28ca..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 ClusterManagersDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusterManagers().delete("jhffbxrqrkij", "euqlsdxeqztv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index d0e07eab2ec3a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterManager; -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 ClusterManagersGetByResourceGroupWithResponseMockTests { - @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\":{\"analyticsWorkspaceId\":\"abhjx\",\"availabilityZones\":[\"weuipmpvksmi\",\"nsqxtltc\"],\"clusterVersions\":[{\"supportExpiryDate\":\"pqgfhyrfr\",\"targetClusterVersion\":\"kldgrcwfcmfc\"},{\"supportExpiryDate\":\"jajqmatxjt\",\"targetClusterVersion\":\"ln\"}],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"xgfb\",\"fabricControllerId\":\"mtlpqagyno\",\"managedResourceGroupConfiguration\":{\"location\":\"n\",\"name\":\"ali\"},\"managerExtendedLocation\":{\"name\":\"ryqxzxa\",\"type\":\"zi\"},\"provisioningState\":\"Canceled\",\"vmSize\":\"miymqruqguhfupet\"},\"location\":\"vvoqsbpkf\",\"tags\":{\"syaowuzowp\":\"fkg\",\"ztiochluti\":\"ohdkcprgukx\",\"izcbfzmcrunfhiuc\":\"mqrud\",\"u\":\"mfbcpaqktkrum\"},\"id\":\"dkyzbfvxov\",\"name\":\"kxiuxqggvqr\",\"type\":\"hyhlwcjsqg\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterManager response = manager.clusterManagers() - .getByResourceGroupWithResponse("vym", "nudn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vvoqsbpkf", response.location()); - Assertions.assertEquals("fkg", response.tags().get("syaowuzowp")); - Assertions.assertEquals("abhjx", response.analyticsWorkspaceId()); - Assertions.assertEquals("weuipmpvksmi", response.availabilityZones().get(0)); - Assertions.assertEquals("mtlpqagyno", response.fabricControllerId()); - Assertions.assertEquals("n", response.managedResourceGroupConfiguration().location()); - Assertions.assertEquals("ali", response.managedResourceGroupConfiguration().name()); - Assertions.assertEquals("miymqruqguhfupet", response.vmSize()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupMockTests.java deleted file mode 100644 index 6d22335ff0fc4..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterManager; -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 ClusterManagersListByResourceGroupMockTests { - @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\":{\"analyticsWorkspaceId\":\"qreblui\",\"availabilityZones\":[\"wxs\",\"gtdmbvx\",\"kraokq\"],\"clusterVersions\":[{\"supportExpiryDate\":\"btwa\",\"targetClusterVersion\":\"bavly\"}],\"detailedStatus\":\"ProvisioningFailed\",\"detailedStatusMessage\":\"knwfrkebsmhpdujd\",\"fabricControllerId\":\"gatolekscbctnan\",\"managedResourceGroupConfiguration\":{\"location\":\"wbzxpdcldpkawn\",\"name\":\"laimouxwk\"},\"managerExtendedLocation\":{\"name\":\"mud\",\"type\":\"fco\"},\"provisioningState\":\"Provisioning\",\"vmSize\":\"ziuswsw\"},\"location\":\"kbqsjhbtqqvyfscy\",\"tags\":{\"wvbhlimbyq\":\"bivqvogfuy\",\"ikcdrdaasax\":\"crood\",\"wiyjvzuko\":\"obsmf\",\"awn\":\"r\"},\"id\":\"zm\",\"name\":\"n\",\"type\":\"oywsxvjabjqqaxu\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.clusterManagers().listByResourceGroup("mqbmfuvqarwz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kbqsjhbtqqvyfscy", response.iterator().next().location()); - Assertions.assertEquals("bivqvogfuy", response.iterator().next().tags().get("wvbhlimbyq")); - Assertions.assertEquals("qreblui", response.iterator().next().analyticsWorkspaceId()); - Assertions.assertEquals("wxs", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals("gatolekscbctnan", response.iterator().next().fabricControllerId()); - Assertions.assertEquals("wbzxpdcldpkawn", - response.iterator().next().managedResourceGroupConfiguration().location()); - Assertions.assertEquals("laimouxwk", response.iterator().next().managedResourceGroupConfiguration().name()); - Assertions.assertEquals("ziuswsw", response.iterator().next().vmSize()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListMockTests.java deleted file mode 100644 index 993b8cb6c08a7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterManager; -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 ClusterManagersListMockTests { - @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\":{\"analyticsWorkspaceId\":\"kl\",\"availabilityZones\":[\"rvtxvcmufunlc\",\"xxvir\"],\"clusterVersions\":[{\"supportExpiryDate\":\"gjgvr\",\"targetClusterVersion\":\"vpygglp\"},{\"supportExpiryDate\":\"rdcueljtiahx\",\"targetClusterVersion\":\"q\"},{\"supportExpiryDate\":\"arvsx\",\"targetClusterVersion\":\"bglcjkayspthzodu\"},{\"supportExpiryDate\":\"lmjtg\",\"targetClusterVersion\":\"ioskkfmkmfdjxyxg\"}],\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"vjcteoedlrslsk\",\"fabricControllerId\":\"zpxvjnzdpvoc\",\"managedResourceGroupConfiguration\":{\"location\":\"pcnab\",\"name\":\"fsnggytexvzilm\"},\"managerExtendedLocation\":{\"name\":\"vzkwwwncknr\",\"type\":\"dajlskzpt\"},\"provisioningState\":\"Provisioning\",\"vmSize\":\"weucyrth\"},\"location\":\"lehmcgcjeinueho\",\"tags\":{\"zfivfokpysthhzag\":\"vfejvqnttmbqda\",\"rlhgenuze\":\"fwy\",\"zlsmmdqgmihzpim\":\"gvkvebaqszll\",\"gxsvtza\":\"qrhnxtminkl\"},\"id\":\"hzvqnsqktcmbjwz\",\"name\":\"oslpky\",\"type\":\"tglwkzpgajsqjc\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.clusterManagers().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lehmcgcjeinueho", response.iterator().next().location()); - Assertions.assertEquals("vfejvqnttmbqda", response.iterator().next().tags().get("zfivfokpysthhzag")); - Assertions.assertEquals("kl", response.iterator().next().analyticsWorkspaceId()); - Assertions.assertEquals("rvtxvcmufunlc", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals("zpxvjnzdpvoc", response.iterator().next().fabricControllerId()); - Assertions.assertEquals("pcnab", response.iterator().next().managedResourceGroupConfiguration().location()); - Assertions.assertEquals("fsnggytexvzilm", - response.iterator().next().managedResourceGroupConfiguration().name()); - Assertions.assertEquals("weucyrth", response.iterator().next().vmSize()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationInnerTests.java deleted file mode 100644 index 4ae3230d9c71c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMetricsConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMetricsConfigurationInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"fcsserxhtvsox\",\"type\":\"lwntsjgqrs\"},\"properties\":{\"collectionInterval\":994604483308032293,\"detailedStatus\":\"Processing\",\"detailedStatusMessage\":\"u\",\"disabledMetrics\":[\"chrszi\",\"oyuelyetn\",\"nb\"],\"enabledMetrics\":[\"ggagfln\",\"gm\",\"rwahzjmucftbyr\"],\"provisioningState\":\"Accepted\"},\"location\":\"hkpigqfusuckzmkw\",\"tags\":{\"hjnhgwydyynfsvk\":\"noxaxmqeqal\",\"ta\":\"gbv\",\"jcpeogkhnmg\":\"arfdlpukhpyrnei\"},\"id\":\"ro\",\"name\":\"xddbhfhpfpaz\",\"type\":\"zoyw\"}") - .toObject(ClusterMetricsConfigurationInner.class); - Assertions.assertEquals("hkpigqfusuckzmkw", model.location()); - Assertions.assertEquals("noxaxmqeqal", model.tags().get("hjnhgwydyynfsvk")); - Assertions.assertEquals("fcsserxhtvsox", model.extendedLocation().name()); - Assertions.assertEquals("lwntsjgqrs", model.extendedLocation().type()); - Assertions.assertEquals(994604483308032293L, model.collectionInterval()); - Assertions.assertEquals("ggagfln", model.enabledMetrics().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMetricsConfigurationInner model = new ClusterMetricsConfigurationInner().withLocation("hkpigqfusuckzmkw") - .withTags(mapOf("hjnhgwydyynfsvk", "noxaxmqeqal", "ta", "gbv", "jcpeogkhnmg", "arfdlpukhpyrnei")) - .withExtendedLocation(new ExtendedLocation().withName("fcsserxhtvsox").withType("lwntsjgqrs")) - .withCollectionInterval(994604483308032293L) - .withEnabledMetrics(Arrays.asList("ggagfln", "gm", "rwahzjmucftbyr")); - model = BinaryData.fromObject(model).toObject(ClusterMetricsConfigurationInner.class); - Assertions.assertEquals("hkpigqfusuckzmkw", model.location()); - Assertions.assertEquals("noxaxmqeqal", model.tags().get("hjnhgwydyynfsvk")); - Assertions.assertEquals("fcsserxhtvsox", model.extendedLocation().name()); - Assertions.assertEquals("lwntsjgqrs", model.extendedLocation().type()); - Assertions.assertEquals(994604483308032293L, model.collectionInterval()); - Assertions.assertEquals("ggagfln", model.enabledMetrics().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationListTests.java deleted file mode 100644 index a03c4e789dc48..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationListTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; -import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationList; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMetricsConfigurationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMetricsConfigurationList model = BinaryData.fromString( - "{\"nextLink\":\"ucoig\",\"value\":[{\"extendedLocation\":{\"name\":\"ncnwfepbnwgf\",\"type\":\"xjg\"},\"properties\":{\"collectionInterval\":418211033576127424,\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"dlfgtdysnaq\",\"disabledMetrics\":[\"qbctqha\",\"zjrwdkqze\",\"yjleziunjx\",\"fza\"],\"enabledMetrics\":[\"wcegyamlbn\",\"eqacjjvpilguooq\",\"agmdit\"],\"provisioningState\":\"Failed\"},\"location\":\"ookjbsahrtdtpde\",\"tags\":{\"vcjkgd\":\"cslmotoebnfxo\"},\"id\":\"razftxejwabmdujt\",\"name\":\"vcopex\",\"type\":\"m\"},{\"extendedLocation\":{\"name\":\"urbuhhlkyqltq\",\"type\":\"rogtuwkf\"},\"properties\":{\"collectionInterval\":3058507501034191823,\"detailedStatus\":\"Processing\",\"detailedStatusMessage\":\"ysidfvclgl\",\"disabledMetrics\":[\"uijtkbu\",\"qogsfikayian\",\"haru\"],\"enabledMetrics\":[\"iqxf\"],\"provisioningState\":\"Canceled\"},\"location\":\"ttvwkpqh\",\"tags\":{\"cdlguauc\":\"nuygbqeqqekewvnq\",\"jwnlax\":\"f\"},\"id\":\"un\",\"name\":\"qikczvvita\",\"type\":\"gx\"}]}") - .toObject(ClusterMetricsConfigurationList.class); - Assertions.assertEquals("ucoig", model.nextLink()); - Assertions.assertEquals("ookjbsahrtdtpde", model.value().get(0).location()); - Assertions.assertEquals("cslmotoebnfxo", model.value().get(0).tags().get("vcjkgd")); - Assertions.assertEquals("ncnwfepbnwgf", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("xjg", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(418211033576127424L, model.value().get(0).collectionInterval()); - Assertions.assertEquals("wcegyamlbn", model.value().get(0).enabledMetrics().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMetricsConfigurationList model = new ClusterMetricsConfigurationList().withNextLink("ucoig") - .withValue(Arrays.asList( - new ClusterMetricsConfigurationInner().withLocation("ookjbsahrtdtpde") - .withTags(mapOf("vcjkgd", "cslmotoebnfxo")) - .withExtendedLocation(new ExtendedLocation().withName("ncnwfepbnwgf").withType("xjg")) - .withCollectionInterval(418211033576127424L) - .withEnabledMetrics(Arrays.asList("wcegyamlbn", "eqacjjvpilguooq", "agmdit")), - new ClusterMetricsConfigurationInner().withLocation("ttvwkpqh") - .withTags(mapOf("cdlguauc", "nuygbqeqqekewvnq", "jwnlax", "f")) - .withExtendedLocation(new ExtendedLocation().withName("urbuhhlkyqltq").withType("rogtuwkf")) - .withCollectionInterval(3058507501034191823L) - .withEnabledMetrics(Arrays.asList("iqxf")))); - model = BinaryData.fromObject(model).toObject(ClusterMetricsConfigurationList.class); - Assertions.assertEquals("ucoig", model.nextLink()); - Assertions.assertEquals("ookjbsahrtdtpde", model.value().get(0).location()); - Assertions.assertEquals("cslmotoebnfxo", model.value().get(0).tags().get("vcjkgd")); - Assertions.assertEquals("ncnwfepbnwgf", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("xjg", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(418211033576127424L, model.value().get(0).collectionInterval()); - Assertions.assertEquals("wcegyamlbn", model.value().get(0).enabledMetrics().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchParametersTests.java deleted file mode 100644 index deb5fa80e4bb9..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchParametersTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMetricsConfigurationPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMetricsConfigurationPatchParameters model = BinaryData.fromString( - "{\"properties\":{\"collectionInterval\":1068870497872313988,\"enabledMetrics\":[\"khminqcymc\",\"ngnbdxxew\",\"ninvudbchaqdt\",\"qecrqctmxx\"]},\"tags\":{\"vtzn\":\"dmflhuytx\"}}") - .toObject(ClusterMetricsConfigurationPatchParameters.class); - Assertions.assertEquals("dmflhuytx", model.tags().get("vtzn")); - Assertions.assertEquals(1068870497872313988L, model.collectionInterval()); - Assertions.assertEquals("khminqcymc", model.enabledMetrics().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMetricsConfigurationPatchParameters model - = new ClusterMetricsConfigurationPatchParameters().withTags(mapOf("vtzn", "dmflhuytx")) - .withCollectionInterval(1068870497872313988L) - .withEnabledMetrics(Arrays.asList("khminqcymc", "ngnbdxxew", "ninvudbchaqdt", "qecrqctmxx")); - model = BinaryData.fromObject(model).toObject(ClusterMetricsConfigurationPatchParameters.class); - Assertions.assertEquals("dmflhuytx", model.tags().get("vtzn")); - Assertions.assertEquals(1068870497872313988L, model.collectionInterval()); - Assertions.assertEquals("khminqcymc", model.enabledMetrics().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchPropertiesTests.java deleted file mode 100644 index 21e6389972f6b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPatchPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationPatchProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMetricsConfigurationPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMetricsConfigurationPatchProperties model - = BinaryData.fromString("{\"collectionInterval\":2719232038874536718,\"enabledMetrics\":[\"novv\",\"xc\"]}") - .toObject(ClusterMetricsConfigurationPatchProperties.class); - Assertions.assertEquals(2719232038874536718L, model.collectionInterval()); - Assertions.assertEquals("novv", model.enabledMetrics().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMetricsConfigurationPatchProperties model - = new ClusterMetricsConfigurationPatchProperties().withCollectionInterval(2719232038874536718L) - .withEnabledMetrics(Arrays.asList("novv", "xc")); - model = BinaryData.fromObject(model).toObject(ClusterMetricsConfigurationPatchProperties.class); - Assertions.assertEquals(2719232038874536718L, model.collectionInterval()); - Assertions.assertEquals("novv", model.enabledMetrics().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPropertiesTests.java deleted file mode 100644 index cd1f02e9d1179..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterMetricsConfigurationPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMetricsConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMetricsConfigurationProperties model = BinaryData.fromString( - "{\"collectionInterval\":8246168361887444991,\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"lontacnpq\",\"disabledMetrics\":[\"htuevrhrljy\",\"ogwxhnsduugwb\",\"reur\"],\"enabledMetrics\":[\"fuarenlvhht\",\"lnvnafvvkyfedev\",\"bo\"],\"provisioningState\":\"Provisioning\"}") - .toObject(ClusterMetricsConfigurationProperties.class); - Assertions.assertEquals(8246168361887444991L, model.collectionInterval()); - Assertions.assertEquals("fuarenlvhht", model.enabledMetrics().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMetricsConfigurationProperties model - = new ClusterMetricsConfigurationProperties().withCollectionInterval(8246168361887444991L) - .withEnabledMetrics(Arrays.asList("fuarenlvhht", "lnvnafvvkyfedev", "bo")); - model = BinaryData.fromObject(model).toObject(ClusterMetricsConfigurationProperties.class); - Assertions.assertEquals(8246168361887444991L, model.collectionInterval()); - Assertions.assertEquals("fuarenlvhht", model.enabledMetrics().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterUpdateVersionParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterUpdateVersionParametersTests.java deleted file mode 100644 index b20d1744ee5b7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClusterUpdateVersionParametersTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; -import org.junit.jupiter.api.Assertions; - -public final class ClusterUpdateVersionParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateVersionParameters model = BinaryData.fromString("{\"targetClusterVersion\":\"ytprwnwvroev\"}") - .toObject(ClusterUpdateVersionParameters.class); - Assertions.assertEquals("ytprwnwvroev", model.targetClusterVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateVersionParameters model - = new ClusterUpdateVersionParameters().withTargetClusterVersion("ytprwnwvroev"); - model = BinaryData.fromObject(model).toObject(ClusterUpdateVersionParameters.class); - Assertions.assertEquals("ytprwnwvroev", model.targetClusterVersion()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteMockTests.java deleted file mode 100644 index d84b2c5a3f4d5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().delete("uyx", "bxqvmvuayt", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeployMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeployMockTests.java deleted file mode 100644 index dd2758d3f9a30..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeployMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersDeployMockTests { - @Test - public void testDeploy() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"hwzdanojisgglmv\",\"resourceId\":\"atuztjct\",\"name\":\"pvbkaehxsmzyg\",\"status\":\"fwakw\",\"percentComplete\":35.292667,\"startTime\":\"2021-10-24T14:28:17Z\",\"endTime\":\"2021-05-09T21:41:34Z\",\"operations\":[{\"id\":\"so\",\"resourceId\":\"juxlkbectvtfjm\",\"name\":\"dchmaiubavlz\",\"status\":\"pvgmfa\",\"percentComplete\":28.783613,\"startTime\":\"2021-03-01T09:22:06Z\",\"endTime\":\"2021-08-06T15:10:58Z\",\"operations\":[{\"id\":\"dgjqafkmkro\",\"resourceId\":\"rthqe\",\"name\":\"pqrtvaoznqni\",\"status\":\"iezeagm\",\"percentComplete\":6.5347433,\"startTime\":\"2021-06-06T13:22:55Z\",\"endTime\":\"2021-03-13T23:18Z\",\"operations\":[{\"status\":\"hfpjstlzmbls\"},{\"status\":\"jdeolctae\"},{\"status\":\"fsyrledjc\"}]},{\"id\":\"bvt\",\"resourceId\":\"gdxzvsgeafgfoseh\",\"name\":\"zsxezppkkwaae\",\"status\":\"k\",\"percentComplete\":66.895615,\"startTime\":\"2021-10-16T12:43:35Z\",\"endTime\":\"2021-12-09T00:38:09Z\",\"operations\":[{\"status\":\"oyrplixl\"},{\"status\":\"jmllpquevhamfow\"},{\"status\":\"w\"},{\"status\":\"tmk\"}]}]},{\"id\":\"kzwaqxofq\",\"resourceId\":\"chiqbplvfid\",\"name\":\"ztekxbyjgmsfep\",\"status\":\"yihpqadagrh\",\"percentComplete\":50.432777,\"startTime\":\"2021-03-27T17:09:38Z\",\"endTime\":\"2021-02-10T13:07:29Z\",\"operations\":[{\"id\":\"owxwyovcxjsgbip\",\"resourceId\":\"kdveksb\",\"name\":\"oduchvlscr\",\"status\":\"pibfdy\",\"percentComplete\":62.67252,\"startTime\":\"2021-05-01T03:19:26Z\",\"endTime\":\"2021-04-26T01:58:47Z\",\"operations\":[{\"status\":\"ekbhwlkaa\"},{\"status\":\"gkrehbf\"},{\"status\":\"n\"}]},{\"id\":\"ff\",\"resourceId\":\"fiimreoagsqt\",\"name\":\"dusr\",\"status\":\"xxfavsqwudohzilf\",\"percentComplete\":2.8192937,\"startTime\":\"2021-03-12T12:37:46Z\",\"endTime\":\"2021-10-25T06:45:33Z\",\"operations\":[{\"status\":\"s\"},{\"status\":\"eypofqpm\"},{\"status\":\"hyqgsdrmmttjx\"}]}]},{\"id\":\"erhsmvgohtw\",\"resourceId\":\"qilrixysfn\",\"name\":\"sqywwwmhkru\",\"status\":\"aedrympmlqoin\",\"percentComplete\":57.032158,\"startTime\":\"2021-06-28T12:08:40Z\",\"endTime\":\"2021-04-12T09:43:02Z\",\"operations\":[{\"id\":\"fjiiknjdiqf\",\"resourceId\":\"ejhpclbiedfsbwc\",\"name\":\"vbvzipbwxgo\",\"status\":\"oxzpr\",\"percentComplete\":37.58685,\"startTime\":\"2021-05-01T16:17:20Z\",\"endTime\":\"2021-07-15T01:25:19Z\",\"operations\":[{\"status\":\"dgzigjsugswhgs\"},{\"status\":\"odkwwnbafocto\"},{\"status\":\"zhaquvwsxb\"},{\"status\":\"nvkervq\"}]},{\"id\":\"adhrsxqvzvspa\",\"resourceId\":\"sr\",\"name\":\"ajglzrsubklr\",\"status\":\"hjnlt\",\"percentComplete\":84.322235,\"startTime\":\"2021-05-16T23:15:11Z\",\"endTime\":\"2021-09-16T18:33:55Z\",\"operations\":[{\"status\":\"ie\"}]}]},{\"id\":\"aruwdxvqzxoebw\",\"resourceId\":\"xbibanbaupw\",\"name\":\"vpaklozkxbz\",\"status\":\"pejplssa\",\"percentComplete\":22.423506,\"startTime\":\"2021-08-25T22:39:27Z\",\"endTime\":\"2021-07-31T16:17:28Z\",\"operations\":[{\"id\":\"unrswgkpjhboyik\",\"resourceId\":\"huhkslgwlok\",\"name\":\"eoijyzcqypzqzufg\",\"status\":\"yfejyvdwtf\",\"percentComplete\":13.5335865,\"startTime\":\"2021-10-01T23:24:47Z\",\"endTime\":\"2021-08-21T00:51Z\",\"operations\":[{\"status\":\"k\"},{\"status\":\"cf\"},{\"status\":\"ybmx\"},{\"status\":\"nxocuul\"}]},{\"id\":\"kpoy\",\"resourceId\":\"wwdjuxdbdl\",\"name\":\"gdyrcvuqbsgzl\",\"status\":\"qhbjnqogdxwbsfpy\",\"percentComplete\":58.86224,\"startTime\":\"2021-10-15T21:46:21Z\",\"endTime\":\"2021-03-03T16:51:07Z\",\"operations\":[{\"status\":\"ominxojjlu\"},{\"status\":\"xdhilz\"},{\"status\":\"dzzqjmu\"},{\"status\":\"za\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.clusters() - .deploy("adxkxeqbwpntghy", "sa", new ClusterDeployParameters().withSkipValidationsForMachines( - Arrays.asList("rnxsluvlzlad", "t", "kpbqhvfdqqjw")), com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hwzdanojisgglmv", response.id()); - Assertions.assertEquals("pvbkaehxsmzyg", response.name()); - Assertions.assertEquals("fwakw", response.status()); - Assertions.assertEquals(35.292667F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-24T14:28:17Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T21:41:34Z"), response.endTime()); - Assertions.assertEquals("so", response.operations().get(0).id()); - Assertions.assertEquals("dchmaiubavlz", response.operations().get(0).name()); - Assertions.assertEquals("pvgmfa", response.operations().get(0).status()); - Assertions.assertEquals(28.783613F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T09:22:06Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T15:10:58Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("dgjqafkmkro", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("pqrtvaoznqni", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("iezeagm", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(6.5347433F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T13:22:55Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T23:18Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("hfpjstlzmbls", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionMockTests.java deleted file mode 100644 index a5a08166593e5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 ClustersUpdateVersionMockTests { - @Test - public void testUpdateVersion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"sn\",\"resourceId\":\"kpwolg\",\"name\":\"ubxbteogfgfiijr\",\"status\":\"kw\",\"percentComplete\":42.7373,\"startTime\":\"2021-01-10T10:54:04Z\",\"endTime\":\"2021-08-31T06:22:15Z\",\"operations\":[{\"id\":\"zfpxgnmqvzvluy\",\"resourceId\":\"aiossscyvaifp\",\"name\":\"acvfyeowps\",\"status\":\"x\",\"percentComplete\":53.485535,\"startTime\":\"2021-08-14T22:48:13Z\",\"endTime\":\"2021-09-25T20:23:40Z\",\"operations\":[{\"id\":\"v\",\"resourceId\":\"qfttehdpboujs\",\"name\":\"fvvdshxcdedsue\",\"status\":\"ygnxcgjtfrnqukt\",\"percentComplete\":94.54554,\"startTime\":\"2021-08-24T04:32:50Z\",\"endTime\":\"2021-01-18T17:13:09Z\",\"operations\":[{\"status\":\"s\"},{\"status\":\"ylt\"}]},{\"id\":\"tfmtbgwjdxwnazku\",\"resourceId\":\"drey\",\"name\":\"whsetwwjwzzqs\",\"status\":\"uzu\",\"percentComplete\":3.2954276,\"startTime\":\"2021-10-08T06:22:48Z\",\"endTime\":\"2021-11-09T13:06:10Z\",\"operations\":[{\"status\":\"qqzzdc\"}]},{\"id\":\"ystewfopa\",\"resourceId\":\"azgbsqgpe\",\"name\":\"c\",\"status\":\"utmdpvozg\",\"percentComplete\":20.778894,\"startTime\":\"2021-06-20T10:45:43Z\",\"endTime\":\"2021-10-05T16:50:55Z\",\"operations\":[{\"status\":\"lctzeyowmndcovd\"},{\"status\":\"zqauxzan\"}]}]},{\"id\":\"fruwkud\",\"resourceId\":\"cpft\",\"name\":\"dqyemebunaucm\",\"status\":\"irtneemmjau\",\"percentComplete\":19.34607,\"startTime\":\"2021-01-10T07:42:21Z\",\"endTime\":\"2021-09-29T04:30:33Z\",\"operations\":[{\"id\":\"itranizerwguda\",\"resourceId\":\"xubvf\",\"name\":\"gfcoc\",\"status\":\"fhpri\",\"percentComplete\":71.74806,\"startTime\":\"2021-10-26T02:43:40Z\",\"endTime\":\"2021-11-27T08:02:33Z\",\"operations\":[{\"status\":\"ud\"}]},{\"id\":\"lcdculregpq\",\"resourceId\":\"ojhvrz\",\"name\":\"vgysh\",\"status\":\"rdgrtwmewjzlp\",\"percentComplete\":10.935652,\"startTime\":\"2021-08-16T23:36:15Z\",\"endTime\":\"2021-08-23T04:29:55Z\",\"operations\":[{\"status\":\"cayer\"},{\"status\":\"rransyb\"},{\"status\":\"lpolwzrghsrle\"},{\"status\":\"nkfscjfn\"}]},{\"id\":\"vuagfqwtl\",\"resourceId\":\"gvmreuptrklzmi\",\"name\":\"jwolxfsvaghmpynw\",\"status\":\"slrcigtzj\",\"percentComplete\":30.121494,\"startTime\":\"2021-06-29T16:13:51Z\",\"endTime\":\"2021-03-10T01:51:25Z\",\"operations\":[{\"status\":\"nssovyxpav\"},{\"status\":\"dnievwffcvvy\"}]}]},{\"id\":\"puxgcbdsvalpnpt\",\"resourceId\":\"rkxgpazwugxyqvnj\",\"name\":\"felhldiuhzzgqlm\",\"status\":\"aewzgiudjp\",\"percentComplete\":70.10709,\"startTime\":\"2021-04-21T08:46:45Z\",\"endTime\":\"2021-07-17T16:07:33Z\",\"operations\":[{\"id\":\"hkrezsdsuxheqdgc\",\"resourceId\":\"xsp\",\"name\":\"ymmqgwokmikp\",\"status\":\"zfbmjxuv\",\"percentComplete\":53.539932,\"startTime\":\"2021-09-11T13:09:39Z\",\"endTime\":\"2021-05-30T11:35:27Z\",\"operations\":[{\"status\":\"dvwz\"},{\"status\":\"ehpphthdklmveta\"}]},{\"id\":\"kfqoixwgiksbb\",\"resourceId\":\"ooxr\",\"name\":\"gwphchgjtnht\",\"status\":\"kfac\",\"percentComplete\":18.23241,\"startTime\":\"2020-12-27T13:49:33Z\",\"endTime\":\"2021-08-10T14:00:59Z\",\"operations\":[{\"status\":\"eezbx\"},{\"status\":\"qx\"},{\"status\":\"nuvwcgasgomtmjzw\"}]},{\"id\":\"govsxpwwzt\",\"resourceId\":\"mkkhtgfredml\",\"name\":\"grllcc\",\"status\":\"aovjow\",\"percentComplete\":14.433879,\"startTime\":\"2021-01-21T20:12:23Z\",\"endTime\":\"2021-08-24T08:25:37Z\",\"operations\":[{\"status\":\"mlyotg\"}]}]},{\"id\":\"nsrqor\",\"resourceId\":\"enmvcebxeetq\",\"name\":\"xcxxqndcqjkedw\",\"status\":\"urcgojmrvvxwj\",\"percentComplete\":27.765995,\"startTime\":\"2021-08-17T05:51:47Z\",\"endTime\":\"2021-09-28T04:04:58Z\",\"operations\":[{\"id\":\"silc\",\"resourceId\":\"skx\",\"name\":\"ansbvriaqg\",\"status\":\"tojrulfucte\",\"percentComplete\":30.9254,\"startTime\":\"2021-12-07T06:33:03Z\",\"endTime\":\"2021-09-10T11:37:03Z\",\"operations\":[{\"status\":\"xlyubqjrostv\"},{\"status\":\"jeqmtzzbeqrzt\"},{\"status\":\"x\"},{\"status\":\"lxrdhabsrwrsn\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.clusters() - .updateVersion("ibqlotokhtvwtaz", "kcqwwxwjyofgwh", - new ClusterUpdateVersionParameters().withTargetClusterVersion("kbtlwljssm"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sn", response.id()); - Assertions.assertEquals("ubxbteogfgfiijr", response.name()); - Assertions.assertEquals("kw", response.status()); - Assertions.assertEquals(42.7373F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T10:54:04Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T06:22:15Z"), response.endTime()); - Assertions.assertEquals("zfpxgnmqvzvluy", response.operations().get(0).id()); - Assertions.assertEquals("acvfyeowps", response.operations().get(0).name()); - Assertions.assertEquals("x", response.operations().get(0).status()); - Assertions.assertEquals(53.485535F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T22:48:13Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T20:23:40Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("v", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("fvvdshxcdedsue", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("ygnxcgjtfrnqukt", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(94.54554F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T04:32:50Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T17:13:09Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("s", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteMockTests.java deleted file mode 100644 index d27015ebe986d..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 ConsolesDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.consoles().delete("fvgyxzmxynofxl", "txoqxtdn", "ujsjirkrpskcj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ControlPlaneNodePatchConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ControlPlaneNodePatchConfigurationTests.java deleted file mode 100644 index 84dcf37bb97e9..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ControlPlaneNodePatchConfigurationTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ControlPlaneNodePatchConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ControlPlaneNodePatchConfiguration model = BinaryData.fromString("{\"count\":5157192368682854163}") - .toObject(ControlPlaneNodePatchConfiguration.class); - Assertions.assertEquals(5157192368682854163L, model.count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ControlPlaneNodePatchConfiguration model - = new ControlPlaneNodePatchConfiguration().withCount(5157192368682854163L); - model = BinaryData.fromObject(model).toObject(ControlPlaneNodePatchConfiguration.class); - Assertions.assertEquals(5157192368682854163L, model.count()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EgressEndpointTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EgressEndpointTests.java deleted file mode 100644 index 301f32ae4d880..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EgressEndpointTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EgressEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EgressEndpoint model = BinaryData.fromString( - "{\"category\":\"ynpwlbj\",\"endpoints\":[{\"domainName\":\"gacftadeh\",\"port\":7028050140215699790},{\"domainName\":\"yfsoppu\",\"port\":7161125881545295821},{\"domainName\":\"nzwdejba\",\"port\":8576241637170958939},{\"domainName\":\"zdmohctbqvu\",\"port\":2681919302417118526}]}") - .toObject(EgressEndpoint.class); - Assertions.assertEquals("ynpwlbj", model.category()); - Assertions.assertEquals("gacftadeh", model.endpoints().get(0).domainName()); - Assertions.assertEquals(7028050140215699790L, model.endpoints().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EgressEndpoint model = new EgressEndpoint().withCategory("ynpwlbj") - .withEndpoints( - Arrays.asList(new EndpointDependency().withDomainName("gacftadeh").withPort(7028050140215699790L), - new EndpointDependency().withDomainName("yfsoppu").withPort(7161125881545295821L), - new EndpointDependency().withDomainName("nzwdejba").withPort(8576241637170958939L), - new EndpointDependency().withDomainName("zdmohctbqvu").withPort(2681919302417118526L))); - model = BinaryData.fromObject(model).toObject(EgressEndpoint.class); - Assertions.assertEquals("ynpwlbj", model.category()); - Assertions.assertEquals("gacftadeh", model.endpoints().get(0).domainName()); - Assertions.assertEquals(7028050140215699790L, model.endpoints().get(0).port()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EndpointDependencyTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EndpointDependencyTests.java deleted file mode 100644 index 7da76f643992b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/EndpointDependencyTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.EndpointDependency; -import org.junit.jupiter.api.Assertions; - -public final class EndpointDependencyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointDependency model = BinaryData.fromString("{\"domainName\":\"ndnvo\",\"port\":4292877192766299113}") - .toObject(EndpointDependency.class); - Assertions.assertEquals("ndnvo", model.domainName()); - Assertions.assertEquals(4292877192766299113L, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDependency model = new EndpointDependency().withDomainName("ndnvo").withPort(4292877192766299113L); - model = BinaryData.fromObject(model).toObject(EndpointDependency.class); - Assertions.assertEquals("ndnvo", model.domainName()); - Assertions.assertEquals(4292877192766299113L, model.port()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ExtendedLocationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ExtendedLocationTests.java deleted file mode 100644 index 6a19ce3f7e501..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ExtendedLocationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import org.junit.jupiter.api.Assertions; - -public final class ExtendedLocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtendedLocation model = BinaryData.fromString("{\"name\":\"uuvmkjozkrwfnd\",\"type\":\"odjpslwejd\"}") - .toObject(ExtendedLocation.class); - Assertions.assertEquals("uuvmkjozkrwfnd", model.name()); - Assertions.assertEquals("odjpslwejd", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedLocation model = new ExtendedLocation().withName("uuvmkjozkrwfnd").withType("odjpslwejd"); - model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); - Assertions.assertEquals("uuvmkjozkrwfnd", model.name()); - Assertions.assertEquals("odjpslwejd", model.type()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/FeatureStatusTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/FeatureStatusTests.java deleted file mode 100644 index 3736afd8576e7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/FeatureStatusTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.FeatureStatus; - -public final class FeatureStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FeatureStatus model = BinaryData.fromString( - "{\"detailedStatus\":\"Unknown\",\"detailedStatusMessage\":\"ibycno\",\"name\":\"knme\",\"version\":\"sgzvahapjyzhpv\"}") - .toObject(FeatureStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FeatureStatus model = new FeatureStatus(); - model = BinaryData.fromObject(model).toObject(FeatureStatus.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryNetworkInterfaceTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryNetworkInterfaceTests.java deleted file mode 100644 index 2c62eb6ae2062..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryNetworkInterfaceTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.HardwareInventoryNetworkInterface; - -public final class HardwareInventoryNetworkInterfaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareInventoryNetworkInterface model = BinaryData.fromString( - "{\"linkStatus\":\"gxsabkyq\",\"macAddress\":\"ujitcjcz\",\"name\":\"evndh\",\"networkInterfaceId\":\"wpdappdsbdkv\"}") - .toObject(HardwareInventoryNetworkInterface.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareInventoryNetworkInterface model = new HardwareInventoryNetworkInterface(); - model = BinaryData.fromObject(model).toObject(HardwareInventoryNetworkInterface.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryTests.java deleted file mode 100644 index 9ec911fa5ce2a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareInventoryTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.HardwareInventory; - -public final class HardwareInventoryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareInventory model = BinaryData.fromString( - "{\"additionalHostInformation\":\"s\",\"interfaces\":[{\"linkStatus\":\"v\",\"macAddress\":\"jrwzox\",\"name\":\"tfell\",\"networkInterfaceId\":\"fziton\"},{\"linkStatus\":\"qfpjk\",\"macAddress\":\"xofpdvhpfxxypi\",\"name\":\"nmayhuybb\",\"networkInterfaceId\":\"odepoogin\"},{\"linkStatus\":\"amiheognarxz\",\"macAddress\":\"heotusiv\",\"name\":\"v\",\"networkInterfaceId\":\"iqihn\"}],\"nics\":[{\"lldpNeighbor\":{\"portDescription\":\"wjzrnfygxgisp\",\"portName\":\"vtz\",\"systemDescription\":\"ufubl\",\"systemName\":\"fxqeof\"},\"macAddress\":\"e\",\"name\":\"hqjbasvmsmj\"},{\"lldpNeighbor\":{\"portDescription\":\"ngsntnbybk\",\"portName\":\"cwrwclxxwrljdous\",\"systemDescription\":\"qvkoc\",\"systemName\":\"jdkwtnhxbnjb\"},\"macAddress\":\"sqrglssainq\",\"name\":\"wnzlljfmppeeb\"}]}") - .toObject(HardwareInventory.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareInventory model = new HardwareInventory(); - model = BinaryData.fromObject(model).toObject(HardwareInventory.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareValidationStatusTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareValidationStatusTests.java deleted file mode 100644 index 020a09aafe0a3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/HardwareValidationStatusTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; - -public final class HardwareValidationStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareValidationStatus model - = BinaryData.fromString("{\"lastValidationTime\":\"2021-10-07T14:36:38Z\",\"result\":\"Pass\"}") - .toObject(HardwareValidationStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareValidationStatus model = new HardwareValidationStatus(); - model = BinaryData.fromObject(model).toObject(HardwareValidationStatus.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/IpAddressPoolTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/IpAddressPoolTests.java deleted file mode 100644 index 7339d49341d42..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/IpAddressPoolTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.BfdEnabled; -import com.azure.resourcemanager.networkcloud.models.IpAddressPool; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpAddressPoolTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpAddressPool model = BinaryData.fromString( - "{\"addresses\":[\"odkwobd\",\"gxtibqdxbxw\",\"kbogqxndlkzgx\"],\"autoAssign\":\"True\",\"name\":\"iplbpodxunkbebxm\",\"onlyUseHostIps\":\"True\"}") - .toObject(IpAddressPool.class); - Assertions.assertEquals("odkwobd", model.addresses().get(0)); - Assertions.assertEquals(BfdEnabled.TRUE, model.autoAssign()); - Assertions.assertEquals("iplbpodxunkbebxm", model.name()); - Assertions.assertEquals(BfdEnabled.TRUE, model.onlyUseHostIps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpAddressPool model - = new IpAddressPool().withAddresses(Arrays.asList("odkwobd", "gxtibqdxbxw", "kbogqxndlkzgx")) - .withAutoAssign(BfdEnabled.TRUE) - .withName("iplbpodxunkbebxm") - .withOnlyUseHostIps(BfdEnabled.TRUE); - model = BinaryData.fromObject(model).toObject(IpAddressPool.class); - Assertions.assertEquals("odkwobd", model.addresses().get(0)); - Assertions.assertEquals(BfdEnabled.TRUE, model.autoAssign()); - Assertions.assertEquals("iplbpodxunkbebxm", model.name()); - Assertions.assertEquals(BfdEnabled.TRUE, model.onlyUseHostIps()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KeySetUserStatusTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KeySetUserStatusTests.java deleted file mode 100644 index 37f1b3ce4fe1c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KeySetUserStatusTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; - -public final class KeySetUserStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KeySetUserStatus model = BinaryData - .fromString("{\"azureUserName\":\"edmurrxxge\",\"status\":\"Invalid\",\"statusMessage\":\"vqylkmqpzoyhl\"}") - .toObject(KeySetUserStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KeySetUserStatus model = new KeySetUserStatus(); - model = BinaryData.fromObject(model).toObject(KeySetUserStatus.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchParametersTests.java deleted file mode 100644 index 19595d8bc0ff4..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchParametersTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; -import com.azure.resourcemanager.networkcloud.models.KubernetesClusterPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesClusterPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesClusterPatchParameters model = BinaryData.fromString( - "{\"properties\":{\"controlPlaneNodeConfiguration\":{\"count\":1324024361512589812},\"kubernetesVersion\":\"rrouuxvnsasbcry\"},\"tags\":{\"xnazpmkml\":\"izrxklob\"}}") - .toObject(KubernetesClusterPatchParameters.class); - Assertions.assertEquals("izrxklob", model.tags().get("xnazpmkml")); - Assertions.assertEquals(1324024361512589812L, model.controlPlaneNodeConfiguration().count()); - Assertions.assertEquals("rrouuxvnsasbcry", model.kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesClusterPatchParameters model - = new KubernetesClusterPatchParameters().withTags(mapOf("xnazpmkml", "izrxklob")) - .withControlPlaneNodeConfiguration( - new ControlPlaneNodePatchConfiguration().withCount(1324024361512589812L)) - .withKubernetesVersion("rrouuxvnsasbcry"); - model = BinaryData.fromObject(model).toObject(KubernetesClusterPatchParameters.class); - Assertions.assertEquals("izrxklob", model.tags().get("xnazpmkml")); - Assertions.assertEquals(1324024361512589812L, model.controlPlaneNodeConfiguration().count()); - Assertions.assertEquals("rrouuxvnsasbcry", model.kubernetesVersion()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchPropertiesTests.java deleted file mode 100644 index 00770c91d332b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterPatchPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.KubernetesClusterPatchProperties; -import com.azure.resourcemanager.networkcloud.models.ControlPlaneNodePatchConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesClusterPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesClusterPatchProperties model = BinaryData.fromString( - "{\"controlPlaneNodeConfiguration\":{\"count\":8867328731498350162},\"kubernetesVersion\":\"zopjhbzxliohr\"}") - .toObject(KubernetesClusterPatchProperties.class); - Assertions.assertEquals(8867328731498350162L, model.controlPlaneNodeConfiguration().count()); - Assertions.assertEquals("zopjhbzxliohr", model.kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesClusterPatchProperties model = new KubernetesClusterPatchProperties() - .withControlPlaneNodeConfiguration(new ControlPlaneNodePatchConfiguration().withCount(8867328731498350162L)) - .withKubernetesVersion("zopjhbzxliohr"); - model = BinaryData.fromObject(model).toObject(KubernetesClusterPatchProperties.class); - Assertions.assertEquals(8867328731498350162L, model.controlPlaneNodeConfiguration().count()); - Assertions.assertEquals("zopjhbzxliohr", model.kubernetesVersion()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterRestartNodeParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterRestartNodeParametersTests.java deleted file mode 100644 index 61f68afa69f5c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClusterRestartNodeParametersTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.KubernetesClusterRestartNodeParameters; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesClusterRestartNodeParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesClusterRestartNodeParameters model - = BinaryData.fromString("{\"nodeName\":\"schori\"}").toObject(KubernetesClusterRestartNodeParameters.class); - Assertions.assertEquals("schori", model.nodeName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesClusterRestartNodeParameters model - = new KubernetesClusterRestartNodeParameters().withNodeName("schori"); - model = BinaryData.fromObject(model).toObject(KubernetesClusterRestartNodeParameters.class); - Assertions.assertEquals("schori", model.nodeName()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteMockTests.java deleted file mode 100644 index ade07609f44fe..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 KubernetesClustersDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.kubernetesClusters().delete("bjgmnzj", "t", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeMockTests.java deleted file mode 100644 index 76410bcc6cb8d..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/KubernetesClustersRestartNodeMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.KubernetesClusterRestartNodeParameters; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 KubernetesClustersRestartNodeMockTests { - @Test - public void testRestartNode() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"hyibdrqrswh\",\"resourceId\":\"ubpyrow\",\"name\":\"oxztfwfqch\",\"status\":\"czevjnn\",\"percentComplete\":64.1754,\"startTime\":\"2021-04-04T10:49Z\",\"endTime\":\"2021-05-24T09:27:10Z\",\"operations\":[{\"id\":\"qpemh\",\"resourceId\":\"gkrepdqhqyhw\",\"name\":\"e\",\"status\":\"vx\",\"percentComplete\":80.07647,\"startTime\":\"2021-11-27T02:47:28Z\",\"endTime\":\"2021-04-02T23:25:20Z\",\"operations\":[{\"id\":\"inhgre\",\"resourceId\":\"twhlpuzjpce\",\"name\":\"nzangprbfaxy\",\"status\":\"zlbciphmse\",\"percentComplete\":97.917725,\"startTime\":\"2021-11-20T12:21:36Z\",\"endTime\":\"2021-01-10T19:01:41Z\",\"operations\":[{\"status\":\"xfvonfeeqg\"},{\"status\":\"krie\"}]},{\"id\":\"nixxo\",\"resourceId\":\"zk\",\"name\":\"wnwpiwxeii\",\"status\":\"rmpepkld\",\"percentComplete\":24.544788,\"startTime\":\"2021-07-13T06:09:31Z\",\"endTime\":\"2021-11-28T06:05:09Z\",\"operations\":[{\"status\":\"ws\"},{\"status\":\"gkjgya\"}]}]},{\"id\":\"sekwefc\",\"resourceId\":\"inwoqartwyxq\",\"name\":\"l\",\"status\":\"dvatdavuqm\",\"percentComplete\":60.21031,\"startTime\":\"2021-10-15T14:21:54Z\",\"endTime\":\"2021-02-05T13:45:47Z\",\"operations\":[{\"id\":\"quvjez\",\"resourceId\":\"umvpsimioyoigl\",\"name\":\"iqwnnraclibbfq\",\"status\":\"spkladydgnhau\",\"percentComplete\":45.845135,\"startTime\":\"2021-04-29T04:27:22Z\",\"endTime\":\"2021-08-06T01:44:23Z\",\"operations\":[{\"status\":\"mnmabeddqil\"}]},{\"id\":\"fpfqf\",\"resourceId\":\"vstclg\",\"name\":\"vwerfwxbsmtb\",\"status\":\"jj\",\"percentComplete\":18.261974,\"startTime\":\"2021-02-16T12:19:52Z\",\"endTime\":\"2020-12-28T15:51:37Z\",\"operations\":[{\"status\":\"vbtbrekqhsqhtf\"}]}]},{\"id\":\"byejuwyqwdqigm\",\"resourceId\":\"ginz\",\"name\":\"lujkhn\",\"status\":\"cmrnkfmkhcq\",\"percentComplete\":12.672424,\"startTime\":\"2021-01-04T06:58:03Z\",\"endTime\":\"2021-09-23T04:33:55Z\",\"operations\":[{\"id\":\"qe\",\"resourceId\":\"j\",\"name\":\"vragpokddx\",\"status\":\"jhhkv\",\"percentComplete\":93.62849,\"startTime\":\"2021-01-20T22:08:25Z\",\"endTime\":\"2021-02-07T21:47:53Z\",\"operations\":[{\"status\":\"ewkq\"}]},{\"id\":\"pgb\",\"resourceId\":\"ffbkkwvdxaexqo\",\"name\":\"yrlji\",\"status\":\"lzbnobrqlpbcjt\",\"percentComplete\":67.76566,\"startTime\":\"2021-10-06T10:17Z\",\"endTime\":\"2021-10-31T04:42:12Z\",\"operations\":[{\"status\":\"bxnhsqeaeo\"},{\"status\":\"qelwgdhuruzytza\"},{\"status\":\"ogatmoljiy\"},{\"status\":\"mpinmzvfkneerzzt\"}]}]},{\"id\":\"j\",\"resourceId\":\"ugdybnhrxlel\",\"name\":\"hkeizcp\",\"status\":\"htdm\",\"percentComplete\":3.949666,\"startTime\":\"2021-05-22T08:34:02Z\",\"endTime\":\"2021-01-25T14:21:57Z\",\"operations\":[{\"id\":\"ydbjzcqymlcf\",\"resourceId\":\"hmhsurlgwqkpm\",\"name\":\"pstauol\",\"status\":\"wiubmomsgvv\",\"percentComplete\":92.820564,\"startTime\":\"2021-01-31T12:32:47Z\",\"endTime\":\"2021-01-17T00:07:41Z\",\"operations\":[{\"status\":\"ewjjmajnkdflqio\"},{\"status\":\"swaeqkzfz\"},{\"status\":\"xjoshohtotryegpk\"},{\"status\":\"xrmexznlw\"}]},{\"id\":\"okxkhupzer\",\"resourceId\":\"g\",\"name\":\"l\",\"status\":\"drmyfcemftzg\",\"percentComplete\":14.742958,\"startTime\":\"2021-07-17T22:46:30Z\",\"endTime\":\"2021-08-17T18:53:21Z\",\"operations\":[{\"status\":\"kd\"},{\"status\":\"qnhttwdowrczfj\"},{\"status\":\"nnuxxrkkmhm\"}]},{\"id\":\"wempdcifrhju\",\"resourceId\":\"sulwzpflusn\",\"name\":\"mhh\",\"status\":\"zotfriyrgkoek\",\"percentComplete\":74.13537,\"startTime\":\"2021-11-24T18:08:55Z\",\"endTime\":\"2021-03-14T19:38:08Z\",\"operations\":[{\"status\":\"ghctxbxmolpcqyde\"},{\"status\":\"kvskiczdfrjei\"},{\"status\":\"ikgqaboohxbms\"}]},{\"id\":\"qsxrmdvewu\",\"resourceId\":\"aeohpjhgejkbvhh\",\"name\":\"urghoo\",\"status\":\"aexbkhxjxjo\",\"percentComplete\":19.243462,\"startTime\":\"2021-05-08T22:48:16Z\",\"endTime\":\"2021-09-17T12:36:39Z\",\"operations\":[{\"status\":\"nkobektmbozom\"},{\"status\":\"zamicb\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.kubernetesClusters() - .restartNode("mrxkhlobvv", "bhvhdiqay", - new KubernetesClusterRestartNodeParameters().withNodeName("luiyuosnuudte"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hyibdrqrswh", response.id()); - Assertions.assertEquals("oxztfwfqch", response.name()); - Assertions.assertEquals("czevjnn", response.status()); - Assertions.assertEquals(64.1754F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T10:49Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T09:27:10Z"), response.endTime()); - Assertions.assertEquals("qpemh", response.operations().get(0).id()); - Assertions.assertEquals("e", response.operations().get(0).name()); - Assertions.assertEquals("vx", response.operations().get(0).status()); - Assertions.assertEquals(80.07647F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T02:47:28Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T23:25:20Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("inhgre", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("nzangprbfaxy", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("zlbciphmse", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(97.917725F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T12:21:36Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T19:01:41Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("xfvonfeeqg", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkAttachmentConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkAttachmentConfigurationTests.java deleted file mode 100644 index 8baa78e6c40f4..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkAttachmentConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; -import com.azure.resourcemanager.networkcloud.models.L2NetworkAttachmentConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class L2NetworkAttachmentConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2NetworkAttachmentConfiguration model - = BinaryData.fromString("{\"networkId\":\"kiidzyex\",\"pluginType\":\"DPDK\"}") - .toObject(L2NetworkAttachmentConfiguration.class); - Assertions.assertEquals("kiidzyex", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.DPDK, model.pluginType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2NetworkAttachmentConfiguration model = new L2NetworkAttachmentConfiguration().withNetworkId("kiidzyex") - .withPluginType(KubernetesPluginType.DPDK); - model = BinaryData.fromObject(model).toObject(L2NetworkAttachmentConfiguration.class); - Assertions.assertEquals("kiidzyex", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.DPDK, model.pluginType()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkInnerTests.java deleted file mode 100644 index a208fe11422d3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkInnerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2NetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2NetworkInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"zikhl\",\"type\":\"fjhdg\"},\"properties\":{\"associatedResourceIds\":[\"ebdunyg\",\"eqidbqfatpx\",\"lr\"],\"clusterId\":\"yjmoadsu\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ywdmjsjqbjh\",\"hybridAksClustersAssociatedIds\":[\"xrwlyc\"],\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"p\",\"l2IsolationDomainId\":\"xkgymareqnajxqu\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"cubeddgssofw\",\"mzqa\",\"krmnjijpxacqqud\"]},\"location\":\"byxbaaabjy\",\"tags\":{\"evfdnwnwm\":\"ffimrzrtuzqogsex\",\"i\":\"wzsyyceuzs\",\"thzvaytdwkqbrqu\":\"judpfrxt\",\"xiilivpdtiirqt\":\"paxh\"},\"id\":\"qoaxoruzfgs\",\"name\":\"uyfxrxxleptramxj\",\"type\":\"zwl\"}") - .toObject(L2NetworkInner.class); - Assertions.assertEquals("byxbaaabjy", model.location()); - Assertions.assertEquals("ffimrzrtuzqogsex", model.tags().get("evfdnwnwm")); - Assertions.assertEquals("zikhl", model.extendedLocation().name()); - Assertions.assertEquals("fjhdg", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("p", model.interfaceName()); - Assertions.assertEquals("xkgymareqnajxqu", model.l2IsolationDomainId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2NetworkInner model = new L2NetworkInner().withLocation("byxbaaabjy") - .withTags(mapOf("evfdnwnwm", "ffimrzrtuzqogsex", "i", "wzsyyceuzs", "thzvaytdwkqbrqu", "judpfrxt", - "xiilivpdtiirqt", "paxh")) - .withExtendedLocation(new ExtendedLocation().withName("zikhl").withType("fjhdg")) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("p") - .withL2IsolationDomainId("xkgymareqnajxqu"); - model = BinaryData.fromObject(model).toObject(L2NetworkInner.class); - Assertions.assertEquals("byxbaaabjy", model.location()); - Assertions.assertEquals("ffimrzrtuzqogsex", model.tags().get("evfdnwnwm")); - Assertions.assertEquals("zikhl", model.extendedLocation().name()); - Assertions.assertEquals("fjhdg", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("p", model.interfaceName()); - Assertions.assertEquals("xkgymareqnajxqu", model.l2IsolationDomainId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkListTests.java deleted file mode 100644 index bc0a34d8cd905..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkListTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.L2NetworkList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2NetworkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2NetworkList model = BinaryData.fromString( - "{\"nextLink\":\"xzxcl\",\"value\":[{\"extendedLocation\":{\"name\":\"hhqzonosgg\",\"type\":\"hcohfwdsjnk\"},\"properties\":{\"associatedResourceIds\":[\"utiiswacf\",\"gdkz\",\"ewkfvhqcrai\"],\"clusterId\":\"pnppfuf\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"mh\",\"hybridAksClustersAssociatedIds\":[\"yjrxsagafcnih\",\"wqapnedgfbcvk\",\"vq\",\"pkeqdcvdrhvoo\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"bobzdopcjwvnhd\",\"l2IsolationDomainId\":\"d\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"xrslpm\",\"twuoegrpkhjwni\",\"qsluicp\",\"ggkzzlvmbmpa\"]},\"location\":\"odfvuefywsbp\",\"tags\":{\"wiyzvqtmnubexkp\":\"wyhrfouyftaakc\",\"mquxvypo\":\"ksmond\"},\"id\":\"gkopkwhojvpajqgx\",\"name\":\"smocmbq\",\"type\":\"qvmkcxo\"},{\"extendedLocation\":{\"name\":\"apvhelxprgly\",\"type\":\"tddckcb\"},\"properties\":{\"associatedResourceIds\":[\"jrjxgciqibrhosx\",\"dqrhzoymib\",\"rq\",\"ibahwflus\"],\"clusterId\":\"tmhrkwofyyvoqacp\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"btgiwbwoenwas\",\"hybridAksClustersAssociatedIds\":[\"dtkcnqxwbpokulp\",\"ujw\"],\"hybridAksPluginType\":\"SRIOV\",\"interfaceName\":\"pqiiobyuqe\",\"l2IsolationDomainId\":\"pqlpq\",\"provisioningState\":\"Failed\",\"virtualMachinesAssociatedIds\":[\"qgbdbuta\",\"vfbtkuwh\",\"mhykojoxafnndl\",\"ichkoymkcdyhb\"]},\"location\":\"kpw\",\"tags\":{\"ovvqfovljxywsu\":\"q\",\"aeneqnzarrwl\":\"syrsndsytgadgvra\",\"jfqka\":\"uu\"},\"id\":\"e\",\"name\":\"iipfpubj\",\"type\":\"bwwift\"},{\"extendedLocation\":{\"name\":\"hqkvpuvksgplsak\",\"type\":\"ynfs\"},\"properties\":{\"associatedResourceIds\":[\"jphuopxodlqi\",\"ntorzihleosjswsr\",\"slyzrpzbchckqq\"],\"clusterId\":\"ioxiysuiizyn\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"atrwyhqmibzyh\",\"hybridAksClustersAssociatedIds\":[\"smypyynpc\",\"pumnz\",\"mwzn\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"knso\",\"l2IsolationDomainId\":\"gj\",\"provisioningState\":\"Failed\",\"virtualMachinesAssociatedIds\":[\"tlwwrlk\",\"m\",\"ncvokotllxdyhg\"]},\"location\":\"ocogj\",\"tags\":{\"oocrkvcikhnv\":\"tbnnha\",\"gxk\":\"amqgxqquezikyw\"},\"id\":\"lla\",\"name\":\"melwuipiccjz\",\"type\":\"z\"},{\"extendedLocation\":{\"name\":\"v\",\"type\":\"vvcnayr\"},\"properties\":{\"associatedResourceIds\":[\"nxxmueedndrdv\",\"tkwqqtchealm\",\"mtdaa\"],\"clusterId\":\"dvwvgpio\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"rtfudxepxg\",\"hybridAksClustersAssociatedIds\":[\"gvr\",\"mnpkukghimdblxg\",\"imfnjhfjx\"],\"hybridAksPluginType\":\"SRIOV\",\"interfaceName\":\"kkfoqr\",\"l2IsolationDomainId\":\"yfkzik\",\"provisioningState\":\"Failed\",\"virtualMachinesAssociatedIds\":[\"eaivxwczel\"]},\"location\":\"irels\",\"tags\":{\"ddxbjhwuaanoz\":\"enwabfatk\",\"jrvxaglrv\":\"osphyoul\"},\"id\":\"mjwosytx\",\"name\":\"tcs\",\"type\":\"fcktqumiekke\"}]}") - .toObject(L2NetworkList.class); - Assertions.assertEquals("xzxcl", model.nextLink()); - Assertions.assertEquals("odfvuefywsbp", model.value().get(0).location()); - Assertions.assertEquals("wyhrfouyftaakc", model.value().get(0).tags().get("wiyzvqtmnubexkp")); - Assertions.assertEquals("hhqzonosgg", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("hcohfwdsjnk", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("bobzdopcjwvnhd", model.value().get(0).interfaceName()); - Assertions.assertEquals("d", model.value().get(0).l2IsolationDomainId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2NetworkList model = new L2NetworkList().withNextLink("xzxcl") - .withValue(Arrays.asList( - new L2NetworkInner().withLocation("odfvuefywsbp") - .withTags(mapOf("wiyzvqtmnubexkp", "wyhrfouyftaakc", "mquxvypo", "ksmond")) - .withExtendedLocation(new ExtendedLocation().withName("hhqzonosgg").withType("hcohfwdsjnk")) - .withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("bobzdopcjwvnhd") - .withL2IsolationDomainId("d"), - new L2NetworkInner().withLocation("kpw") - .withTags(mapOf("ovvqfovljxywsu", "q", "aeneqnzarrwl", "syrsndsytgadgvra", "jfqka", "uu")) - .withExtendedLocation(new ExtendedLocation().withName("apvhelxprgly").withType("tddckcb")) - .withHybridAksPluginType(HybridAksPluginType.SRIOV) - .withInterfaceName("pqiiobyuqe") - .withL2IsolationDomainId("pqlpq"), - new L2NetworkInner().withLocation("ocogj") - .withTags(mapOf("oocrkvcikhnv", "tbnnha", "gxk", "amqgxqquezikyw")) - .withExtendedLocation(new ExtendedLocation().withName("hqkvpuvksgplsak").withType("ynfs")) - .withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("knso") - .withL2IsolationDomainId("gj"), - new L2NetworkInner().withLocation("irels") - .withTags(mapOf("ddxbjhwuaanoz", "enwabfatk", "jrvxaglrv", "osphyoul")) - .withExtendedLocation(new ExtendedLocation().withName("v").withType("vvcnayr")) - .withHybridAksPluginType(HybridAksPluginType.SRIOV) - .withInterfaceName("kkfoqr") - .withL2IsolationDomainId("yfkzik"))); - model = BinaryData.fromObject(model).toObject(L2NetworkList.class); - Assertions.assertEquals("xzxcl", model.nextLink()); - Assertions.assertEquals("odfvuefywsbp", model.value().get(0).location()); - Assertions.assertEquals("wyhrfouyftaakc", model.value().get(0).tags().get("wiyzvqtmnubexkp")); - Assertions.assertEquals("hhqzonosgg", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("hcohfwdsjnk", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("bobzdopcjwvnhd", model.value().get(0).interfaceName()); - Assertions.assertEquals("d", model.value().get(0).l2IsolationDomainId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPatchParametersTests.java deleted file mode 100644 index 4540712aff2ef..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPatchParametersTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2NetworkPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2NetworkPatchParameters model = BinaryData.fromString( - "{\"tags\":{\"ucsofldpuviyf\":\"srrm\",\"bsxtkcudfbsfarfs\":\"aabeolhbhlvbmxuq\",\"gf\":\"owlkjxnqpv\",\"d\":\"tmhqykiz\"}}") - .toObject(L2NetworkPatchParameters.class); - Assertions.assertEquals("srrm", model.tags().get("ucsofldpuviyf")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2NetworkPatchParameters model = new L2NetworkPatchParameters().withTags(mapOf("ucsofldpuviyf", "srrm", - "bsxtkcudfbsfarfs", "aabeolhbhlvbmxuq", "gf", "owlkjxnqpv", "d", "tmhqykiz")); - model = BinaryData.fromObject(model).toObject(L2NetworkPatchParameters.class); - Assertions.assertEquals("srrm", model.tags().get("ucsofldpuviyf")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPropertiesTests.java deleted file mode 100644 index 88be784f7ea8a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworkPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkProperties; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import org.junit.jupiter.api.Assertions; - -public final class L2NetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2NetworkProperties model = BinaryData.fromString( - "{\"associatedResourceIds\":[\"xuqlcvydypat\",\"ooaojkniodkooebw\",\"ujhemmsbvdkcrodt\",\"infwjlfltkacjve\"],\"clusterId\":\"dlfoakggkfp\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"wpu\",\"hybridAksClustersAssociatedIds\":[\"blylsyxkqjnsj\",\"r\",\"tiagx\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"uem\",\"l2IsolationDomainId\":\"sbzkf\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"pnqi\"]}") - .toObject(L2NetworkProperties.class); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.hybridAksPluginType()); - Assertions.assertEquals("uem", model.interfaceName()); - Assertions.assertEquals("sbzkf", model.l2IsolationDomainId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2NetworkProperties model = new L2NetworkProperties().withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("uem") - .withL2IsolationDomainId("sbzkf"); - model = BinaryData.fromObject(model).toObject(L2NetworkProperties.class); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.hybridAksPluginType()); - Assertions.assertEquals("uem", model.interfaceName()); - Assertions.assertEquals("sbzkf", model.l2IsolationDomainId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateMockTests.java deleted file mode 100644 index e4657293e47f6..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.L2Network; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class L2NetworksCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"hoe\",\"type\":\"goiutgw\"},\"properties\":{\"associatedResourceIds\":[\"a\",\"p\",\"hazyntacihnco\"],\"clusterId\":\"ipnmliqmv\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ke\",\"hybridAksClustersAssociatedIds\":[\"rvgpomxpupdtsd\",\"jyies\",\"cwiqbuout\"],\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"gleofjsbgbw\",\"l2IsolationDomainId\":\"zvdajfwnncf\",\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"gjj\",\"l\",\"iqlwixvtbou\",\"uxtndopgjttbasua\"]},\"location\":\"pdlndbeaqbkixvv\",\"tags\":{\"fjmsp\":\"npbbfqv\",\"jmphfkyezolgj\":\"gzfeuzj\",\"uydoccnx\":\"mi\",\"batecaat\":\"hanzbuiad\"},\"id\":\"dohzniucbdaombwi\",\"name\":\"njdllwktlepowavv\",\"type\":\"xu\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L2Network response = manager.l2Networks() - .define("zgczfcmfpfbode") - .withRegion("vdgxly") - .withExistingResourceGroup("srtmdylperpiltt") - .withExtendedLocation(new ExtendedLocation().withName("resrgvtshuvft").withType("ai")) - .withL2IsolationDomainId("ukklvzrlr") - .withTags(mapOf("jovmozsaye", "itdshezsvkolru", "uykykipfsd", "razwzlpzbt", "bezacfpztga", "epfnoc")) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("elqxovppqi") - .create(); - - Assertions.assertEquals("pdlndbeaqbkixvv", response.location()); - Assertions.assertEquals("npbbfqv", response.tags().get("fjmsp")); - Assertions.assertEquals("hoe", response.extendedLocation().name()); - Assertions.assertEquals("goiutgw", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.DPDK, response.hybridAksPluginType()); - Assertions.assertEquals("gleofjsbgbw", response.interfaceName()); - Assertions.assertEquals("zvdajfwnncf", response.l2IsolationDomainId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteMockTests.java deleted file mode 100644 index 4e177f35cf112..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 L2NetworksDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.l2Networks().delete("xlcskltez", "ugggzlfbgrdcgu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6eb512ed1fada..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.L2Network; -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 L2NetworksGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"gzzromv\",\"type\":\"g\"},\"properties\":{\"associatedResourceIds\":[\"mtmesrfsv\"],\"clusterId\":\"nkzpatqtdiswxsp\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"jazbbgspftesu\",\"hybridAksClustersAssociatedIds\":[\"vpvdylytcovqse\",\"srfjbdxzfxnx\"],\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"uoswkjmdih\",\"l2IsolationDomainId\":\"cy\",\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"hbw\",\"jnufzrf\",\"m\"]},\"location\":\"gnnbzrtf\",\"tags\":{\"yj\":\"zuubjtvgjsxm\",\"wobtdphti\":\"vavdp\",\"w\":\"sffofwanmhksca\",\"ybjpozoks\":\"zcgwdfriw\"},\"id\":\"vgllixdgby\",\"name\":\"gwewqkjvxprwpxso\",\"type\":\"hu\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L2Network response = manager.l2Networks() - .getByResourceGroupWithResponse("zfkiceevsaaxwsp", "axikhfjqebglcxk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gnnbzrtf", response.location()); - Assertions.assertEquals("zuubjtvgjsxm", response.tags().get("yj")); - Assertions.assertEquals("gzzromv", response.extendedLocation().name()); - Assertions.assertEquals("g", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.DPDK, response.hybridAksPluginType()); - Assertions.assertEquals("uoswkjmdih", response.interfaceName()); - Assertions.assertEquals("cy", response.l2IsolationDomainId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupMockTests.java deleted file mode 100644 index 300f3e0a7bcbf..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.L2Network; -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 L2NetworksListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"jw\",\"type\":\"w\"},\"properties\":{\"associatedResourceIds\":[\"ratjhdhzybspij\",\"frzgdkkagvwukhs\",\"s\"],\"clusterId\":\"orfmzhwilzz\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"mriprlk\",\"hybridAksClustersAssociatedIds\":[\"yttlrcxiv\",\"bkut\",\"umltwjflu\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"pvzlqywauyqnj\",\"l2IsolationDomainId\":\"khmocgjs\",\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"rhwv\"]},\"location\":\"qqgglj\",\"tags\":{\"rbctbhpjhxpcvrd\":\"sjrclrvtzq\",\"it\":\"y\"},\"id\":\"n\",\"name\":\"qady\",\"type\":\"zjahwriuomz\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.l2Networks().listByResourceGroup("yv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qqgglj", response.iterator().next().location()); - Assertions.assertEquals("sjrclrvtzq", response.iterator().next().tags().get("rbctbhpjhxpcvrd")); - Assertions.assertEquals("jw", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("w", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("pvzlqywauyqnj", response.iterator().next().interfaceName()); - Assertions.assertEquals("khmocgjs", response.iterator().next().l2IsolationDomainId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListMockTests.java deleted file mode 100644 index f7e57496fd74c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.L2Network; -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 L2NetworksListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"efgvqcp\",\"type\":\"wjgquxweyslandkd\"},\"properties\":{\"associatedResourceIds\":[\"hunh\",\"hcgawn\",\"rnquoxso\"],\"clusterId\":\"reimseob\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"tcyilbvz\",\"hybridAksClustersAssociatedIds\":[\"cjzlquzexokjxebj\",\"b\",\"inzabwmvoglj\"],\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"gi\",\"l2IsolationDomainId\":\"nwcehaqidoyzl\",\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"qoqpepiaeap\",\"sergdtpe\",\"nacyheqwb\",\"qq\"]},\"location\":\"jubkhjozfymcwmb\",\"tags\":{\"qiipsejb\":\"vqyvl\",\"ieswhddzydisn\":\"vsi\",\"i\":\"epywyjlnldpxottd\"},\"id\":\"ocqibz\",\"name\":\"ihweeb\",\"type\":\"ph\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.l2Networks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jubkhjozfymcwmb", response.iterator().next().location()); - Assertions.assertEquals("vqyvl", response.iterator().next().tags().get("qiipsejb")); - Assertions.assertEquals("efgvqcp", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("wjgquxweyslandkd", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.DPDK, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("gi", response.iterator().next().interfaceName()); - Assertions.assertEquals("nwcehaqidoyzl", response.iterator().next().l2IsolationDomainId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkAttachmentConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkAttachmentConfigurationTests.java deleted file mode 100644 index 1ddd1186e86bf..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkAttachmentConfigurationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; -import com.azure.resourcemanager.networkcloud.models.L3NetworkAttachmentConfiguration; -import com.azure.resourcemanager.networkcloud.models.L3NetworkConfigurationIpamEnabled; -import org.junit.jupiter.api.Assertions; - -public final class L3NetworkAttachmentConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3NetworkAttachmentConfiguration model - = BinaryData.fromString("{\"ipamEnabled\":\"True\",\"networkId\":\"xhnrztfolhb\",\"pluginType\":\"SRIOV\"}") - .toObject(L3NetworkAttachmentConfiguration.class); - Assertions.assertEquals(L3NetworkConfigurationIpamEnabled.TRUE, model.ipamEnabled()); - Assertions.assertEquals("xhnrztfolhb", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.SRIOV, model.pluginType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3NetworkAttachmentConfiguration model - = new L3NetworkAttachmentConfiguration().withIpamEnabled(L3NetworkConfigurationIpamEnabled.TRUE) - .withNetworkId("xhnrztfolhb") - .withPluginType(KubernetesPluginType.SRIOV); - model = BinaryData.fromObject(model).toObject(L3NetworkAttachmentConfiguration.class); - Assertions.assertEquals(L3NetworkConfigurationIpamEnabled.TRUE, model.ipamEnabled()); - Assertions.assertEquals("xhnrztfolhb", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.SRIOV, model.pluginType()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkInnerTests.java deleted file mode 100644 index be891caecf844..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkInnerTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3NetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3NetworkInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"piyylhalnswhccsp\",\"type\":\"kaivwit\"},\"properties\":{\"associatedResourceIds\":[\"ywuggwoluhcz\",\"wem\",\"ai\"],\"clusterId\":\"brgz\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"weyp\",\"hybridAksClustersAssociatedIds\":[\"xggicccnxqhuexmk\",\"tlstvlzywem\",\"zrncsdt\",\"lusiy\"],\"hybridAksIpamEnabled\":\"False\",\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"tg\",\"ipAllocationType\":\"IPV4\",\"ipv4ConnectedPrefix\":\"eadcygqukyhejhz\",\"ipv6ConnectedPrefix\":\"xgfpelolppv\",\"l3IsolationDomainId\":\"srp\",\"provisioningState\":\"Failed\",\"virtualMachinesAssociatedIds\":[\"raehtwdwrft\",\"wib\"],\"vlan\":4339974263260215047},\"location\":\"l\",\"tags\":{\"khevxccedc\":\"hfwpracstwit\",\"jc\":\"nmdyodnwzxl\",\"vvwxqi\":\"nhltiugcxn\",\"unyowxwl\":\"y\"},\"id\":\"djrkvfgbvfvpd\",\"name\":\"odacizs\",\"type\":\"q\"}") - .toObject(L3NetworkInner.class); - Assertions.assertEquals("l", model.location()); - Assertions.assertEquals("hfwpracstwit", model.tags().get("khevxccedc")); - Assertions.assertEquals("piyylhalnswhccsp", model.extendedLocation().name()); - Assertions.assertEquals("kaivwit", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.FALSE, model.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("tg", model.interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV4, model.ipAllocationType()); - Assertions.assertEquals("eadcygqukyhejhz", model.ipv4ConnectedPrefix()); - Assertions.assertEquals("xgfpelolppv", model.ipv6ConnectedPrefix()); - Assertions.assertEquals("srp", model.l3IsolationDomainId()); - Assertions.assertEquals(4339974263260215047L, model.vlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3NetworkInner model = new L3NetworkInner().withLocation("l") - .withTags(mapOf("khevxccedc", "hfwpracstwit", "jc", "nmdyodnwzxl", "vvwxqi", "nhltiugcxn", "unyowxwl", "y")) - .withExtendedLocation(new ExtendedLocation().withName("piyylhalnswhccsp").withType("kaivwit")) - .withHybridAksIpamEnabled(HybridAksIpamEnabled.FALSE) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("tg") - .withIpAllocationType(IpAllocationType.IPV4) - .withIpv4ConnectedPrefix("eadcygqukyhejhz") - .withIpv6ConnectedPrefix("xgfpelolppv") - .withL3IsolationDomainId("srp") - .withVlan(4339974263260215047L); - model = BinaryData.fromObject(model).toObject(L3NetworkInner.class); - Assertions.assertEquals("l", model.location()); - Assertions.assertEquals("hfwpracstwit", model.tags().get("khevxccedc")); - Assertions.assertEquals("piyylhalnswhccsp", model.extendedLocation().name()); - Assertions.assertEquals("kaivwit", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.FALSE, model.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("tg", model.interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV4, model.ipAllocationType()); - Assertions.assertEquals("eadcygqukyhejhz", model.ipv4ConnectedPrefix()); - Assertions.assertEquals("xgfpelolppv", model.ipv6ConnectedPrefix()); - Assertions.assertEquals("srp", model.l3IsolationDomainId()); - Assertions.assertEquals(4339974263260215047L, model.vlan()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkListTests.java deleted file mode 100644 index c765f1408ecbe..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkListTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import com.azure.resourcemanager.networkcloud.models.L3NetworkList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3NetworkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3NetworkList model = BinaryData.fromString( - "{\"nextLink\":\"invkjjxdxrbuu\",\"value\":[{\"extendedLocation\":{\"name\":\"lewyhmlwpaz\",\"type\":\"zpof\"},\"properties\":{\"associatedResourceIds\":[\"kwyfzqwhxxbuyqax\"],\"clusterId\":\"eqz\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"iolxor\",\"hybridAksClustersAssociatedIds\":[\"tolmncwsobqw\"],\"hybridAksIpamEnabled\":\"True\",\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"dcfhucqdpf\",\"ipAllocationType\":\"IPV6\",\"ipv4ConnectedPrefix\":\"sbjjc\",\"ipv6ConnectedPrefix\":\"vxb\",\"l3IsolationDomainId\":\"t\",\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"ncormrlxqtvcof\",\"dflvkg\",\"u\",\"gdknnqv\"],\"vlan\":378347416305968829},\"location\":\"qntorudsgsahmkyc\",\"tags\":{\"s\":\"uwjuetaeburuvdmo\",\"tpuqujmq\":\"zlxwabmqoefkifr\",\"jcntuj\":\"gkfbtndoaong\"},\"id\":\"tcje\",\"name\":\"ftwwaezkojvdc\",\"type\":\"zfoqouicybxar\"},{\"extendedLocation\":{\"name\":\"gszufoxciqopid\",\"type\":\"amcio\"},\"properties\":{\"associatedResourceIds\":[\"haz\",\"khnzbonlw\",\"toego\",\"dwbwhkszzcmrvexz\"],\"clusterId\":\"bt\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"ra\",\"hybridAksClustersAssociatedIds\":[\"koowtl\",\"nguxawqaldsy\",\"uximerqfobw\",\"znkbykutwpfhpagm\"],\"hybridAksIpamEnabled\":\"False\",\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"nfd\",\"ipAllocationType\":\"IPV6\",\"ipv4ConnectedPrefix\":\"kgtdlmkkze\",\"ipv6ConnectedPrefix\":\"l\",\"l3IsolationDomainId\":\"ewpusdsttwvogvb\",\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"ngqqmoakuf\",\"m\",\"zr\",\"rdgrtw\"],\"vlan\":1523837111721006893},\"location\":\"uzkopbminrfd\",\"tags\":{\"mlmz\":\"uhhziuiefozbhdm\",\"ae\":\"hoftr\"},\"id\":\"u\",\"name\":\"ah\",\"type\":\"icslfaoq\"}]}") - .toObject(L3NetworkList.class); - Assertions.assertEquals("invkjjxdxrbuu", model.nextLink()); - Assertions.assertEquals("qntorudsgsahmkyc", model.value().get(0).location()); - Assertions.assertEquals("uwjuetaeburuvdmo", model.value().get(0).tags().get("s")); - Assertions.assertEquals("lewyhmlwpaz", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("zpof", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, model.value().get(0).hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("dcfhucqdpf", model.value().get(0).interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV6, model.value().get(0).ipAllocationType()); - Assertions.assertEquals("sbjjc", model.value().get(0).ipv4ConnectedPrefix()); - Assertions.assertEquals("vxb", model.value().get(0).ipv6ConnectedPrefix()); - Assertions.assertEquals("t", model.value().get(0).l3IsolationDomainId()); - Assertions.assertEquals(378347416305968829L, model.value().get(0).vlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3NetworkList model - = new L3NetworkList().withNextLink("invkjjxdxrbuu") - .withValue( - Arrays - .asList( - new L3NetworkInner().withLocation("qntorudsgsahmkyc") - .withTags(mapOf("s", "uwjuetaeburuvdmo", "tpuqujmq", "zlxwabmqoefkifr", "jcntuj", - "gkfbtndoaong")) - .withExtendedLocation(new ExtendedLocation().withName("lewyhmlwpaz").withType("zpof")) - .withHybridAksIpamEnabled(HybridAksIpamEnabled.TRUE) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("dcfhucqdpf") - .withIpAllocationType(IpAllocationType.IPV6) - .withIpv4ConnectedPrefix("sbjjc") - .withIpv6ConnectedPrefix("vxb") - .withL3IsolationDomainId("t") - .withVlan(378347416305968829L), - new L3NetworkInner().withLocation("uzkopbminrfd") - .withTags(mapOf("mlmz", "uhhziuiefozbhdm", "ae", "hoftr")) - .withExtendedLocation( - new ExtendedLocation().withName("gszufoxciqopid").withType("amcio")) - .withHybridAksIpamEnabled(HybridAksIpamEnabled.FALSE) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("nfd") - .withIpAllocationType(IpAllocationType.IPV6) - .withIpv4ConnectedPrefix("kgtdlmkkze") - .withIpv6ConnectedPrefix("l") - .withL3IsolationDomainId("ewpusdsttwvogvb") - .withVlan(1523837111721006893L))); - model = BinaryData.fromObject(model).toObject(L3NetworkList.class); - Assertions.assertEquals("invkjjxdxrbuu", model.nextLink()); - Assertions.assertEquals("qntorudsgsahmkyc", model.value().get(0).location()); - Assertions.assertEquals("uwjuetaeburuvdmo", model.value().get(0).tags().get("s")); - Assertions.assertEquals("lewyhmlwpaz", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("zpof", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, model.value().get(0).hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("dcfhucqdpf", model.value().get(0).interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV6, model.value().get(0).ipAllocationType()); - Assertions.assertEquals("sbjjc", model.value().get(0).ipv4ConnectedPrefix()); - Assertions.assertEquals("vxb", model.value().get(0).ipv6ConnectedPrefix()); - Assertions.assertEquals("t", model.value().get(0).l3IsolationDomainId()); - Assertions.assertEquals(378347416305968829L, model.value().get(0).vlan()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPatchParametersTests.java deleted file mode 100644 index f81d8ea656231..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPatchParametersTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3NetworkPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3NetworkPatchParameters model = BinaryData.fromString("{\"tags\":{\"ycjimryvwgcwwpbm\":\"oafcluqvox\"}}") - .toObject(L3NetworkPatchParameters.class); - Assertions.assertEquals("oafcluqvox", model.tags().get("ycjimryvwgcwwpbm")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3NetworkPatchParameters model - = new L3NetworkPatchParameters().withTags(mapOf("ycjimryvwgcwwpbm", "oafcluqvox")); - model = BinaryData.fromObject(model).toObject(L3NetworkPatchParameters.class); - Assertions.assertEquals("oafcluqvox", model.tags().get("ycjimryvwgcwwpbm")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPropertiesTests.java deleted file mode 100644 index 7d2df014f60c3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworkPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkProperties; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import org.junit.jupiter.api.Assertions; - -public final class L3NetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3NetworkProperties model = BinaryData.fromString( - "{\"associatedResourceIds\":[\"rribd\",\"ibqipqkg\",\"vxndz\"],\"clusterId\":\"krefajpjo\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"nyhgbijtji\",\"hybridAksClustersAssociatedIds\":[\"zs\",\"ab\"],\"hybridAksIpamEnabled\":\"False\",\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"awfsdjpvkvpbjxbk\",\"ipAllocationType\":\"DualStack\",\"ipv4ConnectedPrefix\":\"dvncjabudurgk\",\"ipv6ConnectedPrefix\":\"mokzhjjklf\",\"l3IsolationDomainId\":\"hmouwqlgzrfze\",\"provisioningState\":\"Accepted\",\"virtualMachinesAssociatedIds\":[\"zi\",\"ayuhqlbjbsy\",\"bqwrvtldgm\"],\"vlan\":8878391256590645383}") - .toObject(L3NetworkProperties.class); - Assertions.assertEquals(HybridAksIpamEnabled.FALSE, model.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("awfsdjpvkvpbjxbk", model.interfaceName()); - Assertions.assertEquals(IpAllocationType.DUAL_STACK, model.ipAllocationType()); - Assertions.assertEquals("dvncjabudurgk", model.ipv4ConnectedPrefix()); - Assertions.assertEquals("mokzhjjklf", model.ipv6ConnectedPrefix()); - Assertions.assertEquals("hmouwqlgzrfze", model.l3IsolationDomainId()); - Assertions.assertEquals(8878391256590645383L, model.vlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3NetworkProperties model = new L3NetworkProperties().withHybridAksIpamEnabled(HybridAksIpamEnabled.FALSE) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("awfsdjpvkvpbjxbk") - .withIpAllocationType(IpAllocationType.DUAL_STACK) - .withIpv4ConnectedPrefix("dvncjabudurgk") - .withIpv6ConnectedPrefix("mokzhjjklf") - .withL3IsolationDomainId("hmouwqlgzrfze") - .withVlan(8878391256590645383L); - model = BinaryData.fromObject(model).toObject(L3NetworkProperties.class); - Assertions.assertEquals(HybridAksIpamEnabled.FALSE, model.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("awfsdjpvkvpbjxbk", model.interfaceName()); - Assertions.assertEquals(IpAllocationType.DUAL_STACK, model.ipAllocationType()); - Assertions.assertEquals("dvncjabudurgk", model.ipv4ConnectedPrefix()); - Assertions.assertEquals("mokzhjjklf", model.ipv6ConnectedPrefix()); - Assertions.assertEquals("hmouwqlgzrfze", model.l3IsolationDomainId()); - Assertions.assertEquals(8878391256590645383L, model.vlan()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateMockTests.java deleted file mode 100644 index e71eaa79cead5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import com.azure.resourcemanager.networkcloud.models.L3Network; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class L3NetworksCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"cqoccq\",\"type\":\"qxwetjtd\"},\"properties\":{\"associatedResourceIds\":[\"tfdoadtx\"],\"clusterId\":\"ge\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"k\",\"hybridAksClustersAssociatedIds\":[\"gssz\",\"vctkbbx\"],\"hybridAksIpamEnabled\":\"True\",\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"ir\",\"ipAllocationType\":\"IPV6\",\"ipv4ConnectedPrefix\":\"abvoyngsuxxcz\",\"ipv6ConnectedPrefix\":\"yqjoghdsa\",\"l3IsolationDomainId\":\"djanormo\",\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"rntu\"],\"vlan\":4317600423711221201},\"location\":\"lu\",\"tags\":{\"jue\":\"mhdeeljslkyozdsf\",\"jtv\":\"rhrhtsl\",\"xvgjbfi\":\"j\"},\"id\":\"bpnjodf\",\"name\":\"bj\",\"type\":\"qwm\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L3Network response = manager.l3Networks() - .define("mdtff") - .withRegion("hscozawmvgxsmpk") - .withExistingResourceGroup("azrhxudd") - .withExtendedLocation(new ExtendedLocation().withName("sjmrkkhm").withType("dmdlgyqixokw")) - .withL3IsolationDomainId("uowyrnskbyhqu") - .withVlan(4661928250048503661L) - .withTags(mapOf("wxqouoxudnmc", "irfljf", "oqueqihkkyowltj", "aprhknqiijgencdg")) - .withHybridAksIpamEnabled(HybridAksIpamEnabled.FALSE) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("t") - .withIpAllocationType(IpAllocationType.IPV4) - .withIpv4ConnectedPrefix("cyanrfvqtvkhgv") - .withIpv6ConnectedPrefix("gxkfnaoaqymhccto") - .create(); - - Assertions.assertEquals("lu", response.location()); - Assertions.assertEquals("mhdeeljslkyozdsf", response.tags().get("jue")); - Assertions.assertEquals("cqoccq", response.extendedLocation().name()); - Assertions.assertEquals("qxwetjtd", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, response.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.hybridAksPluginType()); - Assertions.assertEquals("ir", response.interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV6, response.ipAllocationType()); - Assertions.assertEquals("abvoyngsuxxcz", response.ipv4ConnectedPrefix()); - Assertions.assertEquals("yqjoghdsa", response.ipv6ConnectedPrefix()); - Assertions.assertEquals("djanormo", response.l3IsolationDomainId()); - Assertions.assertEquals(4317600423711221201L, response.vlan()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteMockTests.java deleted file mode 100644 index cf23ef4c4a9fd..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 L3NetworksDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.l3Networks().delete("yjmqrf", "iocuselqkr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 153e47ae4738d..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import com.azure.resourcemanager.networkcloud.models.L3Network; -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 L3NetworksGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"lvgecpwgoljtz\",\"type\":\"nm\"},\"properties\":{\"associatedResourceIds\":[\"obygoo\",\"xqapjxvazyjfucsa\",\"djnosdkvibf\",\"sgm\"],\"clusterId\":\"rnzpducdaak\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"tzboim\",\"hybridAksClustersAssociatedIds\":[\"qdowkppnwyytfv\",\"ct\",\"jikffffgkuhznw\"],\"hybridAksIpamEnabled\":\"True\",\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"kke\",\"ipAllocationType\":\"DualStack\",\"ipv4ConnectedPrefix\":\"igaw\",\"ipv6ConnectedPrefix\":\"zmxjqif\",\"l3IsolationDomainId\":\"ujjs\",\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"aahzbhuroolkol\",\"rhhmojusu\",\"gfjzcvaax\",\"ia\"],\"vlan\":721254946919185861},\"location\":\"xw\",\"tags\":{\"kczynuhhoqeqsh\":\"kdxkuk\",\"q\":\"vl\",\"nthbbnkgzukwd\":\"xyrqo\"},\"id\":\"nzkjthfceyjn\",\"name\":\"jmlfuyfjbp\",\"type\":\"iddhlrufzc\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L3Network response = manager.l3Networks() - .getByResourceGroupWithResponse("xo", "krvfsxxbydes", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xw", response.location()); - Assertions.assertEquals("kdxkuk", response.tags().get("kczynuhhoqeqsh")); - Assertions.assertEquals("lvgecpwgoljtz", response.extendedLocation().name()); - Assertions.assertEquals("nm", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, response.hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.hybridAksPluginType()); - Assertions.assertEquals("kke", response.interfaceName()); - Assertions.assertEquals(IpAllocationType.DUAL_STACK, response.ipAllocationType()); - Assertions.assertEquals("igaw", response.ipv4ConnectedPrefix()); - Assertions.assertEquals("zmxjqif", response.ipv6ConnectedPrefix()); - Assertions.assertEquals("ujjs", response.l3IsolationDomainId()); - Assertions.assertEquals(721254946919185861L, response.vlan()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupMockTests.java deleted file mode 100644 index 6443c050b13a5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import com.azure.resourcemanager.networkcloud.models.L3Network; -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 L3NetworksListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"apeqiscrpil\",\"type\":\"ftr\"},\"properties\":{\"associatedResourceIds\":[\"jdaahuqimldahlfx\",\"muifmuadjnfsn\",\"skiioshjgczetybn\"],\"clusterId\":\"ztlcgc\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"fjvmy\",\"hybridAksClustersAssociatedIds\":[\"ebecuvlbefv\",\"cljkxpyl\"],\"hybridAksIpamEnabled\":\"True\",\"hybridAksPluginType\":\"SRIOV\",\"interfaceName\":\"wpsyxjij\",\"ipAllocationType\":\"IPV6\",\"ipv4ConnectedPrefix\":\"vrbkerdkdkgaw\",\"ipv6ConnectedPrefix\":\"jxildfkcef\",\"l3IsolationDomainId\":\"ygzqpjoisfmn\",\"provisioningState\":\"Accepted\",\"virtualMachinesAssociatedIds\":[\"nxumentqo\",\"tw\",\"ymxymu\"],\"vlan\":2243722311789555333},\"location\":\"qtow\",\"tags\":{\"ajcywhjqw\":\"sycoybajasqub\",\"ymjzpwdlvwtiws\":\"chqohtfxcpupuk\"},\"id\":\"osaonhqnamppu\",\"name\":\"tassaekewna\",\"type\":\"eajbkajlcyizyddc\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.l3Networks().listByResourceGroup("xcbccwkqmt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qtow", response.iterator().next().location()); - Assertions.assertEquals("sycoybajasqub", response.iterator().next().tags().get("ajcywhjqw")); - Assertions.assertEquals("apeqiscrpil", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("ftr", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, response.iterator().next().hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.SRIOV, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("wpsyxjij", response.iterator().next().interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV6, response.iterator().next().ipAllocationType()); - Assertions.assertEquals("vrbkerdkdkgaw", response.iterator().next().ipv4ConnectedPrefix()); - Assertions.assertEquals("jxildfkcef", response.iterator().next().ipv6ConnectedPrefix()); - Assertions.assertEquals("ygzqpjoisfmn", response.iterator().next().l3IsolationDomainId()); - Assertions.assertEquals(2243722311789555333L, response.iterator().next().vlan()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListMockTests.java deleted file mode 100644 index 4dd4346447a54..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.IpAllocationType; -import com.azure.resourcemanager.networkcloud.models.L3Network; -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 L3NetworksListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"jgcq\",\"type\":\"ulynkgfcfd\"},\"properties\":{\"associatedResourceIds\":[\"si\",\"xxtclhuulri\",\"byokvjgbzsxe\",\"rsltt\"],\"clusterId\":\"hcdjwsuoardnagt\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"pbpgnrholhujbfwx\",\"hybridAksClustersAssociatedIds\":[\"kysolsyjprxs\",\"whdmcvhtbbz\",\"hfvhuwzbxpcqz\"],\"hybridAksIpamEnabled\":\"True\",\"hybridAksPluginType\":\"SRIOV\",\"interfaceName\":\"ecohm\",\"ipAllocationType\":\"IPV6\",\"ipv4ConnectedPrefix\":\"rrskapbxwieexuy\",\"ipv6ConnectedPrefix\":\"erltfokyk\",\"l3IsolationDomainId\":\"yimyccgrvk\",\"provisioningState\":\"Failed\",\"virtualMachinesAssociatedIds\":[\"nuif\",\"rsejegprkj\",\"uw\"],\"vlan\":5307933336729466171},\"location\":\"vvbtuqkxx\",\"tags\":{\"ekotjgxi\":\"gxql\",\"by\":\"qfkyfhiwvjaqu\"},\"id\":\"nvskpaj\",\"name\":\"mgeu\",\"type\":\"exmj\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.l3Networks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vvbtuqkxx", response.iterator().next().location()); - Assertions.assertEquals("gxql", response.iterator().next().tags().get("ekotjgxi")); - Assertions.assertEquals("jgcq", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("ulynkgfcfd", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksIpamEnabled.TRUE, response.iterator().next().hybridAksIpamEnabled()); - Assertions.assertEquals(HybridAksPluginType.SRIOV, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("ecohm", response.iterator().next().interfaceName()); - Assertions.assertEquals(IpAllocationType.IPV6, response.iterator().next().ipAllocationType()); - Assertions.assertEquals("rrskapbxwieexuy", response.iterator().next().ipv4ConnectedPrefix()); - Assertions.assertEquals("erltfokyk", response.iterator().next().ipv6ConnectedPrefix()); - Assertions.assertEquals("yimyccgrvk", response.iterator().next().l3IsolationDomainId()); - Assertions.assertEquals(5307933336729466171L, response.iterator().next().vlan()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/LldpNeighborTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/LldpNeighborTests.java deleted file mode 100644 index 24e6a43127a6b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/LldpNeighborTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.LldpNeighbor; - -public final class LldpNeighborTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LldpNeighbor model = BinaryData.fromString( - "{\"portDescription\":\"ozwyiftyhxhuro\",\"portName\":\"tyxolniwpwc\",\"systemDescription\":\"jfkgiawxk\",\"systemName\":\"ypl\"}") - .toObject(LldpNeighbor.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LldpNeighbor model = new LldpNeighbor(); - model = BinaryData.fromObject(model).toObject(LldpNeighbor.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineDiskTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineDiskTests.java deleted file mode 100644 index dffd4fa4fb8a5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineDiskTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.MachineDisk; - -public final class MachineDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineDisk model - = BinaryData.fromString("{\"capacityGB\":7660460034004399095,\"connection\":\"SAS\",\"type\":\"HDD\"}") - .toObject(MachineDisk.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineDisk model = new MachineDisk(); - model = BinaryData.fromObject(model).toObject(MachineDisk.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuPropertiesTests.java deleted file mode 100644 index e862c9d6069f1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.MachineSkuProperties; - -public final class MachineSkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineSkuProperties model = BinaryData.fromString( - "{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":5344178861543099367,\"cpuSockets\":539445643734318038,\"disks\":[{\"capacityGB\":5962561191870222416,\"connection\":\"PCIE\",\"type\":\"HDD\"}],\"generation\":\"te\",\"hardwareVersion\":\"bfhjxakvvjgsl\",\"memoryCapacityGB\":7061120771289849082,\"model\":\"mywwtkgkxnyed\",\"networkInterfaces\":[{\"address\":\"vudtjuewbcihx\",\"deviceConnectionType\":\"PCI\",\"model\":\"c\",\"physicalSlot\":8836529440782745734,\"portCount\":6013611534399993244,\"portSpeed\":8334210528088520370,\"vendor\":\"akkud\"},{\"address\":\"xgwjplmagstcyoh\",\"deviceConnectionType\":\"PCI\",\"model\":\"rkdbdgiogsjkmnwq\",\"physicalSlot\":6833853370140143589,\"portCount\":7156428016747730929,\"portSpeed\":8649178950235367695,\"vendor\":\"iacegfnmn\"},{\"address\":\"pmvmemfnczdwvv\",\"deviceConnectionType\":\"PCI\",\"model\":\"lllchpodb\",\"physicalSlot\":5385185048993104627,\"portCount\":6308319060236104883,\"portSpeed\":9209137872063887003,\"vendor\":\"uvsj\"}],\"totalThreads\":5391692794732202921,\"vendor\":\"ystuluqyp\"}") - .toObject(MachineSkuProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineSkuProperties model = new MachineSkuProperties(); - model = BinaryData.fromObject(model).toObject(MachineSkuProperties.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuSlotTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuSlotTests.java deleted file mode 100644 index 22cc6c8b712a0..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MachineSkuSlotTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.MachineSkuSlot; - -public final class MachineSkuSlotTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineSkuSlot model = BinaryData.fromString( - "{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":1730397083607764400,\"cpuSockets\":1355589981905865952,\"disks\":[{\"capacityGB\":5917251343624011044,\"connection\":\"SAS\",\"type\":\"SSD\"},{\"capacityGB\":701253968154567119,\"connection\":\"SATA\",\"type\":\"HDD\"},{\"capacityGB\":2436750194722502720,\"connection\":\"SATA\",\"type\":\"SSD\"},{\"capacityGB\":719962312435402077,\"connection\":\"PCIE\",\"type\":\"SSD\"}],\"generation\":\"vcimpev\",\"hardwareVersion\":\"mblrrilbywd\",\"memoryCapacityGB\":7966238893835264976,\"model\":\"cwrwfs\",\"networkInterfaces\":[{\"address\":\"ynszquji\",\"deviceConnectionType\":\"PCI\",\"model\":\"qytibyowbblgyavu\",\"physicalSlot\":805790317647492283,\"portCount\":4755130771240532697,\"portSpeed\":7556520283137175372,\"vendor\":\"sks\"},{\"address\":\"iml\",\"deviceConnectionType\":\"PCI\",\"model\":\"xkcgxxlxsffgcvi\",\"physicalSlot\":7820266969815650707,\"portCount\":119708849241442138,\"portSpeed\":4065902188543936050,\"vendor\":\"upfgfbk\"},{\"address\":\"bdyhgkfminsgowz\",\"deviceConnectionType\":\"PCI\",\"model\":\"ttktlahbq\",\"physicalSlot\":2084936073486724926,\"portCount\":509106189483608352,\"portSpeed\":6973172084017938197,\"vendor\":\"tmmqtgqqqxhrn\"},{\"address\":\"xcpjuisavokqdzf\",\"deviceConnectionType\":\"PCI\",\"model\":\"vjlfrqtt\",\"physicalSlot\":915528800737751942,\"portCount\":1448856954480483873,\"portSpeed\":3281733425649589029,\"vendor\":\"iopid\"}],\"totalThreads\":4942011391135790969,\"vendor\":\"uvscxkdmligov\"},\"rackSlot\":6633389496653532566}") - .toObject(MachineSkuSlot.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineSkuSlot model = new MachineSkuSlot(); - model = BinaryData.fromObject(model).toObject(MachineSkuSlot.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ManagedResourceGroupConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ManagedResourceGroupConfigurationTests.java deleted file mode 100644 index 22b3e85f35c03..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ManagedResourceGroupConfigurationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ManagedResourceGroupConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedResourceGroupConfiguration model = BinaryData.fromString("{\"location\":\"bgyepsbj\",\"name\":\"zq\"}") - .toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("bgyepsbj", model.location()); - Assertions.assertEquals("zq", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedResourceGroupConfiguration model - = new ManagedResourceGroupConfiguration().withLocation("bgyepsbj").withName("zq"); - model = BinaryData.fromObject(model).toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("bgyepsbj", model.location()); - Assertions.assertEquals("zq", model.name()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index b6fd6ebdd4f8f..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MetricsConfigurationsCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"w\",\"type\":\"ch\"},\"properties\":{\"collectionInterval\":5033961721581707117,\"detailedStatus\":\"Applied\",\"detailedStatusMessage\":\"kshfy\",\"disabledMetrics\":[\"ibjepzwhj\"],\"enabledMetrics\":[\"dgbggcjxzh\",\"livwehsud\",\"mymbhdosmbng\",\"q\"],\"provisioningState\":\"Succeeded\"},\"location\":\"duvxd\",\"tags\":{\"mnrs\":\"xatm\",\"dmiplois\":\"nxoirxy\",\"ntwgkvyo\":\"kzsoxz\"},\"id\":\"psapzu\",\"name\":\"zwwy\",\"type\":\"bdjzghximkg\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterMetricsConfiguration response = manager.metricsConfigurations() - .define("gwn") - .withRegion("svkkjbjolpyokl") - .withExistingCluster("udayprldidwmtf", "bvtzldzchub") - .withExtendedLocation(new ExtendedLocation().withName("zuvigvl").withType("hfrbzakpjt")) - .withCollectionInterval(735504182529978592L) - .withTags(mapOf("hmlieoigowxxb", "znad", "qe", "tpsyi", "wanvmwdvgjqcrbko", "qwtqszzgyksik")) - .withEnabledMetrics(Arrays.asList("bgngcrusxhirc")) - .create(); - - Assertions.assertEquals("duvxd", response.location()); - Assertions.assertEquals("xatm", response.tags().get("mnrs")); - Assertions.assertEquals("w", response.extendedLocation().name()); - Assertions.assertEquals("ch", response.extendedLocation().type()); - Assertions.assertEquals(5033961721581707117L, response.collectionInterval()); - Assertions.assertEquals("dgbggcjxzh", response.enabledMetrics().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteMockTests.java deleted file mode 100644 index d999917423b88..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 MetricsConfigurationsDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.metricsConfigurations().delete("rdw", "ejpec", "zvcmbpwd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 7a0902eeb0267..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; -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 MetricsConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"extendedLocation\":{\"name\":\"mjqmv\",\"type\":\"tgkiqlarh\"},\"properties\":{\"collectionInterval\":2364228009961683427,\"detailedStatus\":\"Processing\",\"detailedStatusMessage\":\"zekdzdzffzj\",\"disabledMetrics\":[\"smpc\",\"ggr\"],\"enabledMetrics\":[\"gfyatig\"],\"provisioningState\":\"Failed\"},\"location\":\"r\",\"tags\":{\"vmd\":\"nczgorywnvoj\",\"pyhssrlvkpkpkoc\":\"vdlhqvbkar\",\"ebxxopyic\":\"ac\",\"cpumdd\":\"vspeslhwyykgvr\"},\"id\":\"gajkrdyddtpfcud\",\"name\":\"afnbfbqve\",\"type\":\"qnxhgk\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterMetricsConfiguration response = manager.metricsConfigurations() - .getWithResponse("xwbpwyykdig", "zlrz", "dasdni", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("r", response.location()); - Assertions.assertEquals("nczgorywnvoj", response.tags().get("vmd")); - Assertions.assertEquals("mjqmv", response.extendedLocation().name()); - Assertions.assertEquals("tgkiqlarh", response.extendedLocation().type()); - Assertions.assertEquals(2364228009961683427L, response.collectionInterval()); - Assertions.assertEquals("gfyatig", response.enabledMetrics().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterMockTests.java deleted file mode 100644 index 489b3533b9953..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByClusterMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; -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 MetricsConfigurationsListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"extendedLocation\":{\"name\":\"qvcml\",\"type\":\"exbzbqufpnezsjza\"},\"properties\":{\"collectionInterval\":1012603329347113753,\"detailedStatus\":\"Processing\",\"detailedStatusMessage\":\"r\",\"disabledMetrics\":[\"gzmsimehtc\",\"uwdhtq\",\"hyhnimxtns\",\"gi\"],\"enabledMetrics\":[\"mwnwnghojovkey\"],\"provisioningState\":\"Accepted\"},\"location\":\"jixxfsfpcrtn\",\"tags\":{\"ijte\":\"efx\",\"cnw\":\"dveywetkrhlol\",\"tlrnrdet\":\"pfgsvbbvaqdljnp\",\"e\":\"wevxeh\"},\"id\":\"dxljzvdovbrble\",\"name\":\"lprdaqccddcbnygd\",\"type\":\"c\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.metricsConfigurations().listByCluster("xwwvcmmpeg", "y", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jixxfsfpcrtn", response.iterator().next().location()); - Assertions.assertEquals("efx", response.iterator().next().tags().get("ijte")); - Assertions.assertEquals("qvcml", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("exbzbqufpnezsjza", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(1012603329347113753L, response.iterator().next().collectionInterval()); - Assertions.assertEquals("mwnwnghojovkey", response.iterator().next().enabledMetrics().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkAttachmentTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkAttachmentTests.java deleted file mode 100644 index e85f56bfe17eb..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkAttachmentTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.DefaultGateway; -import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; -import com.azure.resourcemanager.networkcloud.models.VirtualMachineIpAllocationMethod; -import org.junit.jupiter.api.Assertions; - -public final class NetworkAttachmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkAttachment model = BinaryData.fromString( - "{\"attachedNetworkId\":\"hjpglkf\",\"defaultGateway\":\"False\",\"ipAllocationMethod\":\"Static\",\"ipv4Address\":\"euel\",\"ipv6Address\":\"hsd\",\"macAddress\":\"t\",\"networkAttachmentName\":\"fikdowwqu\"}") - .toObject(NetworkAttachment.class); - Assertions.assertEquals("hjpglkf", model.attachedNetworkId()); - Assertions.assertEquals(DefaultGateway.FALSE, model.defaultGateway()); - Assertions.assertEquals(VirtualMachineIpAllocationMethod.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("euel", model.ipv4Address()); - Assertions.assertEquals("hsd", model.ipv6Address()); - Assertions.assertEquals("fikdowwqu", model.networkAttachmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkAttachment model = new NetworkAttachment().withAttachedNetworkId("hjpglkf") - .withDefaultGateway(DefaultGateway.FALSE) - .withIpAllocationMethod(VirtualMachineIpAllocationMethod.STATIC) - .withIpv4Address("euel") - .withIpv6Address("hsd") - .withNetworkAttachmentName("fikdowwqu"); - model = BinaryData.fromObject(model).toObject(NetworkAttachment.class); - Assertions.assertEquals("hjpglkf", model.attachedNetworkId()); - Assertions.assertEquals(DefaultGateway.FALSE, model.defaultGateway()); - Assertions.assertEquals(VirtualMachineIpAllocationMethod.STATIC, model.ipAllocationMethod()); - Assertions.assertEquals("euel", model.ipv4Address()); - Assertions.assertEquals("hsd", model.ipv6Address()); - Assertions.assertEquals("fikdowwqu", model.networkAttachmentName()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkInterfaceTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkInterfaceTests.java deleted file mode 100644 index f24191190b53c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NetworkInterfaceTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.NetworkInterface; - -public final class NetworkInterfaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterface model = BinaryData.fromString( - "{\"address\":\"qbmfpjbabwidf\",\"deviceConnectionType\":\"PCI\",\"model\":\"puunnoxyhkxgqd\",\"physicalSlot\":944157000221842248,\"portCount\":5806792787635363155,\"portSpeed\":5765762750940696001,\"vendor\":\"a\"}") - .toObject(NetworkInterface.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterface model = new NetworkInterface(); - model = BinaryData.fromObject(model).toObject(NetworkInterface.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NicTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NicTests.java deleted file mode 100644 index 372932a4ad7ab..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/NicTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.Nic; - -public final class NicTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Nic model = BinaryData.fromString( - "{\"lldpNeighbor\":{\"portDescription\":\"jfeusnh\",\"portName\":\"je\",\"systemDescription\":\"mrldhu\",\"systemName\":\"zzd\"},\"macAddress\":\"qxhocdgeablgphut\",\"name\":\"ndv\"}") - .toObject(Nic.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Nic model = new Nic(); - model = BinaryData.fromObject(model).toObject(Nic.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationDisplayTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationDisplayTests.java deleted file mode 100644 index 2eaf21cfe9fcc..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationInnerTests.java deleted file mode 100644 index 70835e2a94b06..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; -import com.azure.resourcemanager.networkcloud.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationListResultTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationListResultTests.java deleted file mode 100644 index 4a869218698b3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationStatusResultInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationStatusResultInnerTests.java deleted file mode 100644 index 24d111d9395e8..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationStatusResultInnerTests.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.OperationStatusResultInner; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationStatusResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationStatusResultInner model = BinaryData.fromString( - "{\"id\":\"mcjn\",\"resourceId\":\"qdqx\",\"name\":\"jw\",\"status\":\"nyfusfzsvtuikzh\",\"percentComplete\":97.57446,\"startTime\":\"2021-03-17T22:07:36Z\",\"endTime\":\"2021-03-11T22:00:52Z\",\"operations\":[{\"id\":\"rqryxynqn\",\"resourceId\":\"dpsovwxznptgo\",\"name\":\"ybbabpfhvfsl\",\"status\":\"vntjlrigjk\",\"percentComplete\":19.841623,\"startTime\":\"2021-08-21T05:50:17Z\",\"endTime\":\"2021-02-22T17:46:16Z\",\"operations\":[{\"id\":\"dsxwaab\",\"resourceId\":\"ifrygzn\",\"name\":\"axri\",\"status\":\"kzobgopxlhsln\",\"percentComplete\":73.85414,\"startTime\":\"2021-05-24T14:46:14Z\",\"endTime\":\"2021-01-25T13:08:28Z\",\"operations\":[{\"status\":\"llxecwc\"},{\"status\":\"ojphslhc\"}]}]},{\"id\":\"tifdwfmvi\",\"resourceId\":\"rqjb\",\"name\":\"zhraglkafh\",\"status\":\"n\",\"percentComplete\":41.36698,\"startTime\":\"2021-12-07T11:29:57Z\",\"endTime\":\"2021-06-22T12:59:46Z\",\"operations\":[{\"id\":\"vcpopmxe\",\"resourceId\":\"wcltyjede\",\"name\":\"mlfmkqs\",\"status\":\"azuawx\",\"percentComplete\":0.3758669,\"startTime\":\"2021-01-18T18:15:51Z\",\"endTime\":\"2021-05-20T10:02:10Z\",\"operations\":[{\"status\":\"bzxrvxcushsphai\"},{\"status\":\"mxyasflvgsgzw\"},{\"status\":\"wakoihkn\"},{\"status\":\"mjblmljhlny\"}]},{\"id\":\"tqyryuzcbmqqv\",\"resourceId\":\"vwf\",\"name\":\"ayxonsupeujl\",\"status\":\"qnhcvsqltnzoibg\",\"percentComplete\":21.69999,\"startTime\":\"2021-03-11T11:00:33Z\",\"endTime\":\"2021-08-07T07:11:11Z\",\"operations\":[{\"status\":\"nmpqoxwdofdb\"},{\"status\":\"iqxeiiqbimht\"},{\"status\":\"wwinhehf\"}]},{\"id\":\"fvwbcb\",\"resourceId\":\"mbnkb\",\"name\":\"qvxkd\",\"status\":\"vqihebwtswbzuwf\",\"percentComplete\":34.457104,\"startTime\":\"2021-04-25T12:17:15Z\",\"endTime\":\"2021-01-25T01:53:42Z\",\"operations\":[{\"status\":\"zvcjfelisdjubggb\"},{\"status\":\"igkxkbsazga\"}]},{\"id\":\"cyrcmjdmspo\",\"resourceId\":\"pv\",\"name\":\"rylniofrzg\",\"status\":\"zjedmstkvnlv\",\"percentComplete\":2.6657462,\"startTime\":\"2021-02-07T05:40:32Z\",\"endTime\":\"2021-08-21T17:03:38Z\",\"operations\":[{\"status\":\"twfans\"},{\"status\":\"v\"}]}]},{\"id\":\"mik\",\"resourceId\":\"tbzbkiwbuqnyophz\",\"name\":\"l\",\"status\":\"gcrpfbcun\",\"percentComplete\":69.6509,\"startTime\":\"2021-03-22T15:20:36Z\",\"endTime\":\"2021-06-16T02:10:41Z\",\"operations\":[{\"id\":\"yfwlwxjwet\",\"resourceId\":\"sihclafzvaylp\",\"name\":\"sqqw\",\"status\":\"tcmwqkchc\",\"percentComplete\":24.182432,\"startTime\":\"2021-03-27T13:01:29Z\",\"endTime\":\"2021-10-21T01:45:32Z\",\"operations\":[{\"status\":\"kjexfdeqvhp\"},{\"status\":\"ylkkshkbffmbm\"}]},{\"id\":\"rgywwp\",\"resourceId\":\"xs\",\"name\":\"tf\",\"status\":\"jgicgaao\",\"percentComplete\":54.031826,\"startTime\":\"2021-07-31T03:17:47Z\",\"endTime\":\"2021-04-02T22:27:46Z\",\"operations\":[{\"status\":\"ewemxs\"},{\"status\":\"vru\"},{\"status\":\"nz\"}]},{\"id\":\"ehkfkimrtixok\",\"resourceId\":\"qyinl\",\"name\":\"epqw\",\"status\":\"ixmonstshiyxg\",\"percentComplete\":35.385735,\"startTime\":\"2021-09-10T16:03:17Z\",\"endTime\":\"2021-07-06T17:30:57Z\",\"operations\":[{\"status\":\"cb\"}]}]}]}") - .toObject(OperationStatusResultInner.class); - Assertions.assertEquals("mcjn", model.id()); - Assertions.assertEquals("jw", model.name()); - Assertions.assertEquals("nyfusfzsvtuikzh", model.status()); - Assertions.assertEquals(97.57446F, model.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T22:07:36Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T22:00:52Z"), model.endTime()); - Assertions.assertEquals("rqryxynqn", model.operations().get(0).id()); - Assertions.assertEquals("ybbabpfhvfsl", model.operations().get(0).name()); - Assertions.assertEquals("vntjlrigjk", model.operations().get(0).status()); - Assertions.assertEquals(19.841623F, model.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T05:50:17Z"), model.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-22T17:46:16Z"), model.operations().get(0).endTime()); - Assertions.assertEquals("dsxwaab", model.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("axri", model.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("kzobgopxlhsln", model.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(73.85414F, model.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T14:46:14Z"), - model.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T13:08:28Z"), - model.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("llxecwc", model.operations().get(0).operations().get(0).operations().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationStatusResultInner model = new OperationStatusResultInner().withId("mcjn") - .withName("jw") - .withStatus("nyfusfzsvtuikzh") - .withPercentComplete(97.57446F) - .withStartTime(OffsetDateTime.parse("2021-03-17T22:07:36Z")) - .withEndTime(OffsetDateTime.parse("2021-03-11T22:00:52Z")) - .withOperations(Arrays.asList( - new OperationStatusResultInner().withId("rqryxynqn") - .withName("ybbabpfhvfsl") - .withStatus("vntjlrigjk") - .withPercentComplete(19.841623F) - .withStartTime(OffsetDateTime.parse("2021-08-21T05:50:17Z")) - .withEndTime(OffsetDateTime.parse("2021-02-22T17:46:16Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withId("dsxwaab") - .withName("axri") - .withStatus("kzobgopxlhsln") - .withPercentComplete(73.85414F) - .withStartTime(OffsetDateTime.parse("2021-05-24T14:46:14Z")) - .withEndTime(OffsetDateTime.parse("2021-01-25T13:08:28Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("llxecwc"), - new OperationStatusResultInner().withStatus("ojphslhc"))))), - new OperationStatusResultInner().withId("tifdwfmvi") - .withName("zhraglkafh") - .withStatus("n") - .withPercentComplete(41.36698F) - .withStartTime(OffsetDateTime.parse("2021-12-07T11:29:57Z")) - .withEndTime(OffsetDateTime.parse("2021-06-22T12:59:46Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withId("vcpopmxe") - .withName("mlfmkqs") - .withStatus("azuawx") - .withPercentComplete(0.3758669F) - .withStartTime(OffsetDateTime.parse("2021-01-18T18:15:51Z")) - .withEndTime(OffsetDateTime.parse("2021-05-20T10:02:10Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("bzxrvxcushsphai"), - new OperationStatusResultInner().withStatus("mxyasflvgsgzw"), - new OperationStatusResultInner().withStatus("wakoihkn"), - new OperationStatusResultInner().withStatus("mjblmljhlny"))), - new OperationStatusResultInner().withId("tqyryuzcbmqqv") - .withName("ayxonsupeujl") - .withStatus("qnhcvsqltnzoibg") - .withPercentComplete(21.69999F) - .withStartTime(OffsetDateTime.parse("2021-03-11T11:00:33Z")) - .withEndTime(OffsetDateTime.parse("2021-08-07T07:11:11Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("nmpqoxwdofdb"), - new OperationStatusResultInner().withStatus("iqxeiiqbimht"), - new OperationStatusResultInner().withStatus("wwinhehf"))), - new OperationStatusResultInner().withId("fvwbcb") - .withName("qvxkd") - .withStatus("vqihebwtswbzuwf") - .withPercentComplete(34.457104F) - .withStartTime(OffsetDateTime.parse("2021-04-25T12:17:15Z")) - .withEndTime(OffsetDateTime.parse("2021-01-25T01:53:42Z")) - .withOperations( - Arrays.asList(new OperationStatusResultInner().withStatus("zvcjfelisdjubggb"), - new OperationStatusResultInner().withStatus("igkxkbsazga"))), - new OperationStatusResultInner().withId("cyrcmjdmspo") - .withName("rylniofrzg") - .withStatus("zjedmstkvnlv") - .withPercentComplete(2.6657462F) - .withStartTime(OffsetDateTime.parse("2021-02-07T05:40:32Z")) - .withEndTime(OffsetDateTime.parse("2021-08-21T17:03:38Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("twfans"), - new OperationStatusResultInner().withStatus("v"))))), - new OperationStatusResultInner().withId("mik") - .withName("l") - .withStatus("gcrpfbcun") - .withPercentComplete(69.6509F) - .withStartTime(OffsetDateTime.parse("2021-03-22T15:20:36Z")) - .withEndTime(OffsetDateTime.parse("2021-06-16T02:10:41Z")) - .withOperations(Arrays.asList( - new OperationStatusResultInner().withId("yfwlwxjwet") - .withName("sqqw") - .withStatus("tcmwqkchc") - .withPercentComplete(24.182432F) - .withStartTime(OffsetDateTime.parse("2021-03-27T13:01:29Z")) - .withEndTime(OffsetDateTime.parse("2021-10-21T01:45:32Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("kjexfdeqvhp"), - new OperationStatusResultInner().withStatus("ylkkshkbffmbm"))), - new OperationStatusResultInner().withId("rgywwp") - .withName("tf") - .withStatus("jgicgaao") - .withPercentComplete(54.031826F) - .withStartTime(OffsetDateTime.parse("2021-07-31T03:17:47Z")) - .withEndTime(OffsetDateTime.parse("2021-04-02T22:27:46Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("ewemxs"), - new OperationStatusResultInner().withStatus("vru"), - new OperationStatusResultInner().withStatus("nz"))), - new OperationStatusResultInner().withId("ehkfkimrtixok") - .withName("epqw") - .withStatus("ixmonstshiyxg") - .withPercentComplete(35.385735F) - .withStartTime(OffsetDateTime.parse("2021-09-10T16:03:17Z")) - .withEndTime(OffsetDateTime.parse("2021-07-06T17:30:57Z")) - .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("cb"))))))); - model = BinaryData.fromObject(model).toObject(OperationStatusResultInner.class); - Assertions.assertEquals("mcjn", model.id()); - Assertions.assertEquals("jw", model.name()); - Assertions.assertEquals("nyfusfzsvtuikzh", model.status()); - Assertions.assertEquals(97.57446F, model.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T22:07:36Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T22:00:52Z"), model.endTime()); - Assertions.assertEquals("rqryxynqn", model.operations().get(0).id()); - Assertions.assertEquals("ybbabpfhvfsl", model.operations().get(0).name()); - Assertions.assertEquals("vntjlrigjk", model.operations().get(0).status()); - Assertions.assertEquals(19.841623F, model.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T05:50:17Z"), model.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-22T17:46:16Z"), model.operations().get(0).endTime()); - Assertions.assertEquals("dsxwaab", model.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("axri", model.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("kzobgopxlhsln", model.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(73.85414F, model.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T14:46:14Z"), - model.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T13:08:28Z"), - model.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("llxecwc", model.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationsListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationsListMockTests.java deleted file mode 100644 index 8cbd6c69461c4..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OperationsListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.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\":\"mzlanru\",\"isDataAction\":false,\"display\":{\"provider\":\"phcnzqtpj\",\"resource\":\"qrhvthlaiwdcxsml\",\"operation\":\"hzdtxetlgydlh\",\"description\":\"lnnpx\"},\"origin\":\"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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OsDiskTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OsDiskTests.java deleted file mode 100644 index 2ffbb084afa9c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/OsDiskTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.OsDisk; -import com.azure.resourcemanager.networkcloud.models.OsDiskCreateOption; -import com.azure.resourcemanager.networkcloud.models.OsDiskDeleteOption; -import org.junit.jupiter.api.Assertions; - -public final class OsDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OsDisk model = BinaryData - .fromString( - "{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":4536236454028205710}") - .toObject(OsDisk.class); - Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.createOption()); - Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.deleteOption()); - Assertions.assertEquals(4536236454028205710L, model.diskSizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OsDisk model = new OsDisk().withCreateOption(OsDiskCreateOption.EPHEMERAL) - .withDeleteOption(OsDiskDeleteOption.DELETE) - .withDiskSizeGB(4536236454028205710L); - model = BinaryData.fromObject(model).toObject(OsDisk.class); - Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.createOption()); - Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.deleteOption()); - Assertions.assertEquals(4536236454028205710L, model.diskSizeGB()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackInnerTests.java deleted file mode 100644 index 476dc32ab0ceb..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RackInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"fsbtkad\",\"type\":\"ysownbtgkbug\"},\"properties\":{\"availabilityZone\":\"jqctojcmisofie\",\"clusterId\":\"efojyqdhcupl\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"wkhihihlhzdsqt\",\"provisioningState\":\"Accepted\",\"rackLocation\":\"rgnowcjhfgm\",\"rackSerialNumber\":\"ecactx\",\"rackSkuId\":\"wotey\"},\"location\":\"cluqovekqvgqo\",\"tags\":{\"kfxcvhrfs\":\"fzmpjwyivq\",\"kvyklxubyjaffmm\":\"huagrttikteusqc\",\"qcuubgqibrta\":\"bl\"},\"id\":\"metttwgd\",\"name\":\"lqxihhrmooiz\",\"type\":\"seypxiutcxapz\"}") - .toObject(RackInner.class); - Assertions.assertEquals("cluqovekqvgqo", model.location()); - Assertions.assertEquals("fzmpjwyivq", model.tags().get("kfxcvhrfs")); - Assertions.assertEquals("fsbtkad", model.extendedLocation().name()); - Assertions.assertEquals("ysownbtgkbug", model.extendedLocation().type()); - Assertions.assertEquals("jqctojcmisofie", model.availabilityZone()); - Assertions.assertEquals("rgnowcjhfgm", model.rackLocation()); - Assertions.assertEquals("ecactx", model.rackSerialNumber()); - Assertions.assertEquals("wotey", model.rackSkuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackInner model = new RackInner().withLocation("cluqovekqvgqo") - .withTags(mapOf("kfxcvhrfs", "fzmpjwyivq", "kvyklxubyjaffmm", "huagrttikteusqc", "qcuubgqibrta", "bl")) - .withExtendedLocation(new ExtendedLocation().withName("fsbtkad").withType("ysownbtgkbug")) - .withAvailabilityZone("jqctojcmisofie") - .withRackLocation("rgnowcjhfgm") - .withRackSerialNumber("ecactx") - .withRackSkuId("wotey"); - model = BinaryData.fromObject(model).toObject(RackInner.class); - Assertions.assertEquals("cluqovekqvgqo", model.location()); - Assertions.assertEquals("fzmpjwyivq", model.tags().get("kfxcvhrfs")); - Assertions.assertEquals("fsbtkad", model.extendedLocation().name()); - Assertions.assertEquals("ysownbtgkbug", model.extendedLocation().type()); - Assertions.assertEquals("jqctojcmisofie", model.availabilityZone()); - Assertions.assertEquals("rgnowcjhfgm", model.rackLocation()); - Assertions.assertEquals("ecactx", model.rackSerialNumber()); - Assertions.assertEquals("wotey", model.rackSkuId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackListTests.java deleted file mode 100644 index 6ddd19b0e6d00..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackListTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.RackList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RackListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackList model = BinaryData.fromString( - "{\"nextLink\":\"onbzoggculapzwy\",\"value\":[{\"extendedLocation\":{\"name\":\"ogtqxepnylbf\",\"type\":\"ajlyjtlvofqzhv\"},\"properties\":{\"availabilityZone\":\"cib\",\"clusterId\":\"mowuxrk\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"w\",\"provisioningState\":\"Accepted\",\"rackLocation\":\"wiivwzjbhyzsx\",\"rackSerialNumber\":\"rkambt\",\"rackSkuId\":\"negvmnvuqe\"},\"location\":\"lds\",\"tags\":{\"kdmflvestmjlx\":\"tjb\",\"zapeewchpx\":\"ril\",\"levufuztcktyhj\":\"ktwkuziyc\"},\"id\":\"qedcgzulwm\",\"name\":\"rqzz\",\"type\":\"rjvpglydzgkrvqee\"},{\"extendedLocation\":{\"name\":\"toepryu\",\"type\":\"nwy\"},\"properties\":{\"availabilityZone\":\"pzdm\",\"clusterId\":\"zvfvaawz\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"lgzurig\",\"provisioningState\":\"Failed\",\"rackLocation\":\"cx\",\"rackSerialNumber\":\"dticokpvzml\",\"rackSkuId\":\"t\"},\"location\":\"dgxobfircl\",\"tags\":{\"fvjlboxqvkjlmx\":\"ciayzriykhya\",\"nraauzz\":\"omdynhdwdigum\"},\"id\":\"tj\",\"name\":\"zysdzh\",\"type\":\"zwwva\"},{\"extendedLocation\":{\"name\":\"qyuvvfonkp\",\"type\":\"hqyikvy\"},\"properties\":{\"availabilityZone\":\"auy\",\"clusterId\":\"luwmncst\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"y\",\"provisioningState\":\"Succeeded\",\"rackLocation\":\"o\",\"rackSerialNumber\":\"krsgsgb\",\"rackSkuId\":\"huzqgn\"},\"location\":\"gkynscliqh\",\"tags\":{\"ppnvdxz\":\"xnkomtkubo\"},\"id\":\"hihfrbbcevqagtlt\",\"name\":\"hlfkqojpy\",\"type\":\"vgtrdcnifmzzs\"},{\"extendedLocation\":{\"name\":\"ymbrnysuxmpraf\",\"type\":\"g\"},\"properties\":{\"availabilityZone\":\"khocxvdfffwaf\",\"clusterId\":\"oudaspavehhrvk\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"oz\",\"provisioningState\":\"Failed\",\"rackLocation\":\"cxgkmoyxcdyui\",\"rackSerialNumber\":\"hmfdnbzydvfvfcj\",\"rackSkuId\":\"aeoisrvh\"},\"location\":\"orffukiscv\",\"tags\":{\"l\":\"hwplefaxvx\",\"nzeyqxtjj\":\"btgn\",\"vodggxdbee\":\"zqlqhyc\",\"wiuagydwqf\":\"mieknlraria\"},\"id\":\"ylyrfgiagtco\",\"name\":\"ocqwogfnzjvus\",\"type\":\"zldmozuxy\"}]}") - .toObject(RackList.class); - Assertions.assertEquals("onbzoggculapzwy", model.nextLink()); - Assertions.assertEquals("lds", model.value().get(0).location()); - Assertions.assertEquals("tjb", model.value().get(0).tags().get("kdmflvestmjlx")); - Assertions.assertEquals("ogtqxepnylbf", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("ajlyjtlvofqzhv", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("cib", model.value().get(0).availabilityZone()); - Assertions.assertEquals("wiivwzjbhyzsx", model.value().get(0).rackLocation()); - Assertions.assertEquals("rkambt", model.value().get(0).rackSerialNumber()); - Assertions.assertEquals("negvmnvuqe", model.value().get(0).rackSkuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackList model - = new RackList().withNextLink("onbzoggculapzwy") - .withValue( - Arrays - .asList( - new RackInner().withLocation("lds") - .withTags( - mapOf("kdmflvestmjlx", "tjb", "zapeewchpx", "ril", "levufuztcktyhj", "ktwkuziyc")) - .withExtendedLocation( - new ExtendedLocation().withName("ogtqxepnylbf").withType("ajlyjtlvofqzhv")) - .withAvailabilityZone("cib") - .withRackLocation("wiivwzjbhyzsx") - .withRackSerialNumber("rkambt") - .withRackSkuId("negvmnvuqe"), - new RackInner().withLocation("dgxobfircl") - .withTags(mapOf("fvjlboxqvkjlmx", "ciayzriykhya", "nraauzz", "omdynhdwdigum")) - .withExtendedLocation(new ExtendedLocation().withName("toepryu").withType("nwy")) - .withAvailabilityZone("pzdm") - .withRackLocation("cx") - .withRackSerialNumber("dticokpvzml") - .withRackSkuId("t"), - new RackInner().withLocation("gkynscliqh") - .withTags(mapOf("ppnvdxz", "xnkomtkubo")) - .withExtendedLocation(new ExtendedLocation().withName("qyuvvfonkp").withType("hqyikvy")) - .withAvailabilityZone("auy") - .withRackLocation("o") - .withRackSerialNumber("krsgsgb") - .withRackSkuId("huzqgn"), - new RackInner().withLocation("orffukiscv") - .withTags(mapOf("l", "hwplefaxvx", "nzeyqxtjj", "btgn", "vodggxdbee", "zqlqhyc", - "wiuagydwqf", "mieknlraria")) - .withExtendedLocation(new ExtendedLocation().withName("ymbrnysuxmpraf").withType("g")) - .withAvailabilityZone("khocxvdfffwaf") - .withRackLocation("cxgkmoyxcdyui") - .withRackSerialNumber("hmfdnbzydvfvfcj") - .withRackSkuId("aeoisrvh"))); - model = BinaryData.fromObject(model).toObject(RackList.class); - Assertions.assertEquals("onbzoggculapzwy", model.nextLink()); - Assertions.assertEquals("lds", model.value().get(0).location()); - Assertions.assertEquals("tjb", model.value().get(0).tags().get("kdmflvestmjlx")); - Assertions.assertEquals("ogtqxepnylbf", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("ajlyjtlvofqzhv", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("cib", model.value().get(0).availabilityZone()); - Assertions.assertEquals("wiivwzjbhyzsx", model.value().get(0).rackLocation()); - Assertions.assertEquals("rkambt", model.value().get(0).rackSerialNumber()); - Assertions.assertEquals("negvmnvuqe", model.value().get(0).rackSkuId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPatchParametersTests.java deleted file mode 100644 index d77de3b588acd..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPatchParametersTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RackPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackPatchParameters model = BinaryData.fromString( - "{\"properties\":{\"rackLocation\":\"esyds\",\"rackSerialNumber\":\"efoh\"},\"tags\":{\"mtkhlowkxxpvbr\":\"vopwndyqleallk\",\"lhikcyychunsj\":\"fjmzsyzfho\",\"hv\":\"pjrtws\"}}") - .toObject(RackPatchParameters.class); - Assertions.assertEquals("vopwndyqleallk", model.tags().get("mtkhlowkxxpvbr")); - Assertions.assertEquals("esyds", model.rackLocation()); - Assertions.assertEquals("efoh", model.rackSerialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackPatchParameters model = new RackPatchParameters() - .withTags(mapOf("mtkhlowkxxpvbr", "vopwndyqleallk", "lhikcyychunsj", "fjmzsyzfho", "hv", "pjrtws")) - .withRackLocation("esyds") - .withRackSerialNumber("efoh"); - model = BinaryData.fromObject(model).toObject(RackPatchParameters.class); - Assertions.assertEquals("vopwndyqleallk", model.tags().get("mtkhlowkxxpvbr")); - Assertions.assertEquals("esyds", model.rackLocation()); - Assertions.assertEquals("efoh", model.rackSerialNumber()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPropertiesTests.java deleted file mode 100644 index 7a9bc6b72b02a..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackProperties; -import org.junit.jupiter.api.Assertions; - -public final class RackPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackProperties model = BinaryData.fromString( - "{\"availabilityZone\":\"y\",\"clusterId\":\"etoge\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"slhvnhlab\",\"provisioningState\":\"Failed\",\"rackLocation\":\"kkzjcjbtrga\",\"rackSerialNumber\":\"hvv\",\"rackSkuId\":\"brxjjsto\"}") - .toObject(RackProperties.class); - Assertions.assertEquals("y", model.availabilityZone()); - Assertions.assertEquals("kkzjcjbtrga", model.rackLocation()); - Assertions.assertEquals("hvv", model.rackSerialNumber()); - Assertions.assertEquals("brxjjsto", model.rackSkuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackProperties model = new RackProperties().withAvailabilityZone("y") - .withRackLocation("kkzjcjbtrga") - .withRackSerialNumber("hvv") - .withRackSkuId("brxjjsto"); - model = BinaryData.fromObject(model).toObject(RackProperties.class); - Assertions.assertEquals("y", model.availabilityZone()); - Assertions.assertEquals("kkzjcjbtrga", model.rackLocation()); - Assertions.assertEquals("hvv", model.rackSerialNumber()); - Assertions.assertEquals("brxjjsto", model.rackSkuId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuInnerTests.java deleted file mode 100644 index e60051fcd539b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; - -public final class RackSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackSkuInner model = BinaryData.fromString( - "{\"properties\":{\"computeMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":491327471174007244,\"cpuSockets\":8224509646361312989,\"disks\":[{},{}],\"generation\":\"qxqvpsvuoymgc\",\"hardwareVersion\":\"lvez\",\"memoryCapacityGB\":6907592721792123710,\"model\":\"mfe\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":1833052488439001173,\"vendor\":\"yhko\"},\"rackSlot\":2163259137534860371},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4472082990389410332,\"cpuSockets\":6326265417967005355,\"disks\":[{}],\"generation\":\"rfkbwccsnjvcdwxl\",\"hardwareVersion\":\"ekftnkhtj\",\"memoryCapacityGB\":362076039986657077,\"model\":\"wfqatmtd\",\"networkInterfaces\":[{}],\"totalThreads\":8519732811711473579,\"vendor\":\"gikdgsz\"},\"rackSlot\":4158814597266036765},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2468951178814203092,\"cpuSockets\":1808689546651848127,\"disks\":[{},{},{}],\"generation\":\"qrvqq\",\"hardwareVersion\":\"t\",\"memoryCapacityGB\":7064620302015218546,\"model\":\"goupmfiibfg\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":5365283778719311432,\"vendor\":\"rwxkvtkkgl\"},\"rackSlot\":7956286919576112532},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":5990043714623753281,\"cpuSockets\":2240044808904574446,\"disks\":[{},{}],\"generation\":\"k\",\"hardwareVersion\":\"hbxvvyhgsopbyrqu\",\"memoryCapacityGB\":754056912237486709,\"model\":\"vwz\",\"networkInterfaces\":[{},{},{}],\"totalThreads\":7342748496486648146,\"vendor\":\"tlpdn\"},\"rackSlot\":4794040096268902871}],\"controllerMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":3141470781454725182,\"cpuSockets\":1652787029694817901,\"disks\":[{},{}],\"generation\":\"jvegrhbpnaixexcc\",\"hardwareVersion\":\"reaxhcexdr\",\"memoryCapacityGB\":5677714812549279928,\"model\":\"qkghtpwijnhy\",\"networkInterfaces\":[{},{}],\"totalThreads\":753153192915766448,\"vendor\":\"z\"},\"rackSlot\":5977236228549031006},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":53764048985760155,\"cpuSockets\":6190922411407179441,\"disks\":[{},{},{},{}],\"generation\":\"y\",\"hardwareVersion\":\"tronzmyhgfi\",\"memoryCapacityGB\":3797997651495402097,\"model\":\"mcwaekrrjr\",\"networkInterfaces\":[{},{}],\"totalThreads\":8006171028976036711,\"vendor\":\"umh\"},\"rackSlot\":2620798390859941786},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4064120277354607981,\"cpuSockets\":6501585175246203591,\"disks\":[{},{}],\"generation\":\"uzlm\",\"hardwareVersion\":\"elfk\",\"memoryCapacityGB\":6676778811742741962,\"model\":\"rpw\",\"networkInterfaces\":[{},{}],\"totalThreads\":3779180060910913023,\"vendor\":\"gbrn\"},\"rackSlot\":2186486162242158404},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2791971078148352021,\"cpuSockets\":7475026912824042888,\"disks\":[{},{}],\"generation\":\"kagfhsxtt\",\"hardwareVersion\":\"gzxnfaazpxdtnk\",\"memoryCapacityGB\":4819915655623437065,\"model\":\"jlwuenvrkp\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":4613907741169030057,\"vendor\":\"ebqaaysjkixqtnq\"},\"rackSlot\":2784974934686338692}],\"description\":\"wfff\",\"maxClusterSlots\":3086933290402300840,\"provisioningState\":\"Succeeded\",\"rackType\":\"Aggregator\",\"storageAppliances\":[{\"properties\":{\"capacityGB\":3499164667202206083,\"model\":\"mjihyeozphv\"},\"rackSlot\":7562585136473490528},{\"properties\":{\"capacityGB\":364088888984952408,\"model\":\"upkvipmdsc\"},\"rackSlot\":7093792094143055548}],\"supportedRackSkuIds\":[\"vzhfstotxhoj\",\"jbypel\"]},\"id\":\"uvhixbjxyfwn\",\"name\":\"lrcoolsttpki\",\"type\":\"kkbnu\"}") - .toObject(RackSkuInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackSkuInner model = new RackSkuInner(); - model = BinaryData.fromObject(model).toObject(RackSkuInner.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuListTests.java deleted file mode 100644 index d39a3d0fa19b5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; -import com.azure.resourcemanager.networkcloud.models.RackSkuList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RackSkuListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackSkuList model = BinaryData.fromString( - "{\"nextLink\":\"mpipaslthaqfxs\",\"value\":[{\"properties\":{\"computeMachines\":[{\"properties\":{},\"rackSlot\":7650102264601836563},{\"properties\":{},\"rackSlot\":8587897237189545303},{\"properties\":{},\"rackSlot\":2068926764971195558},{\"properties\":{},\"rackSlot\":7630946703539097573}],\"controllerMachines\":[{\"properties\":{},\"rackSlot\":2743938617535852589}],\"description\":\"i\",\"maxClusterSlots\":1854957752746612483,\"provisioningState\":\"Succeeded\",\"rackType\":\"Single\",\"storageAppliances\":[{\"properties\":{},\"rackSlot\":8959651156770054860}],\"supportedRackSkuIds\":[\"zanl\"]},\"id\":\"xi\",\"name\":\"vrmbzono\",\"type\":\"i\"},{\"properties\":{\"computeMachines\":[{\"properties\":{},\"rackSlot\":4820100600000743353}],\"controllerMachines\":[{\"properties\":{},\"rackSlot\":1112557223227183071},{\"properties\":{},\"rackSlot\":6176406145161217361}],\"description\":\"nwoiind\",\"maxClusterSlots\":1586932653363724705,\"provisioningState\":\"Succeeded\",\"rackType\":\"Single\",\"storageAppliances\":[{\"properties\":{},\"rackSlot\":5073664426821636107},{\"properties\":{},\"rackSlot\":6454176992309402284},{\"properties\":{},\"rackSlot\":1730475892398036375},{\"properties\":{},\"rackSlot\":8025682187628267026}],\"supportedRackSkuIds\":[\"feljagrqm\"]},\"id\":\"ldvriiiojnalghfk\",\"name\":\"tvsexsowuel\",\"type\":\"qhhahhxvrhmzkwpj\"},{\"properties\":{\"computeMachines\":[{\"properties\":{},\"rackSlot\":8756648845252646804},{\"properties\":{},\"rackSlot\":2856222414032375851},{\"properties\":{},\"rackSlot\":5270793119915460778},{\"properties\":{},\"rackSlot\":794219754205284071}],\"controllerMachines\":[{\"properties\":{},\"rackSlot\":6939489719348300791},{\"properties\":{},\"rackSlot\":6401790851275828403},{\"properties\":{},\"rackSlot\":8851843932133625317}],\"description\":\"dmsyqtfihwhbo\",\"maxClusterSlots\":7308757901991635100,\"provisioningState\":\"Succeeded\",\"rackType\":\"Aggregator\",\"storageAppliances\":[{\"properties\":{},\"rackSlot\":3853655697248732253},{\"properties\":{},\"rackSlot\":6589777094256543656}],\"supportedRackSkuIds\":[\"qamvdkfwynwcvtbv\",\"ayhmtnvyqiatkz\"]},\"id\":\"cnpwzcjaesgvvscc\",\"name\":\"ajguqf\",\"type\":\"wygzlvdnkfxusem\"}]}") - .toObject(RackSkuList.class); - Assertions.assertEquals("mpipaslthaqfxs", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackSkuList model = new RackSkuList().withNextLink("mpipaslthaqfxs") - .withValue(Arrays.asList(new RackSkuInner(), new RackSkuInner(), new RackSkuInner())); - model = BinaryData.fromObject(model).toObject(RackSkuList.class); - Assertions.assertEquals("mpipaslthaqfxs", model.nextLink()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuPropertiesTests.java deleted file mode 100644 index c6eb8d1391e1e..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkuPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuProperties; - -public final class RackSkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RackSkuProperties model = BinaryData.fromString( - "{\"computeMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":897928383714570190,\"cpuSockets\":4992192384689672126,\"disks\":[{\"capacityGB\":4886902105690813495,\"connection\":\"RAID\",\"type\":\"HDD\"},{\"capacityGB\":4844839820097841527,\"connection\":\"SATA\",\"type\":\"HDD\"}],\"generation\":\"cbihwqk\",\"hardwareVersion\":\"dntwjchrdgo\",\"memoryCapacityGB\":2630280004911914307,\"model\":\"wct\",\"networkInterfaces\":[{\"address\":\"jl\",\"deviceConnectionType\":\"PCI\",\"model\":\"dlwggytsbwtovv\",\"physicalSlot\":43627080801211364,\"portCount\":4164889178539078814,\"portSpeed\":1742595014873597372,\"vendor\":\"x\"},{\"address\":\"npirgnepttw\",\"deviceConnectionType\":\"PCI\",\"model\":\"iffcdmqnrojlpijn\",\"physicalSlot\":4906118574644662043,\"portCount\":2669373350654837958,\"portSpeed\":1073683971901315269,\"vendor\":\"tizzronasxif\"}],\"totalThreads\":1507601090527968063,\"vendor\":\"zh\"},\"rackSlot\":451663804662893565},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":418491034500887660,\"cpuSockets\":4204064275341043217,\"disks\":[{\"capacityGB\":944538746812596310,\"connection\":\"SAS\",\"type\":\"SSD\"}],\"generation\":\"ossxk\",\"hardwareVersion\":\"thrrgh\",\"memoryCapacityGB\":1163156563773473643,\"model\":\"qxvcxgfrpdsofb\",\"networkInterfaces\":[{\"address\":\"svbuswdvzyy\",\"deviceConnectionType\":\"PCI\",\"model\":\"unvjsrtkfawnopq\",\"physicalSlot\":2623062511310512908,\"portCount\":3559673454895327460,\"portSpeed\":1446220970457190394,\"vendor\":\"uxzejntpsew\"},{\"address\":\"oi\",\"deviceConnectionType\":\"PCI\",\"model\":\"rydxtqm\",\"physicalSlot\":1390056940934680717,\"portCount\":5252415972799158831,\"portSpeed\":2697230687378757276,\"vendor\":\"yaomtb\"},{\"address\":\"havgrvk\",\"deviceConnectionType\":\"PCI\",\"model\":\"jzhpjbibgjmfx\",\"physicalSlot\":7872237535456237102,\"portCount\":7695215716304590082,\"portSpeed\":6109993492117712320,\"vendor\":\"xnbkfezzxscyhwzd\"}],\"totalThreads\":7045288362398368122,\"vendor\":\"bzbomvzzbtdcqvpn\"},\"rackSlot\":3651008433855729700},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4558783476830824181,\"cpuSockets\":8037934387054503335,\"disks\":[{\"capacityGB\":9196123884907355895,\"connection\":\"PCIE\",\"type\":\"SSD\"},{\"capacityGB\":4011927311891556520,\"connection\":\"SATA\",\"type\":\"HDD\"},{\"capacityGB\":2537542936421805498,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":4348401221053690336,\"connection\":\"SAS\",\"type\":\"HDD\"}],\"generation\":\"tymoxoftp\",\"hardwareVersion\":\"iwyczuh\",\"memoryCapacityGB\":2066395080766074653,\"model\":\"jlihhyus\",\"networkInterfaces\":[{\"address\":\"sdvlmfwdgzxulucv\",\"deviceConnectionType\":\"PCI\",\"model\":\"sreuzvxurisjnh\",\"physicalSlot\":6393635018086407939,\"portCount\":1701469177378842614,\"portSpeed\":5638066454574719499,\"vendor\":\"mrhublwpc\"},{\"address\":\"utr\",\"deviceConnectionType\":\"PCI\",\"model\":\"auutpwoqhihe\",\"physicalSlot\":384607226319356964,\"portCount\":742897891377561430,\"portSpeed\":8353509845307889273,\"vendor\":\"cypsxjv\"}],\"totalThreads\":4546309057929935505,\"vendor\":\"kslircizjxvydfc\"},\"rackSlot\":5320885570510732876}],\"controllerMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":1591355210571298193,\"cpuSockets\":2478564510622036028,\"disks\":[{\"capacityGB\":7202506138934240523,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":2201377283568732164,\"connection\":\"SATA\",\"type\":\"SSD\"},{\"capacityGB\":7940390795274125017,\"connection\":\"RAID\",\"type\":\"SSD\"},{\"capacityGB\":2889902788902379770,\"connection\":\"RAID\",\"type\":\"HDD\"}],\"generation\":\"chqnrnrpxehuwry\",\"hardwareVersion\":\"gaifmvik\",\"memoryCapacityGB\":2809082588527497709,\"model\":\"khbejdznxc\",\"networkInterfaces\":[{\"address\":\"hnjivo\",\"deviceConnectionType\":\"PCI\",\"model\":\"ovqfzge\",\"physicalSlot\":4588468813568796443,\"portCount\":7570040776903453561,\"portSpeed\":7390049782510101354,\"vendor\":\"ucea\"},{\"address\":\"mczuo\",\"deviceConnectionType\":\"PCI\",\"model\":\"cwwqiokn\",\"physicalSlot\":2591843472121052867,\"portCount\":9165184616629712222,\"portSpeed\":6363406348902694054,\"vendor\":\"jpr\"}],\"totalThreads\":2543879941778862448,\"vendor\":\"zqljyxgtczh\"},\"rackSlot\":7400057251495207075},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":156216941630787820,\"cpuSockets\":3603938096040345117,\"disks\":[{\"capacityGB\":8705469140737643235,\"connection\":\"RAID\",\"type\":\"HDD\"},{\"capacityGB\":3755202150997171578,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":5395718649012161228,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":1452554072563405259,\"connection\":\"SAS\",\"type\":\"HDD\"}],\"generation\":\"yhpluodpvruudlgz\",\"hardwareVersion\":\"thost\",\"memoryCapacityGB\":5447753545805575214,\"model\":\"vdxec\",\"networkInterfaces\":[{\"address\":\"qbcvhzlhplod\",\"deviceConnectionType\":\"PCI\",\"model\":\"wwqfbumlkxtrqj\",\"physicalSlot\":7319826162281846697,\"portCount\":2316780080896501746,\"portSpeed\":8691764890760034239,\"vendor\":\"fwsrtawcoezbrhu\"},{\"address\":\"kh\",\"deviceConnectionType\":\"PCI\",\"model\":\"oookkqfq\",\"physicalSlot\":4114997006993721978,\"portCount\":746345832353203980,\"portSpeed\":2025762393106298017,\"vendor\":\"iqtqzfavyvnq\"}],\"totalThreads\":3285042382273237059,\"vendor\":\"yeua\"},\"rackSlot\":1986865163230395084},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2649456167246285274,\"cpuSockets\":350400367835684568,\"disks\":[{\"capacityGB\":3492006108944068979,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":4341512256186702204,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":1220945276828738413,\"connection\":\"PCIE\",\"type\":\"HDD\"},{\"capacityGB\":1601037190025604112,\"connection\":\"PCIE\",\"type\":\"SSD\"}],\"generation\":\"f\",\"hardwareVersion\":\"mrqemvvhmx\",\"memoryCapacityGB\":5713148947008981411,\"model\":\"utacoe\",\"networkInterfaces\":[{\"address\":\"wzcjznmwcpmgua\",\"deviceConnectionType\":\"PCI\",\"model\":\"ufactk\",\"physicalSlot\":3432855337087507810,\"portCount\":5238754995577002157,\"portSpeed\":3236724470840488238,\"vendor\":\"xxpshneeku\"},{\"address\":\"gs\",\"deviceConnectionType\":\"PCI\",\"model\":\"kwdlenrdsutujba\",\"physicalSlot\":5977101318302182370,\"portCount\":7788471174563300155,\"portSpeed\":4711945730299884294,\"vendor\":\"lnorwmdu\"}],\"totalThreads\":6592682584026148798,\"vendor\":\"vxwmygd\"},\"rackSlot\":5636888396415086824}],\"description\":\"chisze\",\"maxClusterSlots\":2196732173372776914,\"provisioningState\":\"Succeeded\",\"rackType\":\"Compute\",\"storageAppliances\":[{\"properties\":{\"capacityGB\":8416065526803881902,\"model\":\"confozauors\"},\"rackSlot\":8150670572969062689},{\"properties\":{\"capacityGB\":8658482827649183960,\"model\":\"hlvnuuepzlr\"},\"rackSlot\":7045549218691241885},{\"properties\":{\"capacityGB\":202758910356558886,\"model\":\"eyuqdunvmnnrwr\"},\"rackSlot\":3165158046012931137},{\"properties\":{\"capacityGB\":1294897435349030649,\"model\":\"wjhhgdnhxmsivf\"},\"rackSlot\":2582739038119922413}],\"supportedRackSkuIds\":[\"ggdufiqndieu\",\"ao\"]}") - .toObject(RackSkuProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RackSkuProperties model = new RackSkuProperties(); - model = BinaryData.fromObject(model).toObject(RackSkuProperties.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetWithResponseMockTests.java deleted file mode 100644 index a4229cd64e66c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetWithResponseMockTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.RackSku; -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 RackSkusGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"computeMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":740525382887173409,\"cpuSockets\":5500340265923019624,\"disks\":[{}],\"generation\":\"bvcpxtzhi\",\"hardwareVersion\":\"qbtimpk\",\"memoryCapacityGB\":1044102882013391726,\"model\":\"nsihqhudsm\",\"networkInterfaces\":[{},{}],\"totalThreads\":4060730487232753668,\"vendor\":\"akx\"},\"rackSlot\":6306579526133194151},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2595914989199311759,\"cpuSockets\":8083612341819769387,\"disks\":[{},{}],\"generation\":\"ba\",\"hardwareVersion\":\"sjtgirnbgmgmddo\",\"memoryCapacityGB\":8665774540406405469,\"model\":\"ltwmpftmf\",\"networkInterfaces\":[{}],\"totalThreads\":1965043221912539556,\"vendor\":\"yxwe\"},\"rackSlot\":2455970206380865852},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":6507470422163849582,\"cpuSockets\":277162185175840671,\"disks\":[{},{}],\"generation\":\"recchdidrmu\",\"hardwareVersion\":\"ahmjedbiu\",\"memoryCapacityGB\":6239695269940490916,\"model\":\"wmjpjbweunxcqrr\",\"networkInterfaces\":[{},{},{}],\"totalThreads\":5847341110356575377,\"vendor\":\"ppiybxv\"},\"rackSlot\":2199635918669239119}],\"controllerMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4542334182366032884,\"cpuSockets\":6282274110728740658,\"disks\":[{},{}],\"generation\":\"kunhdimjuk\",\"hardwareVersion\":\"r\",\"memoryCapacityGB\":184726325025481896,\"model\":\"pucdocf\",\"networkInterfaces\":[{},{}],\"totalThreads\":2825605898464765817,\"vendor\":\"m\"},\"rackSlot\":8576357507637884293}],\"description\":\"lvzkl\",\"maxClusterSlots\":6499757878767405026,\"provisioningState\":\"Succeeded\",\"rackType\":\"Aggregator\",\"storageAppliances\":[{\"properties\":{\"capacityGB\":4991304555138648039,\"model\":\"ishj\"},\"rackSlot\":8933790957352791226},{\"properties\":{\"capacityGB\":5289013246694502921,\"model\":\"kaoizjixw\"},\"rackSlot\":7700160116018729328},{\"properties\":{\"capacityGB\":7188469565987722721,\"model\":\"xwnujvqyn\"},\"rackSlot\":5295005918015200070},{\"properties\":{\"capacityGB\":8275230829067853990,\"model\":\"qohhihra\"},\"rackSlot\":7250011366444098060}],\"supportedRackSkuIds\":[\"wjc\"]},\"id\":\"brhlhpvzadb\",\"name\":\"enninafhxrzfrm\",\"type\":\"ztiucwviql\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RackSku response = manager.rackSkus().getWithResponse("njhx", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListMockTests.java deleted file mode 100644 index 6fb30fc6568f1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.RackSku; -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 RackSkusListMockTests { - @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\":{\"computeMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":7899187593736500473,\"cpuSockets\":2472932704518208750,\"disks\":[{},{},{}],\"generation\":\"ecywn\",\"hardwareVersion\":\"szzacz\",\"memoryCapacityGB\":2399079207304654323,\"model\":\"dnddbbozsyv\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":5513829393654093204,\"vendor\":\"trchwudlxe\"},\"rackSlot\":2296064641407033062},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4249319475420552676,\"cpuSockets\":4410437447478767360,\"disks\":[{},{}],\"generation\":\"ibzoyrfgxky\",\"hardwareVersion\":\"mypgfqvmty\",\"memoryCapacityGB\":3061832475532554630,\"model\":\"xpejpewpy\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":2407253522183888885,\"vendor\":\"qcrzgeuqxbpia\"},\"rackSlot\":2776580464611090211},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2401268575523146604,\"cpuSockets\":3102834466922608032,\"disks\":[{},{},{},{}],\"generation\":\"gddhjkrukizyhgs\",\"hardwareVersion\":\"nqskt\",\"memoryCapacityGB\":461686753657515598,\"model\":\"bqggw\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":2878580061583556758,\"vendor\":\"mnc\"},\"rackSlot\":260347597317461467},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":8125245144598628019,\"cpuSockets\":3679522835781327513,\"disks\":[{},{},{},{}],\"generation\":\"fbklciichgjsysmv\",\"hardwareVersion\":\"dgwxfkzsifcu\",\"memoryCapacityGB\":18205778214259206,\"model\":\"gcwx\",\"networkInterfaces\":[{},{},{}],\"totalThreads\":7239370948456879698,\"vendor\":\"trdxri\"},\"rackSlot\":4189443814754627529}],\"controllerMachines\":[{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":1996191111270755156,\"cpuSockets\":2775369867474330875,\"disks\":[{},{},{},{}],\"generation\":\"wabzr\",\"hardwareVersion\":\"qrxhaclcdos\",\"memoryCapacityGB\":3840669537187244582,\"model\":\"qgki\",\"networkInterfaces\":[{},{}],\"totalThreads\":6775598916225355752,\"vendor\":\"hedxkpbqwuntob\"},\"rackSlot\":1108879643563906326},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":612372614461236984,\"cpuSockets\":2506687737827198248,\"disks\":[{}],\"generation\":\"bnklblaxpe\",\"hardwareVersion\":\"wdabalfdxaglzfyt\",\"memoryCapacityGB\":4234894609392491702,\"model\":\"h\",\"networkInterfaces\":[{},{}],\"totalThreads\":5088240560390516905,\"vendor\":\"rsifliky\"},\"rackSlot\":2382272717340547027},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":2998066280737548786,\"cpuSockets\":6957594493659612287,\"disks\":[{}],\"generation\":\"pokszanmhwgpt\",\"hardwareVersion\":\"diuwki\",\"memoryCapacityGB\":3344881963530772349,\"model\":\"ztsdetjygow\",\"networkInterfaces\":[{}],\"totalThreads\":5250341077120317307,\"vendor\":\"zkgysdgzyybzoxlv\"},\"rackSlot\":2421052300425849743},{\"properties\":{\"bootstrapProtocol\":\"PXE\",\"cpuCores\":4071889681272542194,\"cpuSockets\":9050228883720331469,\"disks\":[{},{}],\"generation\":\"wzghjhjv\",\"hardwareVersion\":\"bzzbwayb\",\"memoryCapacityGB\":903770024533184602,\"model\":\"bgymqt\",\"networkInterfaces\":[{},{},{},{}],\"totalThreads\":7638793545242651201,\"vendor\":\"xrjnbsconxav\"},\"rackSlot\":1746170521265492922}],\"description\":\"chbj\",\"maxClusterSlots\":2271950388364112908,\"provisioningState\":\"Succeeded\",\"rackType\":\"Single\",\"storageAppliances\":[{\"properties\":{\"capacityGB\":2436662198497647042,\"model\":\"l\"},\"rackSlot\":4126611531030666770}],\"supportedRackSkuIds\":[\"ipmlnfyzavf\"]},\"id\":\"ypi\",\"name\":\"dbkp\",\"type\":\"jtaqhsmqazpdg\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.rackSkus().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateMockTests.java deleted file mode 100644 index 2b09842d1dfd4..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.Rack; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RacksCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"gsmgb\",\"type\":\"mt\"},\"properties\":{\"availabilityZone\":\"wrqbebjnfv\",\"clusterId\":\"labt\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"wznhtfgfic\",\"provisioningState\":\"Succeeded\",\"rackLocation\":\"hizpaczmuh\",\"rackSerialNumber\":\"cakznhokhoitwhrj\",\"rackSkuId\":\"dmmazdnc\"},\"location\":\"dbjp\",\"tags\":{\"fhbssdpjeyoqxded\":\"zqpxzbawkikcd\",\"shzz\":\"cfiwhagxsurejq\",\"ll\":\"g\",\"gl\":\"xiqqzjkoxdupna\"},\"id\":\"ouigdmfivjqte\",\"name\":\"dqqigdydkghpc\",\"type\":\"rwqirvtktyhhmvf\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Rack response = manager.racks() - .define("ahfsgb") - .withRegion("tfshksnyzm") - .withExistingResourceGroup("qzusitoq") - .withExtendedLocation(new ExtendedLocation().withName("mlree").withType("rfwss")) - .withAvailabilityZone("vlcwlisolntfxxc") - .withRackLocation("bulnvgskjtoxjdz") - .withRackSerialNumber("sjznvhx") - .withRackSkuId("qmqipaydhfnzoc") - .withTags( - mapOf("iqdktwtkvih", "mwbwmbnlslce", "nguuzhwvla", "pfliwo", "mhjhaus", "p", "ekymffztsilscvqs", "b")) - .create(); - - Assertions.assertEquals("dbjp", response.location()); - Assertions.assertEquals("zqpxzbawkikcd", response.tags().get("fhbssdpjeyoqxded")); - Assertions.assertEquals("gsmgb", response.extendedLocation().name()); - Assertions.assertEquals("mt", response.extendedLocation().type()); - Assertions.assertEquals("wrqbebjnfv", response.availabilityZone()); - Assertions.assertEquals("hizpaczmuh", response.rackLocation()); - Assertions.assertEquals("cakznhokhoitwhrj", response.rackSerialNumber()); - Assertions.assertEquals("dmmazdnc", response.rackSkuId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteMockTests.java deleted file mode 100644 index 78804dae9d9f7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 RacksDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.racks().delete("mwt", "g", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 76d712484c4d1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Rack; -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 RacksGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"mnnidmdia\",\"type\":\"pzxkzrntmkct\"},\"properties\":{\"availabilityZone\":\"huosgwqpsqaz\",\"clusterId\":\"qodvqgcnbhcbmj\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"bn\",\"provisioningState\":\"Accepted\",\"rackLocation\":\"tsxjmfmeftvhkmoo\",\"rackSerialNumber\":\"jrhskbwgmjgrul\",\"rackSkuId\":\"fogxhcxnw\"},\"location\":\"pfdzxcouzfwofw\",\"tags\":{\"ihezomucmq\":\"kzkdtzxsoednlwg\"},\"id\":\"isnionetbzdrdpue\",\"name\":\"xkgtlzlmtrlxcznn\",\"type\":\"zkbnbmxl\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Rack response = manager.racks() - .getByResourceGroupWithResponse("fpcfjf", "zlgzawkgyepey", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pfdzxcouzfwofw", response.location()); - Assertions.assertEquals("kzkdtzxsoednlwg", response.tags().get("ihezomucmq")); - Assertions.assertEquals("mnnidmdia", response.extendedLocation().name()); - Assertions.assertEquals("pzxkzrntmkct", response.extendedLocation().type()); - Assertions.assertEquals("huosgwqpsqaz", response.availabilityZone()); - Assertions.assertEquals("tsxjmfmeftvhkmoo", response.rackLocation()); - Assertions.assertEquals("jrhskbwgmjgrul", response.rackSerialNumber()); - Assertions.assertEquals("fogxhcxnw", response.rackSkuId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupMockTests.java deleted file mode 100644 index 4e743c1774a23..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Rack; -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 RacksListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"fbbcngkegxcypxbb\",\"type\":\"etwilyrzoxpd\"},\"properties\":{\"availabilityZone\":\"qlf\",\"clusterId\":\"lqownkiua\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ahwkxjjm\",\"provisioningState\":\"Failed\",\"rackLocation\":\"lmsoodtmve\",\"rackSerialNumber\":\"dhdyswcrptveaj\",\"rackSkuId\":\"zxvlgsrgkrfizrp\"},\"location\":\"lptyuqhr\",\"tags\":{\"npcfyk\":\"skykpfuofix\"},\"id\":\"pyycpawm\",\"name\":\"jp\",\"type\":\"dpwrp\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.racks().listByResourceGroup("oti", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lptyuqhr", response.iterator().next().location()); - Assertions.assertEquals("skykpfuofix", response.iterator().next().tags().get("npcfyk")); - Assertions.assertEquals("fbbcngkegxcypxbb", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("etwilyrzoxpd", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("qlf", response.iterator().next().availabilityZone()); - Assertions.assertEquals("lmsoodtmve", response.iterator().next().rackLocation()); - Assertions.assertEquals("dhdyswcrptveaj", response.iterator().next().rackSerialNumber()); - Assertions.assertEquals("zxvlgsrgkrfizrp", response.iterator().next().rackSkuId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListMockTests.java deleted file mode 100644 index f4576447d67cf..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Rack; -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 RacksListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"ukhk\",\"type\":\"cqx\"},\"properties\":{\"availabilityZone\":\"cbvzarmqcb\",\"clusterId\":\"kst\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"agovjy\",\"provisioningState\":\"Provisioning\",\"rackLocation\":\"xbrdvcehqwh\",\"rackSerialNumber\":\"txnmxgnmguz\",\"rackSkuId\":\"uwvorbalkjn\"},\"location\":\"bdhlltq\",\"tags\":{\"xiynecovagzk\":\"kqsy\",\"qiawzl\":\"eubanlxunpqcc\",\"izuxlrarwpewsaud\":\"klaslga\",\"sx\":\"ejtig\"},\"id\":\"pytn\",\"name\":\"qbalahovuuwxhme\",\"type\":\"jnhj\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.racks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bdhlltq", response.iterator().next().location()); - Assertions.assertEquals("kqsy", response.iterator().next().tags().get("xiynecovagzk")); - Assertions.assertEquals("ukhk", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("cqx", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("cbvzarmqcb", response.iterator().next().availabilityZone()); - Assertions.assertEquals("xbrdvcehqwh", response.iterator().next().rackLocation()); - Assertions.assertEquals("txnmxgnmguz", response.iterator().next().rackSerialNumber()); - Assertions.assertEquals("uwvorbalkjn", response.iterator().next().rackSkuId()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksPatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksPatchPropertiesTests.java deleted file mode 100644 index 8a4191dc7989e..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/RacksPatchPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.RacksPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class RacksPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RacksPatchProperties model - = BinaryData.fromString("{\"rackLocation\":\"icphvtrrmhw\",\"rackSerialNumber\":\"fdpyflubh\"}") - .toObject(RacksPatchProperties.class); - Assertions.assertEquals("icphvtrrmhw", model.rackLocation()); - Assertions.assertEquals("fdpyflubh", model.rackSerialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RacksPatchProperties model - = new RacksPatchProperties().withRackLocation("icphvtrrmhw").withRackSerialNumber("fdpyflubh"); - model = BinaryData.fromObject(model).toObject(RacksPatchProperties.class); - Assertions.assertEquals("icphvtrrmhw", model.rackLocation()); - Assertions.assertEquals("fdpyflubh", model.rackSerialNumber()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceEnableRemoteVendorManagementParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceEnableRemoteVendorManagementParametersTests.java deleted file mode 100644 index 0db4ce7658407..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceEnableRemoteVendorManagementParametersTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StorageApplianceEnableRemoteVendorManagementParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageApplianceEnableRemoteVendorManagementParameters model - = BinaryData.fromString("{\"supportEndpoints\":[\"fb\"]}") - .toObject(StorageApplianceEnableRemoteVendorManagementParameters.class); - Assertions.assertEquals("fb", model.supportEndpoints().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageApplianceEnableRemoteVendorManagementParameters model - = new StorageApplianceEnableRemoteVendorManagementParameters().withSupportEndpoints(Arrays.asList("fb")); - model = BinaryData.fromObject(model).toObject(StorageApplianceEnableRemoteVendorManagementParameters.class); - Assertions.assertEquals("fb", model.supportEndpoints().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchParametersTests.java deleted file mode 100644 index 9ab42e011fd02..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchParametersTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageAppliancePatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageAppliancePatchParameters model = BinaryData.fromString( - "{\"properties\":{\"serialNumber\":\"lrocuyzlwh\"},\"tags\":{\"tnpqmemczjk\":\"mhoocl\",\"rryejylmbkzudnig\":\"mykyujxsglhs\",\"wlpxuzzjg\":\"fihotj\"}}") - .toObject(StorageAppliancePatchParameters.class); - Assertions.assertEquals("mhoocl", model.tags().get("tnpqmemczjk")); - Assertions.assertEquals("lrocuyzlwh", model.serialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageAppliancePatchParameters model = new StorageAppliancePatchParameters() - .withTags(mapOf("tnpqmemczjk", "mhoocl", "rryejylmbkzudnig", "mykyujxsglhs", "wlpxuzzjg", "fihotj")) - .withSerialNumber("lrocuyzlwh"); - model = BinaryData.fromObject(model).toObject(StorageAppliancePatchParameters.class); - Assertions.assertEquals("mhoocl", model.tags().get("tnpqmemczjk")); - Assertions.assertEquals("lrocuyzlwh", model.serialNumber()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchPropertiesTests.java deleted file mode 100644 index d577edd9d9b97..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancePatchPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.StorageAppliancePatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class StorageAppliancePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageAppliancePatchProperties model = BinaryData.fromString("{\"serialNumber\":\"efqyhqotoihiqaky\"}") - .toObject(StorageAppliancePatchProperties.class); - Assertions.assertEquals("efqyhqotoihiqaky", model.serialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageAppliancePatchProperties model - = new StorageAppliancePatchProperties().withSerialNumber("efqyhqotoihiqaky"); - model = BinaryData.fromObject(model).toObject(StorageAppliancePatchProperties.class); - Assertions.assertEquals("efqyhqotoihiqaky", model.serialNumber()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuPropertiesTests.java deleted file mode 100644 index 7c51a73e2bb4e..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceSkuProperties; - -public final class StorageApplianceSkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageApplianceSkuProperties model - = BinaryData.fromString("{\"capacityGB\":6206470742211540343,\"model\":\"geivsiykzkdncj\"}") - .toObject(StorageApplianceSkuProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageApplianceSkuProperties model = new StorageApplianceSkuProperties(); - model = BinaryData.fromObject(model).toObject(StorageApplianceSkuProperties.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuSlotTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuSlotTests.java deleted file mode 100644 index 83f4032a58d1f..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageApplianceSkuSlotTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; - -public final class StorageApplianceSkuSlotTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageApplianceSkuSlot model = BinaryData.fromString( - "{\"properties\":{\"capacityGB\":2711375117878963664,\"model\":\"djvlpj\"},\"rackSlot\":4808904277032773928}") - .toObject(StorageApplianceSkuSlot.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageApplianceSkuSlot model = new StorageApplianceSkuSlot(); - model = BinaryData.fromObject(model).toObject(StorageApplianceSkuSlot.class); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteMockTests.java deleted file mode 100644 index ce02ae3b5ec3e..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 StorageAppliancesDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.storageAppliances().delete("ysc", "ey", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementMockTests.java deleted file mode 100644 index 645b6208aeda5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 StorageAppliancesDisableRemoteVendorManagementMockTests { - @Test - public void testDisableRemoteVendorManagement() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"vmi\",\"resourceId\":\"beaeq\",\"name\":\"mhkdclacroczfm\",\"status\":\"ner\",\"percentComplete\":92.16802,\"startTime\":\"2021-10-24T05:01:58Z\",\"endTime\":\"2021-11-25T04:20:11Z\",\"operations\":[{\"id\":\"ezbzu\",\"resourceId\":\"dlevzskejcgw\",\"name\":\"gqkstyecupyu\",\"status\":\"jparda\",\"percentComplete\":63.3447,\"startTime\":\"2021-09-07T03:41:26Z\",\"endTime\":\"2021-11-22T19:52:24Z\",\"operations\":[{\"id\":\"dqwuzvcm\",\"resourceId\":\"kxizek\",\"name\":\"frjwucaon\",\"status\":\"vajbvbnkrdemdid\",\"percentComplete\":59.99933,\"startTime\":\"2021-06-16T22:26:17Z\",\"endTime\":\"2021-02-15T15:27:55Z\",\"operations\":[{\"status\":\"dydamisvpztdivy\"},{\"status\":\"pxkqejtpjfojiunr\"},{\"status\":\"shxuknsykdtoi\"}]},{\"id\":\"ncdrcoanvxuldx\",\"resourceId\":\"c\",\"name\":\"nlb\",\"status\":\"fxlupibaq\",\"percentComplete\":50.182266,\"startTime\":\"2021-01-26T00:12:57Z\",\"endTime\":\"2021-07-13T09:24:59Z\",\"operations\":[{\"status\":\"ghlww\"},{\"status\":\"ogvgfklqiyn\"}]}]},{\"id\":\"elsbfvd\",\"resourceId\":\"rk\",\"name\":\"sgt\",\"status\":\"ns\",\"percentComplete\":17.492521,\"startTime\":\"2021-08-11T16:04:23Z\",\"endTime\":\"2021-02-14T08:51:36Z\",\"operations\":[{\"id\":\"myndnox\",\"resourceId\":\"nrqa\",\"name\":\"tnndxolousdvr\",\"status\":\"ptqmawzjdrpiz\",\"percentComplete\":2.5345922,\"startTime\":\"2021-11-04T23:11:12Z\",\"endTime\":\"2021-08-29T08:53:42Z\",\"operations\":[{\"status\":\"btqgkujdsoox\"},{\"status\":\"qwoeurbtigapd\"},{\"status\":\"arikeejdpdfhtwmm\"}]},{\"id\":\"bri\",\"resourceId\":\"lwwtr\",\"name\":\"eqkvyhzokpoyu\",\"status\":\"h\",\"percentComplete\":58.077705,\"startTime\":\"2021-04-30T20:52:44Z\",\"endTime\":\"2020-12-26T02:06:50Z\",\"operations\":[{\"status\":\"hmpoe\"},{\"status\":\"nglpwsada\"},{\"status\":\"jsumxpezcoio\"},{\"status\":\"jrmfqzwqd\"}]},{\"id\":\"eedcnwmywx\",\"resourceId\":\"zkvemy\",\"name\":\"pczaqpqif\",\"status\":\"bmptrwtxzu\",\"percentComplete\":62.856464,\"startTime\":\"2021-07-31T07:19:02Z\",\"endTime\":\"2021-01-26T13:56:03Z\",\"operations\":[{\"status\":\"izexroqsqj\"}]}]},{\"id\":\"thsplwsttxsr\",\"resourceId\":\"fq\",\"name\":\"niceovxgzwh\",\"status\":\"xyrujmt\",\"percentComplete\":89.48731,\"startTime\":\"2021-06-11T17:18:42Z\",\"endTime\":\"2021-05-01T14:01Z\",\"operations\":[{\"id\":\"zix\",\"resourceId\":\"hfnkvycqqqds\",\"name\":\"pnq\",\"status\":\"wzxhrptyodlhkf\",\"percentComplete\":83.21142,\"startTime\":\"2021-11-27T23:25:35Z\",\"endTime\":\"2021-08-03T01:08:41Z\",\"operations\":[{\"status\":\"jopnouhbqezk\"}]},{\"id\":\"aluzyi\",\"resourceId\":\"cvcewb\",\"name\":\"hdgsjsatm\",\"status\":\"ncmazdf\",\"percentComplete\":32.84828,\"startTime\":\"2021-06-20T07:17:13Z\",\"endTime\":\"2021-10-28T00:47:24Z\",\"operations\":[{\"status\":\"jparnpvgrszrbwt\"},{\"status\":\"rcwgzwllxzlhhf\"}]},{\"id\":\"cfculzj\",\"resourceId\":\"hp\",\"name\":\"wvyldqpzf\",\"status\":\"xsoxi\",\"percentComplete\":12.493217,\"startTime\":\"2021-04-15T23:14:57Z\",\"endTime\":\"2021-06-21T12:55:01Z\",\"operations\":[{\"status\":\"ocqsxy\"},{\"status\":\"qqt\"}]},{\"id\":\"wdwisvn\",\"resourceId\":\"ylajam\",\"name\":\"jyh\",\"status\":\"tpzcr\",\"percentComplete\":14.158112,\"startTime\":\"2021-06-03T15:20:33Z\",\"endTime\":\"2021-07-06T10:55:20Z\",\"operations\":[{\"status\":\"anhkigglclwalh\"},{\"status\":\"ubhg\"}]}]},{\"id\":\"txdqcmy\",\"resourceId\":\"ajqzj\",\"name\":\"lecxbibiwks\",\"status\":\"egyxsbfpzvoik\",\"percentComplete\":29.30662,\"startTime\":\"2021-05-16T11:22:24Z\",\"endTime\":\"2021-05-05T07:36:45Z\",\"operations\":[{\"id\":\"shl\",\"resourceId\":\"pblalhhez\",\"name\":\"kissaidqzsaa\",\"status\":\"qdsgptotxj\",\"percentComplete\":12.192118,\"startTime\":\"2021-09-09T22:28:04Z\",\"endTime\":\"2021-06-09T19:51:50Z\",\"operations\":[{\"status\":\"tbfijz\"}]},{\"id\":\"o\",\"resourceId\":\"olbuauktwieope\",\"name\":\"lxqdwr\",\"status\":\"wyil\",\"percentComplete\":59.643085,\"startTime\":\"2021-11-28T03:24:57Z\",\"endTime\":\"2021-05-31T05:16:20Z\",\"operations\":[{\"status\":\"yauxr\"},{\"status\":\"ddobmcnltmwyt\"}]},{\"id\":\"sqycmmoxfablqg\",\"resourceId\":\"bmwhrialiwr\",\"name\":\"gnwplrrb\",\"status\":\"hctsbbibti\",\"percentComplete\":58.901154,\"startTime\":\"2021-08-07T10:14:04Z\",\"endTime\":\"2021-08-27T04:29:56Z\",\"operations\":[{\"status\":\"bfs\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.storageAppliances() - .disableRemoteVendorManagement("zjemexmnvkvm", "wrxlniwmcpmrrdlh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vmi", response.id()); - Assertions.assertEquals("mhkdclacroczfm", response.name()); - Assertions.assertEquals("ner", response.status()); - Assertions.assertEquals(92.16802F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-24T05:01:58Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T04:20:11Z"), response.endTime()); - Assertions.assertEquals("ezbzu", response.operations().get(0).id()); - Assertions.assertEquals("gqkstyecupyu", response.operations().get(0).name()); - Assertions.assertEquals("jparda", response.operations().get(0).status()); - Assertions.assertEquals(63.3447F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T03:41:26Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T19:52:24Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("dqwuzvcm", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("frjwucaon", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("vajbvbnkrdemdid", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(59.99933F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T22:26:17Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T15:27:55Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("dydamisvpztdivy", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementMockTests.java deleted file mode 100644 index 9652418da209b..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageAppliancesEnableRemoteVendorManagementMockTests { - @Test - public void testEnableRemoteVendorManagement() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"cmvouujxdiikmoxr\",\"resourceId\":\"svavlrxikjmoy\",\"name\":\"unpip\",\"status\":\"wybsz\",\"percentComplete\":45.25683,\"startTime\":\"2021-07-17T11:00:27Z\",\"endTime\":\"2021-07-24T01:28:12Z\",\"operations\":[{\"id\":\"saebwfwhxorpwal\",\"resourceId\":\"wugexojfccyl\",\"name\":\"rh\",\"status\":\"hvazjpwexcdr\",\"percentComplete\":98.35904,\"startTime\":\"2020-12-25T07:30:14Z\",\"endTime\":\"2021-04-22T07:08:27Z\",\"operations\":[{\"id\":\"mn\",\"resourceId\":\"jgpjeuxs\",\"name\":\"lokfpmijpdvzv\",\"status\":\"bhwbdqufvcgnrgla\",\"percentComplete\":46.64172,\"startTime\":\"2021-02-16T19:16:30Z\",\"endTime\":\"2021-07-03T16:35:54Z\",\"operations\":[{\"status\":\"afebzxfkjq\"},{\"status\":\"tibhlennt\"}]},{\"id\":\"k\",\"resourceId\":\"abdu\",\"name\":\"zmlghny\",\"status\":\"v\",\"percentComplete\":29.506672,\"startTime\":\"2021-03-08T04:49:44Z\",\"endTime\":\"2021-10-08T06:38:04Z\",\"operations\":[{\"status\":\"dixqbo\"},{\"status\":\"xvhhyqq\"},{\"status\":\"gatxgrznmginmtsd\"}]},{\"id\":\"hwkibmgjymn\",\"resourceId\":\"cag\",\"name\":\"rwcqzo\",\"status\":\"fjnqjsvepf\",\"percentComplete\":28.686773,\"startTime\":\"2021-10-14T06:29:09Z\",\"endTime\":\"2021-08-28T18:55:34Z\",\"operations\":[{\"status\":\"ljekn\"},{\"status\":\"qnwjjq\"},{\"status\":\"owkdnjr\"},{\"status\":\"gkr\"}]},{\"id\":\"ehycpn\",\"resourceId\":\"awonoehrguqlhfw\",\"name\":\"bjzm\",\"status\":\"yrguyfazbk\",\"percentComplete\":54.576153,\"startTime\":\"2021-07-30T06:19:12Z\",\"endTime\":\"2021-01-11T00:43:15Z\",\"operations\":[{\"status\":\"mxkbcjwwdxomra\"},{\"status\":\"ppkeboozflyacag\"},{\"status\":\"eda\"},{\"status\":\"i\"}]}]},{\"id\":\"gdtwgabd\",\"resourceId\":\"kuz\",\"name\":\"jecooyvhtu\",\"status\":\"bpelniibncgagd\",\"percentComplete\":12.446653,\"startTime\":\"2021-10-11T20:24:34Z\",\"endTime\":\"2021-02-10T14:42:39Z\",\"operations\":[{\"id\":\"yfaofdf\",\"resourceId\":\"tncwmhjobzrfpr\",\"name\":\"dc\",\"status\":\"h\",\"percentComplete\":62.696774,\"startTime\":\"2021-02-13T09:54:56Z\",\"endTime\":\"2021-01-18T02:03:23Z\",\"operations\":[{\"status\":\"whgkgsoa\"},{\"status\":\"oorssatfy\"},{\"status\":\"ipufdmxuqbdq\"}]}]},{\"id\":\"tuxvzfqayopbt\",\"resourceId\":\"xhgvbhxmndztgsq\",\"name\":\"yqmarxneib\",\"status\":\"gbrhbjd\",\"percentComplete\":11.403805,\"startTime\":\"2021-12-08T10:08:51Z\",\"endTime\":\"2021-02-23T12:33:43Z\",\"operations\":[{\"id\":\"uwnnohmmzngoc\",\"resourceId\":\"juypwyiulaynosu\",\"name\":\"fhaxttpf\",\"status\":\"mwgsghq\",\"percentComplete\":76.55331,\"startTime\":\"2021-08-23T21:38:48Z\",\"endTime\":\"2021-07-11T09:50:13Z\",\"operations\":[{\"status\":\"qm\"},{\"status\":\"lfeothxuarigr\"},{\"status\":\"dlj\"}]},{\"id\":\"hvkr\",\"resourceId\":\"kuastaxklpr\",\"name\":\"l\",\"status\":\"gltoizwxvscksgf\",\"percentComplete\":68.861595,\"startTime\":\"2021-12-05T19:00:36Z\",\"endTime\":\"2021-10-07T14:16:16Z\",\"operations\":[{\"status\":\"fxcz\"},{\"status\":\"fcck\"}]},{\"id\":\"wletyveszrtlhpdh\",\"resourceId\":\"nctaczcn\",\"name\":\"mbbfnv\",\"status\":\"x\",\"percentComplete\":74.21378,\"startTime\":\"2021-12-03T14:45:06Z\",\"endTime\":\"2021-06-06T06:14:19Z\",\"operations\":[{\"status\":\"iklsmni\"},{\"status\":\"qlcoqksyiibhyx\"}]},{\"id\":\"bu\",\"resourceId\":\"vqdorbccqcd\",\"name\":\"hojvlirkn\",\"status\":\"c\",\"percentComplete\":28.408623,\"startTime\":\"2021-02-03T12:43:50Z\",\"endTime\":\"2021-10-15T07:18:41Z\",\"operations\":[{\"status\":\"gzlgpyaixihz\"},{\"status\":\"jjtsm\"},{\"status\":\"ydqfttkacy\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.storageAppliances() - .enableRemoteVendorManagement("bewfcuqfpyyxm", "rmtmvwi", - new StorageApplianceEnableRemoteVendorManagementParameters() - .withSupportEndpoints(Arrays.asList("eyyjshcybwfuppox")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cmvouujxdiikmoxr", response.id()); - Assertions.assertEquals("unpip", response.name()); - Assertions.assertEquals("wybsz", response.status()); - Assertions.assertEquals(45.25683F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T11:00:27Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T01:28:12Z"), response.endTime()); - Assertions.assertEquals("saebwfwhxorpwal", response.operations().get(0).id()); - Assertions.assertEquals("rh", response.operations().get(0).name()); - Assertions.assertEquals("hvazjpwexcdr", response.operations().get(0).status()); - Assertions.assertEquals(98.35904F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-25T07:30:14Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T07:08:27Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("mn", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("lokfpmijpdvzv", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("bhwbdqufvcgnrgla", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(46.64172F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T19:16:30Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T16:35:54Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("afebzxfkjq", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageProfileTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageProfileTests.java deleted file mode 100644 index 408ac391f0089..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/StorageProfileTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.OsDisk; -import com.azure.resourcemanager.networkcloud.models.OsDiskCreateOption; -import com.azure.resourcemanager.networkcloud.models.OsDiskDeleteOption; -import com.azure.resourcemanager.networkcloud.models.StorageProfile; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StorageProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageProfile model = BinaryData.fromString( - "{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":150677982471181492},\"volumeAttachments\":[\"lqhykprlpyz\",\"uciqdsme\",\"iitdfuxt\"]}") - .toObject(StorageProfile.class); - Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.osDisk().createOption()); - Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.osDisk().deleteOption()); - Assertions.assertEquals(150677982471181492L, model.osDisk().diskSizeGB()); - Assertions.assertEquals("lqhykprlpyz", model.volumeAttachments().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageProfile model = new StorageProfile() - .withOsDisk(new OsDisk().withCreateOption(OsDiskCreateOption.EPHEMERAL) - .withDeleteOption(OsDiskDeleteOption.DELETE) - .withDiskSizeGB(150677982471181492L)) - .withVolumeAttachments(Arrays.asList("lqhykprlpyz", "uciqdsme", "iitdfuxt")); - model = BinaryData.fromObject(model).toObject(StorageProfile.class); - Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.osDisk().createOption()); - Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.osDisk().deleteOption()); - Assertions.assertEquals(150677982471181492L, model.osDisk().diskSizeGB()); - Assertions.assertEquals("lqhykprlpyz", model.volumeAttachments().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkAttachmentConfigurationTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkAttachmentConfigurationTests.java deleted file mode 100644 index 352f561e0791e..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkAttachmentConfigurationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.KubernetesPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkAttachmentConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class TrunkedNetworkAttachmentConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrunkedNetworkAttachmentConfiguration model - = BinaryData.fromString("{\"networkId\":\"nalaulppg\",\"pluginType\":\"IPVLAN\"}") - .toObject(TrunkedNetworkAttachmentConfiguration.class); - Assertions.assertEquals("nalaulppg", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.IPVLAN, model.pluginType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrunkedNetworkAttachmentConfiguration model - = new TrunkedNetworkAttachmentConfiguration().withNetworkId("nalaulppg") - .withPluginType(KubernetesPluginType.IPVLAN); - model = BinaryData.fromObject(model).toObject(TrunkedNetworkAttachmentConfiguration.class); - Assertions.assertEquals("nalaulppg", model.networkId()); - Assertions.assertEquals(KubernetesPluginType.IPVLAN, model.pluginType()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkInnerTests.java deleted file mode 100644 index 1563f11e136f0..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkInnerTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrunkedNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrunkedNetworkInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"ddyvvjskgfmo\",\"type\":\"wa\"},\"properties\":{\"associatedResourceIds\":[\"gat\",\"eaahhvjhhn\",\"kzyb\",\"jjidjk\"],\"clusterId\":\"xkyxvxevblbj\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"jlageu\",\"hybridAksClustersAssociatedIds\":[\"xuns\",\"jbnkpp\",\"ynenlsvxeizz\",\"wklnsrmffeyc\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"piymerteea\",\"isolationDomainIds\":[\"xqiekkkzddrtk\"],\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"mxvavrefdee\",\"vecuijpx\"],\"vlans\":[921543828288140521]},\"location\":\"prtujwsawdd\",\"tags\":{\"itvtzeexavo\":\"abxvi\",\"dmdqb\":\"tfgle\",\"cbslhhx\":\"pypqtgsfj\"},\"id\":\"db\",\"name\":\"vodhtn\",\"type\":\"irudh\"}") - .toObject(TrunkedNetworkInner.class); - Assertions.assertEquals("prtujwsawdd", model.location()); - Assertions.assertEquals("abxvi", model.tags().get("itvtzeexavo")); - Assertions.assertEquals("ddyvvjskgfmo", model.extendedLocation().name()); - Assertions.assertEquals("wa", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.hybridAksPluginType()); - Assertions.assertEquals("piymerteea", model.interfaceName()); - Assertions.assertEquals("xqiekkkzddrtk", model.isolationDomainIds().get(0)); - Assertions.assertEquals(921543828288140521L, model.vlans().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrunkedNetworkInner model = new TrunkedNetworkInner().withLocation("prtujwsawdd") - .withTags(mapOf("itvtzeexavo", "abxvi", "dmdqb", "tfgle", "cbslhhx", "pypqtgsfj")) - .withExtendedLocation(new ExtendedLocation().withName("ddyvvjskgfmo").withType("wa")) - .withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("piymerteea") - .withIsolationDomainIds(Arrays.asList("xqiekkkzddrtk")) - .withVlans(Arrays.asList(921543828288140521L)); - model = BinaryData.fromObject(model).toObject(TrunkedNetworkInner.class); - Assertions.assertEquals("prtujwsawdd", model.location()); - Assertions.assertEquals("abxvi", model.tags().get("itvtzeexavo")); - Assertions.assertEquals("ddyvvjskgfmo", model.extendedLocation().name()); - Assertions.assertEquals("wa", model.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.hybridAksPluginType()); - Assertions.assertEquals("piymerteea", model.interfaceName()); - Assertions.assertEquals("xqiekkkzddrtk", model.isolationDomainIds().get(0)); - Assertions.assertEquals(921543828288140521L, model.vlans().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkListTests.java deleted file mode 100644 index 43d906b0f12e8..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkListTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrunkedNetworkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrunkedNetworkList model = BinaryData.fromString( - "{\"nextLink\":\"aimlnwiaaom\",\"value\":[{\"extendedLocation\":{\"name\":\"eazulcs\",\"type\":\"thwwn\"},\"properties\":{\"associatedResourceIds\":[\"l\"],\"clusterId\":\"swpchwahfbousn\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"fewetwlyxgncx\",\"hybridAksClustersAssociatedIds\":[\"hdjhlimmbcx\",\"h\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"rxvxcjzh\",\"isolationDomainIds\":[\"zxfpxtgqsc\",\"avft\"],\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"azkmtgguwp\"],\"vlans\":[767059263997452674,7517246226041881019]},\"location\":\"vmmghfcfiwrxgk\",\"tags\":{\"zqodfvpgshox\":\"vyi\",\"zflbqvg\":\"sgbpfgzdjtx\",\"sdtutnwlduyc\":\"qvlgafcqusrdvetn\",\"kuqgsjjxundxgket\":\"uzhyrmewipmvekdx\"},\"id\":\"zhhzjhfjmhvvmu\",\"name\":\"gpmuneqsxvmhfbuz\",\"type\":\"yihsasbhudypohyu\"},{\"extendedLocation\":{\"name\":\"ms\",\"type\":\"ynsqyrpfoobr\"},\"properties\":{\"associatedResourceIds\":[\"y\"],\"clusterId\":\"jnygq\",\"detailedStatus\":\"Available\",\"detailedStatusMessage\":\"qzdz\",\"hybridAksClustersAssociatedIds\":[\"la\",\"hnfhqlyvijouwi\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"yzunbixxrtikv\",\"isolationDomainIds\":[\"wpgclrcivt\",\"oxfrkenxpmyyefr\",\"mpdnqqskawa\"],\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"bnpqfrtqlkzme\",\"nitgvkxlz\"],\"vlans\":[3259590014708036910,6287019732891771770,642502013923819576,8171214397183496400]},\"location\":\"zxwhcansymoyqhlw\",\"tags\":{\"wasqvdaeyyg\":\"ivbkbxgomfaj\"},\"id\":\"xakjsqzhzb\",\"name\":\"zkgimsid\",\"type\":\"asi\"}]}") - .toObject(TrunkedNetworkList.class); - Assertions.assertEquals("aimlnwiaaom", model.nextLink()); - Assertions.assertEquals("vmmghfcfiwrxgk", model.value().get(0).location()); - Assertions.assertEquals("vyi", model.value().get(0).tags().get("zqodfvpgshox")); - Assertions.assertEquals("eazulcs", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("thwwn", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("rxvxcjzh", model.value().get(0).interfaceName()); - Assertions.assertEquals("zxfpxtgqsc", model.value().get(0).isolationDomainIds().get(0)); - Assertions.assertEquals(767059263997452674L, model.value().get(0).vlans().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrunkedNetworkList model = new TrunkedNetworkList().withNextLink("aimlnwiaaom") - .withValue(Arrays.asList( - new TrunkedNetworkInner().withLocation("vmmghfcfiwrxgk") - .withTags(mapOf("zqodfvpgshox", "vyi", "zflbqvg", "sgbpfgzdjtx", "sdtutnwlduyc", "qvlgafcqusrdvetn", - "kuqgsjjxundxgket", "uzhyrmewipmvekdx")) - .withExtendedLocation(new ExtendedLocation().withName("eazulcs").withType("thwwn")) - .withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("rxvxcjzh") - .withIsolationDomainIds(Arrays.asList("zxfpxtgqsc", "avft")) - .withVlans(Arrays.asList(767059263997452674L, 7517246226041881019L)), - new TrunkedNetworkInner().withLocation("zxwhcansymoyqhlw") - .withTags(mapOf("wasqvdaeyyg", "ivbkbxgomfaj")) - .withExtendedLocation(new ExtendedLocation().withName("ms").withType("ynsqyrpfoobr")) - .withHybridAksPluginType(HybridAksPluginType.OSDEVICE) - .withInterfaceName("yzunbixxrtikv") - .withIsolationDomainIds(Arrays.asList("wpgclrcivt", "oxfrkenxpmyyefr", "mpdnqqskawa")) - .withVlans(Arrays.asList(3259590014708036910L, 6287019732891771770L, 642502013923819576L, - 8171214397183496400L)))); - model = BinaryData.fromObject(model).toObject(TrunkedNetworkList.class); - Assertions.assertEquals("aimlnwiaaom", model.nextLink()); - Assertions.assertEquals("vmmghfcfiwrxgk", model.value().get(0).location()); - Assertions.assertEquals("vyi", model.value().get(0).tags().get("zqodfvpgshox")); - Assertions.assertEquals("eazulcs", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("thwwn", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, model.value().get(0).hybridAksPluginType()); - Assertions.assertEquals("rxvxcjzh", model.value().get(0).interfaceName()); - Assertions.assertEquals("zxfpxtgqsc", model.value().get(0).isolationDomainIds().get(0)); - Assertions.assertEquals(767059263997452674L, model.value().get(0).vlans().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPatchParametersTests.java deleted file mode 100644 index a97f9060cd55f..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPatchParametersTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrunkedNetworkPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrunkedNetworkPatchParameters model = BinaryData.fromString( - "{\"tags\":{\"qaxsipietgbebjf\":\"pzdqtvhcspod\",\"pnfpubntnbat\":\"lbmoichd\",\"uhplrvkmjcwmjv\":\"viqsowsaaelcattc\"}}") - .toObject(TrunkedNetworkPatchParameters.class); - Assertions.assertEquals("pzdqtvhcspod", model.tags().get("qaxsipietgbebjf")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrunkedNetworkPatchParameters model = new TrunkedNetworkPatchParameters().withTags( - mapOf("qaxsipietgbebjf", "pzdqtvhcspod", "pnfpubntnbat", "lbmoichd", "uhplrvkmjcwmjv", "viqsowsaaelcattc")); - model = BinaryData.fromObject(model).toObject(TrunkedNetworkPatchParameters.class); - Assertions.assertEquals("pzdqtvhcspod", model.tags().get("qaxsipietgbebjf")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPropertiesTests.java deleted file mode 100644 index 693a1e33956c2..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworkPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkProperties; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TrunkedNetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrunkedNetworkProperties model = BinaryData.fromString( - "{\"associatedResourceIds\":[\"es\"],\"clusterId\":\"dlpagzrcxfail\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"m\",\"hybridAksClustersAssociatedIds\":[\"xdfgsftufqobr\",\"lnacgcc\",\"knh\"],\"hybridAksPluginType\":\"DPDK\",\"interfaceName\":\"v\",\"isolationDomainIds\":[\"nrzvuljraaer\",\"nok\",\"gukkjqnvbroy\"],\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"lcdisd\",\"sfjbjsvg\",\"rwhryvycytd\"],\"vlans\":[87313434350967654,4919215833349894285,5408599149275050969,3545804393254840755]}") - .toObject(TrunkedNetworkProperties.class); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("v", model.interfaceName()); - Assertions.assertEquals("nrzvuljraaer", model.isolationDomainIds().get(0)); - Assertions.assertEquals(87313434350967654L, model.vlans().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrunkedNetworkProperties model = new TrunkedNetworkProperties() - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("v") - .withIsolationDomainIds(Arrays.asList("nrzvuljraaer", "nok", "gukkjqnvbroy")) - .withVlans( - Arrays.asList(87313434350967654L, 4919215833349894285L, 5408599149275050969L, 3545804393254840755L)); - model = BinaryData.fromObject(model).toObject(TrunkedNetworkProperties.class); - Assertions.assertEquals(HybridAksPluginType.DPDK, model.hybridAksPluginType()); - Assertions.assertEquals("v", model.interfaceName()); - Assertions.assertEquals("nrzvuljraaer", model.isolationDomainIds().get(0)); - Assertions.assertEquals(87313434350967654L, model.vlans().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateMockTests.java deleted file mode 100644 index 87da5c808ee46..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TrunkedNetworksCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"vlizedvb\",\"type\":\"abv\"},\"properties\":{\"associatedResourceIds\":[\"ge\",\"zyqxadyfhbmwkh\"],\"clusterId\":\"qttbspvkhgla\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"yzstujrzxrkns\",\"hybridAksClustersAssociatedIds\":[\"lduyehiiittugyuq\",\"rldaxurfqa\",\"csozjv\",\"dzciggb\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"o\",\"isolationDomainIds\":[\"alzyxwhoeamo\",\"obdoey\",\"fpnimtwuuhaueg\",\"kwmnfeub\"],\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"kwfugiphrrkuu\"],\"vlans\":[3759154775204122401]},\"location\":\"rhzz\",\"tags\":{\"pwnibittozt\":\"ueoqusvwluj\"},\"id\":\"dqumqvfm\",\"name\":\"caddtgc\",\"type\":\"xegtvgwyur\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TrunkedNetwork response = manager.trunkedNetworks() - .define("qtrotpvclp") - .withRegion("rmvgoqplehmumkz") - .withExistingResourceGroup("wj") - .withExtendedLocation(new ExtendedLocation().withName("fyrlmwkptskwxj").withType("vhxccbmkakmkoo")) - .withIsolationDomainIds(Arrays.asList("jow", "yeyzm", "dsqcmhnxl")) - .withVlans(Arrays.asList(7344737615857384709L, 3877439825280273474L, 6320930867686077386L)) - .withTags(mapOf("rwnhkgqggoxsst", "czd", "cwmhlymgnukxrk", "ivrakfrryn", "zaudgjtfbclakkuc", "mjpequlr")) - .withHybridAksPluginType(HybridAksPluginType.DPDK) - .withInterfaceName("ibfiplhxfnsm") - .create(); - - Assertions.assertEquals("rhzz", response.location()); - Assertions.assertEquals("ueoqusvwluj", response.tags().get("pwnibittozt")); - Assertions.assertEquals("vlizedvb", response.extendedLocation().name()); - Assertions.assertEquals("abv", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.hybridAksPluginType()); - Assertions.assertEquals("o", response.interfaceName()); - Assertions.assertEquals("alzyxwhoeamo", response.isolationDomainIds().get(0)); - Assertions.assertEquals(3759154775204122401L, response.vlans().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteMockTests.java deleted file mode 100644 index 9baebbe87d9f1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 TrunkedNetworksDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.trunkedNetworks().delete("eqsifjmclngygnhr", "ombcdtajdopggo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index cf0de8a328ee0..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; -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 TrunkedNetworksGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"uylztpziizevjyk\",\"type\":\"fvezefk\"},\"properties\":{\"associatedResourceIds\":[\"twql\"],\"clusterId\":\"jjzkcasfwzc\",\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ffjwajnr\",\"hybridAksClustersAssociatedIds\":[\"vaqkifmxawost\",\"zkn\",\"rkmjqncfvdscnhe\",\"vwfnqqwypvn\"],\"hybridAksPluginType\":\"SRIOV\",\"interfaceName\":\"godtggrs\",\"isolationDomainIds\":[\"wjfkainjmuym\",\"ecvztsc\",\"gmusaictdscnkzzo\"],\"provisioningState\":\"Provisioning\",\"virtualMachinesAssociatedIds\":[\"clzeq\"],\"vlans\":[3676326296923776274,6951734822121621399,3402672547015760163,7210388224400521553]},\"location\":\"bnjrqvz\",\"tags\":{\"pam\":\"xozony\",\"yjxvc\":\"udpabcreuwzos\",\"gzygbaduveco\":\"asormrexzvdube\"},\"id\":\"sdqhzr\",\"name\":\"dbakr\",\"type\":\"imzfvpp\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TrunkedNetwork response = manager.trunkedNetworks() - .getByResourceGroupWithResponse("tb", "aqjmkgxqwque", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bnjrqvz", response.location()); - Assertions.assertEquals("xozony", response.tags().get("pam")); - Assertions.assertEquals("uylztpziizevjyk", response.extendedLocation().name()); - Assertions.assertEquals("fvezefk", response.extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.SRIOV, response.hybridAksPluginType()); - Assertions.assertEquals("godtggrs", response.interfaceName()); - Assertions.assertEquals("wjfkainjmuym", response.isolationDomainIds().get(0)); - Assertions.assertEquals(3676326296923776274L, response.vlans().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupMockTests.java deleted file mode 100644 index ffb59bde2a813..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; -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 TrunkedNetworksListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"pffmnoii\",\"type\":\"sudyh\"},\"properties\":{\"associatedResourceIds\":[\"jtalxrdsjr\",\"oluqwgusxxhdo\",\"pjwyblvtbdmvs\"],\"clusterId\":\"idaelqpvekmkwjfb\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"ggdusxu\",\"hybridAksClustersAssociatedIds\":[\"ivuxcjkcoqwczs\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"izfwihvaangqt\",\"isolationDomainIds\":[\"jr\",\"dmfdvbbaexxjfwtg\",\"fkkauigvmua\",\"mczfedyuepsvplt\"],\"provisioningState\":\"Succeeded\",\"virtualMachinesAssociatedIds\":[\"vy\",\"eocfkumcfjxok\"],\"vlans\":[6427718059276347798]},\"location\":\"asvfnkwmy\",\"tags\":{\"txkrdtulcrcjdk\":\"ekrknfdrugjqyck\",\"mzoonsvobchkxfpw\":\"otcsu\"},\"id\":\"dyslbklglmnn\",\"name\":\"kwayqshwy\",\"type\":\"xrid\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.trunkedNetworks().listByResourceGroup("lpbyxroiduyq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("asvfnkwmy", response.iterator().next().location()); - Assertions.assertEquals("ekrknfdrugjqyck", response.iterator().next().tags().get("txkrdtulcrcjdk")); - Assertions.assertEquals("pffmnoii", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("sudyh", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("izfwihvaangqt", response.iterator().next().interfaceName()); - Assertions.assertEquals("jr", response.iterator().next().isolationDomainIds().get(0)); - Assertions.assertEquals(6427718059276347798L, response.iterator().next().vlans().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListMockTests.java deleted file mode 100644 index 563db430f8cd1..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; -import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; -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 TrunkedNetworksListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"hzwxq\",\"type\":\"ejp\"},\"properties\":{\"associatedResourceIds\":[\"hvtozyagjjnxkb\",\"lh\",\"yxg\"],\"clusterId\":\"klvqzrwtrdgscn\",\"detailedStatus\":\"Provisioning\",\"detailedStatusMessage\":\"nsgnwxlwmez\",\"hybridAksClustersAssociatedIds\":[\"xpthceopvkvt\",\"fve\",\"obpbokhmm\"],\"hybridAksPluginType\":\"OSDevice\",\"interfaceName\":\"arnggcjfwblqh\",\"isolationDomainIds\":[\"asmcolmugpyvaos\",\"kluwz\",\"eygzvtyevjhu\",\"nobguqisqsqkpdmi\"],\"provisioningState\":\"Canceled\",\"virtualMachinesAssociatedIds\":[\"mlviqcpszpmcvqdv\",\"dmvxyrxdhgvqojb\"],\"vlans\":[2010350344823941297,6106416782592877568,4720543683832895411]},\"location\":\"mbtple\",\"tags\":{\"dawsxmrsz\":\"oyidoxznvgvdtmuu\",\"erxrzutylcurza\":\"knimxlp\",\"qaeht\":\"mnb\"},\"id\":\"bjmbnvynfaooeac\",\"name\":\"edcgl\",\"type\":\"kakddidahzllrqm\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.trunkedNetworks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mbtple", response.iterator().next().location()); - Assertions.assertEquals("oyidoxznvgvdtmuu", response.iterator().next().tags().get("dawsxmrsz")); - Assertions.assertEquals("hzwxq", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("ejp", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(HybridAksPluginType.OSDEVICE, response.iterator().next().hybridAksPluginType()); - Assertions.assertEquals("arnggcjfwblqh", response.iterator().next().interfaceName()); - Assertions.assertEquals("asmcolmugpyvaos", response.iterator().next().isolationDomainIds().get(0)); - Assertions.assertEquals(2010350344823941297L, response.iterator().next().vlans().get(0)); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ValidationThresholdTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ValidationThresholdTests.java deleted file mode 100644 index 3daf6a9db7c40..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/ValidationThresholdTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; -import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; -import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; -import org.junit.jupiter.api.Assertions; - -public final class ValidationThresholdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidationThreshold model = BinaryData - .fromString("{\"grouping\":\"PerRack\",\"type\":\"CountSuccess\",\"value\":1449809140711379739}") - .toObject(ValidationThreshold.class); - Assertions.assertEquals(ValidationThresholdGrouping.PER_RACK, model.grouping()); - Assertions.assertEquals(ValidationThresholdType.COUNT_SUCCESS, model.type()); - Assertions.assertEquals(1449809140711379739L, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidationThreshold model = new ValidationThreshold().withGrouping(ValidationThresholdGrouping.PER_RACK) - .withType(ValidationThresholdType.COUNT_SUCCESS) - .withValue(1449809140711379739L); - model = BinaryData.fromObject(model).toObject(ValidationThreshold.class); - Assertions.assertEquals(ValidationThresholdGrouping.PER_RACK, model.grouping()); - Assertions.assertEquals(ValidationThresholdType.COUNT_SUCCESS, model.type()); - Assertions.assertEquals(1449809140711379739L, model.value()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePlacementHintTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePlacementHintTests.java deleted file mode 100644 index de56203914cc7..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePlacementHintTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; -import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintPodAffinityScope; -import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintType; -import com.azure.resourcemanager.networkcloud.models.VirtualMachineSchedulingExecution; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachinePlacementHintTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachinePlacementHint model = BinaryData.fromString( - "{\"hintType\":\"Affinity\",\"resourceId\":\"inmfgvxirp\",\"schedulingExecution\":\"Soft\",\"scope\":\"Machine\"}") - .toObject(VirtualMachinePlacementHint.class); - Assertions.assertEquals(VirtualMachinePlacementHintType.AFFINITY, model.hintType()); - Assertions.assertEquals("inmfgvxirp", model.resourceId()); - Assertions.assertEquals(VirtualMachineSchedulingExecution.SOFT, model.schedulingExecution()); - Assertions.assertEquals(VirtualMachinePlacementHintPodAffinityScope.MACHINE, model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachinePlacementHint model - = new VirtualMachinePlacementHint().withHintType(VirtualMachinePlacementHintType.AFFINITY) - .withResourceId("inmfgvxirp") - .withSchedulingExecution(VirtualMachineSchedulingExecution.SOFT) - .withScope(VirtualMachinePlacementHintPodAffinityScope.MACHINE); - model = BinaryData.fromObject(model).toObject(VirtualMachinePlacementHint.class); - Assertions.assertEquals(VirtualMachinePlacementHintType.AFFINITY, model.hintType()); - Assertions.assertEquals("inmfgvxirp", model.resourceId()); - Assertions.assertEquals(VirtualMachineSchedulingExecution.SOFT, model.schedulingExecution()); - Assertions.assertEquals(VirtualMachinePlacementHintPodAffinityScope.MACHINE, model.scope()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePowerOffParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePowerOffParametersTests.java deleted file mode 100644 index bcb17650dbc66..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinePowerOffParametersTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.SkipShutdown; -import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachinePowerOffParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachinePowerOffParameters model - = BinaryData.fromString("{\"skipShutdown\":\"True\"}").toObject(VirtualMachinePowerOffParameters.class); - Assertions.assertEquals(SkipShutdown.TRUE, model.skipShutdown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachinePowerOffParameters model - = new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE); - model = BinaryData.fromObject(model).toObject(VirtualMachinePowerOffParameters.class); - Assertions.assertEquals(SkipShutdown.TRUE, model.skipShutdown()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteMockTests.java deleted file mode 100644 index 8735743b69ecb..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 VirtualMachinesDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.virtualMachines().delete("sx", "fo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffMockTests.java deleted file mode 100644 index a71270ec01fe0..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -import com.azure.resourcemanager.networkcloud.models.SkipShutdown; -import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; -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 VirtualMachinesPowerOffMockTests { - @Test - public void testPowerOff() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"zfova\",\"resourceId\":\"rvaprtgelgwe\",\"name\":\"kfyaqandmymnq\",\"status\":\"qjumovs\",\"percentComplete\":99.1592,\"startTime\":\"2021-07-04T13:36:07Z\",\"endTime\":\"2021-07-05T03:23:03Z\",\"operations\":[{\"id\":\"mfmvsmc\",\"resourceId\":\"xfaxdtnq\",\"name\":\"bsat\",\"status\":\"oiauesugmocpcj\",\"percentComplete\":19.800335,\"startTime\":\"2021-09-12T18:19:26Z\",\"endTime\":\"2021-09-30T20:45:51Z\",\"operations\":[{\"id\":\"wfldsiuorinik\",\"resourceId\":\"dpk\",\"name\":\"iwm\",\"status\":\"tmqrxrzqv\",\"percentComplete\":79.912384,\"startTime\":\"2021-05-04T07:33:29Z\",\"endTime\":\"2020-12-22T20:01:34Z\",\"operations\":[{\"status\":\"tg\"},{\"status\":\"bxiqahragpxmibpl\"}]},{\"id\":\"o\",\"resourceId\":\"yefqmwovyztx\",\"name\":\"omfpb\",\"status\":\"ceeg\",\"percentComplete\":76.99202,\"startTime\":\"2021-03-19T02:35:38Z\",\"endTime\":\"2021-06-22T16:53:33Z\",\"operations\":[{\"status\":\"nji\"},{\"status\":\"l\"},{\"status\":\"kkreh\"}]},{\"id\":\"mjodu\",\"resourceId\":\"vulxfar\",\"name\":\"vjlgdez\",\"status\":\"jqwahoyi\",\"percentComplete\":24.621027,\"startTime\":\"2021-05-10T10:57:12Z\",\"endTime\":\"2021-03-12T00:08:49Z\",\"operations\":[{\"status\":\"wtc\"}]},{\"id\":\"dn\",\"resourceId\":\"vbooqbmdqrxy\",\"name\":\"ae\",\"status\":\"scflwtjdtlri\",\"percentComplete\":15.551186,\"startTime\":\"2021-01-15T17:14:16Z\",\"endTime\":\"2021-06-05T19:31:26Z\",\"operations\":[{\"status\":\"dtzcqi\"},{\"status\":\"sdudgcoz\"},{\"status\":\"omehx\"},{\"status\":\"antolamlbijuxkq\"}]}]},{\"id\":\"i\",\"resourceId\":\"wdtgckzdqiqdl\",\"name\":\"trkwxo\",\"status\":\"uwxsuykznhrfgsl\",\"percentComplete\":76.29438,\"startTime\":\"2021-03-17T10:19:29Z\",\"endTime\":\"2021-04-04T13:51:46Z\",\"operations\":[{\"id\":\"huioaeoc\",\"resourceId\":\"jtfeyvkbdgddkr\",\"name\":\"ccxbeuuqutkz\",\"status\":\"tjwwg\",\"percentComplete\":63.36705,\"startTime\":\"2021-05-01T01:18:11Z\",\"endTime\":\"2020-12-25T15:40:25Z\",\"operations\":[{\"status\":\"nondegjdyd\"}]},{\"id\":\"kkbjuckcatuq\",\"resourceId\":\"powcnxtpzdlys\",\"name\":\"dtoakatpryt\",\"status\":\"rhzbqfdpfaw\",\"percentComplete\":82.89093,\"startTime\":\"2021-06-23T18:35:29Z\",\"endTime\":\"2021-03-06T14:26:54Z\",\"operations\":[{\"status\":\"utzcttbqgdirda\"},{\"status\":\"m\"}]},{\"id\":\"gcfjfxtbwjjirmu\",\"resourceId\":\"gftt\",\"name\":\"ofgeoagf\",\"status\":\"oftnxodwxm\",\"percentComplete\":93.54171,\"startTime\":\"2021-06-01T19:09:40Z\",\"endTime\":\"2021-01-22T01:23:44Z\",\"operations\":[{\"status\":\"sevmdmzenlrstg\"},{\"status\":\"czljdnci\"}]}]},{\"id\":\"amyyznmrgcdogcv\",\"resourceId\":\"gytoxuwhtt\",\"name\":\"qsaqmebgszplu\",\"status\":\"dekpdzzmssg\",\"percentComplete\":98.44238,\"startTime\":\"2021-09-27T12:48:36Z\",\"endTime\":\"2020-12-25T21:06:22Z\",\"operations\":[{\"id\":\"bdqzsqunycwz\",\"resourceId\":\"vvw\",\"name\":\"mrkkyjtr\",\"status\":\"pwpwfkcauxuva\",\"percentComplete\":36.006676,\"startTime\":\"2021-01-12T22:16:55Z\",\"endTime\":\"2021-01-27T14:31:15Z\",\"operations\":[{\"status\":\"ckcl\"},{\"status\":\"txluevs\"},{\"status\":\"lzwilfngojf\"},{\"status\":\"qebuuxjxhfxfjwp\"}]},{\"id\":\"tpmbmxbmbrwgz\",\"resourceId\":\"ljbkhxsdplau\",\"name\":\"dmhweqjfyxydgto\",\"status\":\"vq\",\"percentComplete\":52.457535,\"startTime\":\"2021-09-14T09:59:06Z\",\"endTime\":\"2021-05-30T12:55:16Z\",\"operations\":[{\"status\":\"vxakglh\"},{\"status\":\"ses\"},{\"status\":\"fga\"},{\"status\":\"qiy\"}]}]},{\"id\":\"gdhyhgoq\",\"resourceId\":\"oyqyxyjrcbqpb\",\"name\":\"pglqjo\",\"status\":\"tdahneaoovtyjzti\",\"percentComplete\":70.834885,\"startTime\":\"2021-06-17T15:12:27Z\",\"endTime\":\"2021-10-22T05:39:36Z\",\"operations\":[{\"id\":\"fsr\",\"resourceId\":\"uklajvcfoc\",\"name\":\"apejovtkwx\",\"status\":\"hwhhnoyrzaaoe\",\"percentComplete\":26.431053,\"startTime\":\"2021-11-18T14:44:42Z\",\"endTime\":\"2021-08-16T00:53:56Z\",\"operations\":[{\"status\":\"eat\"},{\"status\":\"axxcrxoxdj\"}]},{\"id\":\"n\",\"resourceId\":\"yyi\",\"name\":\"kd\",\"status\":\"lrndwdbvxvza\",\"percentComplete\":25.453287,\"startTime\":\"2021-10-20T20:05:42Z\",\"endTime\":\"2021-01-09T13:50:06Z\",\"operations\":[{\"status\":\"nkfthmcxqqxmyz\"},{\"status\":\"laoanpohrvmz\"},{\"status\":\"qr\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = manager.virtualMachines() - .powerOff("uworimmov", "wdehk", new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zfova", response.id()); - Assertions.assertEquals("kfyaqandmymnq", response.name()); - Assertions.assertEquals("qjumovs", response.status()); - Assertions.assertEquals(99.1592F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T13:36:07Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T03:23:03Z"), response.endTime()); - Assertions.assertEquals("mfmvsmc", response.operations().get(0).id()); - Assertions.assertEquals("bsat", response.operations().get(0).name()); - Assertions.assertEquals("oiauesugmocpcj", response.operations().get(0).status()); - Assertions.assertEquals(19.800335F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-12T18:19:26Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-30T20:45:51Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("wfldsiuorinik", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("iwm", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("tmqrxrzqv", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(79.912384F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T07:33:29Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-22T20:01:34Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("tg", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageMockTests.java deleted file mode 100644 index fd652aa22686d..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 VirtualMachinesReimageMockTests { - @Test - public void testReimage() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"hjqjpv\",\"resourceId\":\"ihxjtgzgtai\",\"name\":\"b\",\"status\":\"groigbsfsgsa\",\"percentComplete\":4.055786,\"startTime\":\"2021-02-21T16:42:49Z\",\"endTime\":\"2021-10-07T09:17:53Z\",\"operations\":[{\"id\":\"qlxspmrj\",\"resourceId\":\"ryldsxeb\",\"name\":\"sxrznmg\",\"status\":\"daluy\",\"percentComplete\":21.716427,\"startTime\":\"2021-03-17T07:43:50Z\",\"endTime\":\"2021-10-19T14:14:31Z\",\"operations\":[{\"id\":\"uerbgpxebjl\",\"resourceId\":\"caytujraxdtpryj\",\"name\":\"tnsewou\",\"status\":\"ly\",\"percentComplete\":78.11937,\"startTime\":\"2021-09-28T10:44:47Z\",\"endTime\":\"2021-11-21T20:30:05Z\",\"operations\":[{\"status\":\"kepo\"},{\"status\":\"ehqqylm\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.virtualMachines().reimage("ivznllas", "k", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hjqjpv", response.id()); - Assertions.assertEquals("b", response.name()); - Assertions.assertEquals("groigbsfsgsa", response.status()); - Assertions.assertEquals(4.055786F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-21T16:42:49Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T09:17:53Z"), response.endTime()); - Assertions.assertEquals("qlxspmrj", response.operations().get(0).id()); - Assertions.assertEquals("sxrznmg", response.operations().get(0).name()); - Assertions.assertEquals("daluy", response.operations().get(0).status()); - Assertions.assertEquals(21.716427F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T07:43:50Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T14:14:31Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("uerbgpxebjl", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("tnsewou", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("ly", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(78.11937F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T10:44:47Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T20:30:05Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("kepo", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartMockTests.java deleted file mode 100644 index 4f284d5bcec57..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 VirtualMachinesRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"kxerxxx\",\"resourceId\":\"eehk\",\"name\":\"wgomvvhxow\",\"status\":\"c\",\"percentComplete\":15.02164,\"startTime\":\"2021-07-31T22:42:59Z\",\"endTime\":\"2021-01-03T20:16:37Z\",\"operations\":[{\"id\":\"wbmpspfeylqloc\",\"resourceId\":\"ujexayglxrk\",\"name\":\"nmzpas\",\"status\":\"avxjfiuofpiei\",\"percentComplete\":13.99284,\"startTime\":\"2021-11-20T07:29:01Z\",\"endTime\":\"2021-06-24T17:45:24Z\",\"operations\":[{\"id\":\"opac\",\"resourceId\":\"hydv\",\"name\":\"mfngpmillxgjsci\",\"status\":\"wgsoriobijeiydy\",\"percentComplete\":58.741135,\"startTime\":\"2021-06-30T16:18:41Z\",\"endTime\":\"2021-01-30T20:03:07Z\",\"operations\":[{\"status\":\"yrgwy\"},{\"status\":\"ri\"}]},{\"id\":\"weoftnorw\",\"resourceId\":\"gsioc\",\"name\":\"kmv\",\"status\":\"a\",\"percentComplete\":24.349243,\"startTime\":\"2021-04-14T08:01:15Z\",\"endTime\":\"2021-05-30T09:27:09Z\",\"operations\":[{\"status\":\"jnwosst\"}]},{\"id\":\"tvlxxzqfcwr\",\"resourceId\":\"omxeezwyhjmb\",\"name\":\"qegm\",\"status\":\"db\",\"percentComplete\":11.82003,\"startTime\":\"2021-11-16T03:21:26Z\",\"endTime\":\"2021-10-28T18:01:39Z\",\"operations\":[{\"status\":\"dkgd\"}]},{\"id\":\"z\",\"resourceId\":\"anzbjekwuyckyvn\",\"name\":\"smuffiwjb\",\"status\":\"tvbpzujqj\",\"percentComplete\":14.829654,\"startTime\":\"2021-01-15T10:39:13Z\",\"endTime\":\"2021-10-26T20:39:49Z\",\"operations\":[{\"status\":\"slhwuusieckty\"},{\"status\":\"h\"},{\"status\":\"uxidhhxomilddxj\"}]}]},{\"id\":\"xwjwilm\",\"resourceId\":\"sl\",\"name\":\"teptwujjzgxqgqwl\",\"status\":\"rhgtvhv\",\"percentComplete\":39.35091,\"startTime\":\"2021-07-30T10:08:24Z\",\"endTime\":\"2021-08-25T02:49:35Z\",\"operations\":[{\"id\":\"ozejo\",\"resourceId\":\"korvvm\",\"name\":\"cof\",\"status\":\"qhlbsnosnqliwkm\",\"percentComplete\":4.292619,\"startTime\":\"2021-02-02T13:01:19Z\",\"endTime\":\"2021-08-11T13:39:15Z\",\"operations\":[{\"status\":\"htgmknazgbj\"},{\"status\":\"hrp\"}]},{\"id\":\"sttcucrcmm\",\"resourceId\":\"xp\",\"name\":\"iwifhbk\",\"status\":\"ldtt\",\"percentComplete\":51.837635,\"startTime\":\"2021-10-19T06:31:48Z\",\"endTime\":\"2021-08-05T21:26:21Z\",\"operations\":[{\"status\":\"tgs\"}]}]},{\"id\":\"vllrhtpmglxk\",\"resourceId\":\"km\",\"name\":\"awr\",\"status\":\"kzawbunmpaklwzlw\",\"percentComplete\":78.60771,\"startTime\":\"2021-06-17T22:30:27Z\",\"endTime\":\"2021-02-04T22:42:16Z\",\"operations\":[{\"id\":\"kaszfjsxscbdu\",\"resourceId\":\"pg\",\"name\":\"qebmvrdjomlnwsb\",\"status\":\"vdlsflxkqesdfeds\",\"percentComplete\":56.19114,\"startTime\":\"2021-11-11T01:48:52Z\",\"endTime\":\"2021-04-11T01:16:12Z\",\"operations\":[{\"status\":\"mphymcqidkl\"},{\"status\":\"vdhqnufbxw\"},{\"status\":\"iibntojo\"},{\"status\":\"fnybydhuihaouw\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.virtualMachines().restart("jwd", "dl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kxerxxx", response.id()); - Assertions.assertEquals("wgomvvhxow", response.name()); - Assertions.assertEquals("c", response.status()); - Assertions.assertEquals(15.02164F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T22:42:59Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-03T20:16:37Z"), response.endTime()); - Assertions.assertEquals("wbmpspfeylqloc", response.operations().get(0).id()); - Assertions.assertEquals("nmzpas", response.operations().get(0).name()); - Assertions.assertEquals("avxjfiuofpiei", response.operations().get(0).status()); - Assertions.assertEquals(13.99284F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T07:29:01Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T17:45:24Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("opac", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("mfngpmillxgjsci", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("wgsoriobijeiydy", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(58.741135F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T16:18:41Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T20:03:07Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("yrgwy", response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartMockTests.java deleted file mode 100644 index 7fea577328648..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.OperationStatusResult; -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 VirtualMachinesStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"id\":\"gejcvjkjyczc\",\"resourceId\":\"age\",\"name\":\"jdyol\",\"status\":\"eqyxqfmzsiz\",\"percentComplete\":63.244267,\"startTime\":\"2021-06-25T15:18:38Z\",\"endTime\":\"2021-04-23T04:26:45Z\",\"operations\":[{\"id\":\"ymgqbgcx\",\"resourceId\":\"qxgzxler\",\"name\":\"merghski\",\"status\":\"hnp\",\"percentComplete\":57.21261,\"startTime\":\"2021-03-02T04:05:56Z\",\"endTime\":\"2021-02-15T10:23:10Z\",\"operations\":[{\"id\":\"l\",\"resourceId\":\"nvtsdydshkpafyal\",\"name\":\"ww\",\"status\":\"izzn\",\"percentComplete\":4.9079537,\"startTime\":\"2021-12-01T15:36:33Z\",\"endTime\":\"2021-04-07T13:51:15Z\",\"operations\":[{\"status\":\"fgufyjfdkqiy\"},{\"status\":\"ndjokgwesymzqh\"},{\"status\":\"qpfzlpejtznxlue\"},{\"status\":\"ujqbbgsimwejl\"}]},{\"id\":\"bpjzobdwbcpraswk\",\"resourceId\":\"ydtnaczkfwfatgaw\",\"name\":\"nskivdwgt\",\"status\":\"cumecsaaqg\",\"percentComplete\":35.443123,\"startTime\":\"2021-09-01T02:27:35Z\",\"endTime\":\"2021-08-02T21:58:18Z\",\"operations\":[{\"status\":\"bskowkr\"},{\"status\":\"hzhrbkhtm\"},{\"status\":\"owiuasfgq\"}]},{\"id\":\"yhfaimqvd\",\"resourceId\":\"ozkgyfpeoehg\",\"name\":\"qmskkixv\",\"status\":\"zjxplhpevasy\",\"percentComplete\":46.632397,\"startTime\":\"2021-10-23T18:44:15Z\",\"endTime\":\"2021-11-03T17:31:08Z\",\"operations\":[{\"status\":\"bqrvvbqv\"},{\"status\":\"nmpecqxgiqasifub\"},{\"status\":\"snstl\"},{\"status\":\"wqpjnxjkhtupsvy\"}]},{\"id\":\"euiyxfwkztsms\",\"resourceId\":\"evyllznfhkqyt\",\"name\":\"tadopgfzdg\",\"status\":\"fcycrsvlo\",\"percentComplete\":4.3409467,\"startTime\":\"2020-12-24T08:37:06Z\",\"endTime\":\"2021-08-07T20:15:24Z\",\"operations\":[{\"status\":\"uqw\"},{\"status\":\"ajquzxpixhyoi\"}]}]},{\"id\":\"bgsosc\",\"resourceId\":\"nezfvbennmfkbpj\",\"name\":\"tekwwnthropm\",\"status\":\"ud\",\"percentComplete\":37.443043,\"startTime\":\"2021-03-10T01:38:22Z\",\"endTime\":\"2021-05-17T15:02:17Z\",\"operations\":[{\"id\":\"jhf\",\"resourceId\":\"cqkoqyouerg\",\"name\":\"hpuzxkpye\",\"status\":\"hfdyldhgye\",\"percentComplete\":42.56546,\"startTime\":\"2021-02-18T09:07:49Z\",\"endTime\":\"2021-05-11T03:44:14Z\",\"operations\":[{\"status\":\"htdereun\"},{\"status\":\"kakzwhpjlwy\"},{\"status\":\"edznmxrfomckewv\"},{\"status\":\"yifop\"}]},{\"id\":\"jt\",\"resourceId\":\"yzoutxfptofh\",\"name\":\"uywezygvadg\",\"status\":\"aqwvkgjpytpmpvdn\",\"percentComplete\":0.2601564,\"startTime\":\"2021-10-27T11:51:17Z\",\"endTime\":\"2021-02-05T02:56:16Z\",\"operations\":[{\"status\":\"rtbnu\"},{\"status\":\"k\"},{\"status\":\"axzs\"}]}]},{\"id\":\"yjisskobq\",\"resourceId\":\"lflioewyhxessm\",\"name\":\"kdpsqeqfbd\",\"status\":\"mdsesbrujbjpp\",\"percentComplete\":18.978035,\"startTime\":\"2021-03-16T17:50:03Z\",\"endTime\":\"2021-01-23T11:21:01Z\",\"operations\":[{\"id\":\"th\",\"resourceId\":\"at\",\"name\":\"jrnm\",\"status\":\"nzqplgtkihonikzs\",\"percentComplete\":4.6403112,\"startTime\":\"2021-09-01T23:39:41Z\",\"endTime\":\"2021-01-01T07:39:09Z\",\"operations\":[{\"status\":\"fbpntogke\"}]},{\"id\":\"khbmcarmoyfxxk\",\"resourceId\":\"kuqdndxlykhkg\",\"name\":\"pvd\",\"status\":\"t\",\"percentComplete\":92.11887,\"startTime\":\"2021-03-18T15:35:52Z\",\"endTime\":\"2021-04-08T11:55:58Z\",\"operations\":[{\"status\":\"rnrnjrcufmbgacnr\"},{\"status\":\"fdtncmspsanma\"},{\"status\":\"eubkqiqmlf\"},{\"status\":\"hlq\"}]},{\"id\":\"kqj\",\"resourceId\":\"pt\",\"name\":\"ipuugkwdrqmr\",\"status\":\"ahuuonjkkxukg\",\"percentComplete\":30.199629,\"startTime\":\"2021-11-04T15:53:15Z\",\"endTime\":\"2021-02-23T21:43:03Z\",\"operations\":[{\"status\":\"gcjojlleui\"},{\"status\":\"pmtonvhgnhtm\"},{\"status\":\"plhbpjbapmummmkv\"}]}]}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response - = manager.virtualMachines().start("aorhjkehwvumo", "qircamqprlob", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gejcvjkjyczc", response.id()); - Assertions.assertEquals("jdyol", response.name()); - Assertions.assertEquals("eqyxqfmzsiz", response.status()); - Assertions.assertEquals(63.244267F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T15:18:38Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T04:26:45Z"), response.endTime()); - Assertions.assertEquals("ymgqbgcx", response.operations().get(0).id()); - Assertions.assertEquals("merghski", response.operations().get(0).name()); - Assertions.assertEquals("hnp", response.operations().get(0).status()); - Assertions.assertEquals(57.21261F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T04:05:56Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T10:23:10Z"), response.operations().get(0).endTime()); - Assertions.assertEquals("l", response.operations().get(0).operations().get(0).id()); - Assertions.assertEquals("ww", response.operations().get(0).operations().get(0).name()); - Assertions.assertEquals("izzn", response.operations().get(0).operations().get(0).status()); - Assertions.assertEquals(4.9079537F, response.operations().get(0).operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T15:36:33Z"), - response.operations().get(0).operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T13:51:15Z"), - response.operations().get(0).operations().get(0).endTime()); - Assertions.assertEquals("fgufyjfdkqiy", - response.operations().get(0).operations().get(0).operations().get(0).status()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeInnerTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeInnerTests.java deleted file mode 100644 index 4abdb82cc4117..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeInnerTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VolumeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeInner model = BinaryData.fromString( - "{\"extendedLocation\":{\"name\":\"qzinkfkbg\",\"type\":\"z\"},\"properties\":{\"attachedTo\":[\"xeqoc\",\"jmygvk\",\"qkjjeokbz\",\"fezrx\"],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"rtle\",\"provisioningState\":\"Provisioning\",\"serialNumber\":\"bkwvzg\",\"sizeMiB\":3286584437525688934},\"location\":\"fbzdixzmqpnoda\",\"tags\":{\"tmcg\":\"qhewj\"},\"id\":\"bostzel\",\"name\":\"dlat\",\"type\":\"tmzlbiojlv\"}") - .toObject(VolumeInner.class); - Assertions.assertEquals("fbzdixzmqpnoda", model.location()); - Assertions.assertEquals("qhewj", model.tags().get("tmcg")); - Assertions.assertEquals("qzinkfkbg", model.extendedLocation().name()); - Assertions.assertEquals("z", model.extendedLocation().type()); - Assertions.assertEquals(3286584437525688934L, model.sizeMiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeInner model = new VolumeInner().withLocation("fbzdixzmqpnoda") - .withTags(mapOf("tmcg", "qhewj")) - .withExtendedLocation(new ExtendedLocation().withName("qzinkfkbg").withType("z")) - .withSizeMiB(3286584437525688934L); - model = BinaryData.fromObject(model).toObject(VolumeInner.class); - Assertions.assertEquals("fbzdixzmqpnoda", model.location()); - Assertions.assertEquals("qhewj", model.tags().get("tmcg")); - Assertions.assertEquals("qzinkfkbg", model.extendedLocation().name()); - Assertions.assertEquals("z", model.extendedLocation().type()); - Assertions.assertEquals(3286584437525688934L, model.sizeMiB()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeListTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeListTests.java deleted file mode 100644 index 0b5abfaa69ab2..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumeListTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.VolumeList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VolumeListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeList model = BinaryData.fromString( - "{\"nextLink\":\"hcmavmqfo\",\"value\":[{\"extendedLocation\":{\"name\":\"rhc\",\"type\":\"yyprotwyp\"},\"properties\":{\"attachedTo\":[\"mbxhugcmjkav\"],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"bmftpmdt\",\"provisioningState\":\"Succeeded\",\"serialNumber\":\"tfvnz\",\"sizeMiB\":1221267442521821688},\"location\":\"otp\",\"tags\":{\"ihed\":\"vpbdbzqgq\",\"mkyi\":\"vqwt\",\"qcwdhoh\":\"cysihs\",\"sufco\":\"dtmcd\"},\"id\":\"dxbzlmcmuap\",\"name\":\"vhdbevwqqxey\",\"type\":\"ko\"}]}") - .toObject(VolumeList.class); - Assertions.assertEquals("hcmavmqfo", model.nextLink()); - Assertions.assertEquals("otp", model.value().get(0).location()); - Assertions.assertEquals("vpbdbzqgq", model.value().get(0).tags().get("ihed")); - Assertions.assertEquals("rhc", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("yyprotwyp", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(1221267442521821688L, model.value().get(0).sizeMiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeList model = new VolumeList().withNextLink("hcmavmqfo") - .withValue(Arrays.asList(new VolumeInner().withLocation("otp") - .withTags(mapOf("ihed", "vpbdbzqgq", "mkyi", "vqwt", "qcwdhoh", "cysihs", "sufco", "dtmcd")) - .withExtendedLocation(new ExtendedLocation().withName("rhc").withType("yyprotwyp")) - .withSizeMiB(1221267442521821688L))); - model = BinaryData.fromObject(model).toObject(VolumeList.class); - Assertions.assertEquals("hcmavmqfo", model.nextLink()); - Assertions.assertEquals("otp", model.value().get(0).location()); - Assertions.assertEquals("vpbdbzqgq", model.value().get(0).tags().get("ihed")); - Assertions.assertEquals("rhc", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("yyprotwyp", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(1221267442521821688L, model.value().get(0).sizeMiB()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePatchParametersTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePatchParametersTests.java deleted file mode 100644 index 4ee0b536b594c..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePatchParametersTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VolumePatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumePatchParameters model - = BinaryData.fromString("{\"tags\":{\"ejchcsrlz\":\"vdulajv\"}}").toObject(VolumePatchParameters.class); - Assertions.assertEquals("vdulajv", model.tags().get("ejchcsrlz")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumePatchParameters model = new VolumePatchParameters().withTags(mapOf("ejchcsrlz", "vdulajv")); - model = BinaryData.fromObject(model).toObject(VolumePatchParameters.class); - Assertions.assertEquals("vdulajv", model.tags().get("ejchcsrlz")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePropertiesTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePropertiesTests.java deleted file mode 100644 index aa230dd185536..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumePropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.networkcloud.fluent.models.VolumeProperties; -import org.junit.jupiter.api.Assertions; - -public final class VolumePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeProperties model = BinaryData.fromString( - "{\"attachedTo\":[\"bbpneqvcwwy\",\"urmochpprprs\",\"mo\",\"ayzejnhlbkpbz\"],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"ljhah\",\"provisioningState\":\"Failed\",\"serialNumber\":\"h\",\"sizeMiB\":2977319405795581090}") - .toObject(VolumeProperties.class); - Assertions.assertEquals(2977319405795581090L, model.sizeMiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeProperties model = new VolumeProperties().withSizeMiB(2977319405795581090L); - model = BinaryData.fromObject(model).toObject(VolumeProperties.class); - Assertions.assertEquals(2977319405795581090L, model.sizeMiB()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateMockTests.java deleted file mode 100644 index 7d19d6524d867..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; -import com.azure.resourcemanager.networkcloud.models.Volume; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumesCreateOrUpdateMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"kvbos\",\"type\":\"jfdizhrjqfya\"},\"properties\":{\"attachedTo\":[\"slyekcgn\",\"uarlcjiwgsxfaioc\",\"dgujjgnfgrzxbarc\",\"paefzqsy\"],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"njcytesmfucrtfod\",\"provisioningState\":\"Succeeded\",\"serialNumber\":\"uzmzivrtrfzh\",\"sizeMiB\":4810474092378413108},\"location\":\"hjud\",\"tags\":{\"xbqssgfenffdxbvw\":\"yrudmahswtvd\"},\"id\":\"qjchivd\",\"name\":\"ija\",\"type\":\"xndmuvar\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Volume response = manager.volumes() - .define("zkgtzqn") - .withRegion("nrjdszdbu") - .withExistingResourceGroup("pkvegeatt") - .withExtendedLocation(new ExtendedLocation().withName("qsttewuvcysjeuf").withType("x")) - .withSizeMiB(2762545810950883647L) - .withTags(mapOf("fwjnoxuoxtfn", "iqppoqvgpnewuh", "gvsnv", "essfepgckncj", "mjymjnh", "tqdx")) - .create(); - - Assertions.assertEquals("hjud", response.location()); - Assertions.assertEquals("yrudmahswtvd", response.tags().get("xbqssgfenffdxbvw")); - Assertions.assertEquals("kvbos", response.extendedLocation().name()); - Assertions.assertEquals("jfdizhrjqfya", response.extendedLocation().type()); - Assertions.assertEquals(4810474092378413108L, response.sizeMiB()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteMockTests.java deleted file mode 100644 index e17006b152077..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -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 VolumesDeleteMockTests { - @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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.volumes().delete("rehkunsbfjhh", "w", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupWithResponseMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index a339aa0205922..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Volume; -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 VolumesGetByResourceGroupWithResponseMockTests { - @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 - = "{\"extendedLocation\":{\"name\":\"j\",\"type\":\"zezbjes\"},\"properties\":{\"attachedTo\":[\"lurb\",\"fygpnyhgd\",\"uqs\"],\"detailedStatus\":\"Active\",\"detailedStatusMessage\":\"yvouprsytq\",\"provisioningState\":\"Failed\",\"serialNumber\":\"hmgw\",\"sizeMiB\":2793228844058127263},\"location\":\"rxpfdui\",\"tags\":{\"zluczdq\":\"gyqvpbfjpoqzuc\",\"zielbprnq\":\"urbormvh\",\"mnwsvh\":\"jywzcqyg\"},\"id\":\"ngqiw\",\"name\":\"ejto\",\"type\":\"drrp\"}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Volume response = manager.volumes() - .getByResourceGroupWithResponse("hqmomfeco", "kfrocgbmxl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rxpfdui", response.location()); - Assertions.assertEquals("gyqvpbfjpoqzuc", response.tags().get("zluczdq")); - Assertions.assertEquals("j", response.extendedLocation().name()); - Assertions.assertEquals("zezbjes", response.extendedLocation().type()); - Assertions.assertEquals(2793228844058127263L, response.sizeMiB()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupMockTests.java deleted file mode 100644 index b527c0999f3a5..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Volume; -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 VolumesListByResourceGroupMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"wevtjrieikmwla\",\"type\":\"klfnisyxgucbmt\"},\"properties\":{\"attachedTo\":[\"scnnst\",\"cyyuvtzrxzhclec\"],\"detailedStatus\":\"Active\",\"detailedStatusMessage\":\"qzcl\",\"provisioningState\":\"Provisioning\",\"serialNumber\":\"u\",\"sizeMiB\":2023919269516413149},\"location\":\"hzgyresgzsd\",\"tags\":{\"hychakvyrfbqvum\":\"byorjplb\",\"xfnzlpq\":\"xqjsiuepm\",\"xef\":\"pf\",\"rtux\":\"ulbl\"},\"id\":\"prhfcaeo\",\"name\":\"ifq\",\"type\":\"ywjflobh\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.volumes().listByResourceGroup("kaeplrajubowu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hzgyresgzsd", response.iterator().next().location()); - Assertions.assertEquals("byorjplb", response.iterator().next().tags().get("hychakvyrfbqvum")); - Assertions.assertEquals("wevtjrieikmwla", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("klfnisyxgucbmt", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(2023919269516413149L, response.iterator().next().sizeMiB()); - } -} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListMockTests.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListMockTests.java deleted file mode 100644 index ca2a1f544c0e3..0000000000000 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/test/java/com/azure/resourcemanager/networkcloud/generated/VolumesListMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.networkcloud.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkcloud.NetworkCloudManager; -import com.azure.resourcemanager.networkcloud.models.Volume; -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 VolumesListMockTests { - @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\":[{\"extendedLocation\":{\"name\":\"ggrunozfvualjt\",\"type\":\"oivsdwsngkrf\"},\"properties\":{\"attachedTo\":[\"cjvakmh\"],\"detailedStatus\":\"Error\",\"detailedStatusMessage\":\"a\",\"provisioningState\":\"Succeeded\",\"serialNumber\":\"i\",\"sizeMiB\":5907895514067975579},\"location\":\"x\",\"tags\":{\"pfzsclefyrl\":\"ynuqqkotauratnic\",\"ggnbbuypwovvvsfl\":\"tndqlmf\",\"xrlzhpziha\":\"evnoqayrehjuqwva\",\"fonfdbgm\":\"enqqzlxnqzu\"},\"id\":\"fwmjcwtewfhxwy\",\"name\":\"kbrehzlrynjp\",\"type\":\"ha\"}]}"; - - 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); - })); - - NetworkCloudManager manager = NetworkCloudManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.volumes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("x", response.iterator().next().location()); - Assertions.assertEquals("ynuqqkotauratnic", response.iterator().next().tags().get("pfzsclefyrl")); - Assertions.assertEquals("ggrunozfvualjt", response.iterator().next().extendedLocation().name()); - Assertions.assertEquals("oivsdwsngkrf", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals(5907895514067975579L, response.iterator().next().sizeMiB()); - } -}